Comments (5)
I think its fixed in dev branch (did a lot of work on PanelTabs and scrollers and tried to reproduce using a modified version of the code you gave me - looks good now).
I'll release a version soon, if its not fixed in the new version please reopen this ticket.
Thanks :)
from geonbit.ui.
Hello @SerialKicked,
Just making sure, did you set scrollbar max value or alternatively set panel.Scrollbar.AdjustMaxAutomatically = true;
?
Thanks,
Edit: Also, i dunno if it's related or not, elements out of the view (here, the ~990 following lines) are still apparently being drawn/processed. The above example decreased my FPS massively. While it's not really something that would happen with real code, that information might be relevant.
Thanks for the tip. Up until now I didn't optimize the UI based on culling, as UIs are commonly entirely in screen and the panels with scrollbars are quite new. I don't view this as an urgent feature but it could be nice, maybe for future versions :)
from geonbit.ui.
No i didn't. I assumed PanelOverflowBehavior would automatically set the values for the scrollbar, I've not seen AdjustMaxAutomatically in the doc either hence my confusion.
However, i just tried and it triggered another interesting result:
The bar itself is scrolling with the panel's content (It's the same with the much simpler sample code of earlier, scrollbar will even completely scroll out of view).
from geonbit.ui.
Can you post the code that creates the panel from the screenshot?
from geonbit.ui.
It's quite a lot of code with sub elements and function calls.
The problem is exactly the same with the code i posted earlier.
protected override void BuildMenu()
{
MainPanel = new Panel(new Vector2(850, 400), PanelSkin.Default, Anchor.BottomCenter, new Vector2(0,100));
PanelTabs tabs = new PanelTabs();
MainPanel.AddChild(tabs);
var cluttertab = tabs.AddTab(Global.catalog.GetString("Furniture"));
cluttertab.panel.Padding = new Vector2(10,20);
// List buildable clutter
buildlist = GetClutterList(CreativeMode);
cluttertab.panel.PanelOverflowBehavior = PanelOverflowBehavior.VerticalScroll;
foreach (var item in buildlist)
{
Texture2D isprite = World.DB.Sprites[item.SpriteFile[0]];
var isize = new Vector2(64, 64);
var itxt = item.Name;
var pan = Overlay.AddIcon(isprite, itxt, new Vector2(200, 100), Anchor.AutoInline);
pan.AttachedData = item;
// [cut] OnClick events
cluttertab.panel.AddChild(pan);
}
cluttertab.panel.Scrollbar.AdjustMaxAutomatically = true;
// [cut] other tabs
}
AddIcon looks like this
/// <summary>
/// Build "icon" looking UI element
/// </summary>
public static Panel AddIcon(Texture2D pTexture, string pTitle, Vector2 pSize, Anchor pAnchor)
{
var panel = new Panel(pSize, PanelSkin.None, pAnchor)
{
Padding = new Vector2(5, 5)
};
Icon icon = new Icon(IconType.None, Anchor.TopCenter, 1)
{
Texture = pTexture
};
panel.AddChild(icon);
panel.AddChild(new Paragraph(pTitle, Anchor.BottomCenter));
return panel;
}
from geonbit.ui.
Related Issues (20)
- Crash in example app, attempts to draw a panel of height 443809248 HOT 1
- netcore? HOT 7
- MonoGame 3.8 HOT 1
- Support for non-monospace fonts HOT 3
- Change docs in relation to moving Content HOT 1
- Extra steps for Linux necessary for Windows too HOT 3
- State dependent UI-rendering HOT 1
- Analog of divs in HTML HOT 1
- Preventing in-game click fall through GenoBit.UI entities HOT 4
- Removing non-root entities (inside parent) HOT 5
- Implementing inventory HOT 14
- monogame 3.8? HOT 1
- Question about install HOT 1
- Problem with custom font and rich texts. HOT 11
- Could not resolve data type. HOT 3
- Exception during Initialize HOT 1
- NuGet Installation Documenation Is Misleading HOT 1
- Font-less version of GeonBit? HOT 5
- Absolute -> relative positioning HOT 8
- Could not find ContentTypeReader Type HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geonbit.ui.