Not logged inOpenClonk Forum
Up Topic General / Feedback and Ideas / centered UI positioning
- - By Apfelclonk Date 2015-02-14 20:17
I guess that's sort of a topic which is already talking about sometimes. I'm talking about making it possible to place UI Elements in the center of any 2d-axis. What I know so far is, that you cannot receive the clients screen height and width to make it grabbable with C4Script. But...

I thought there must be some way, because the UpperBoarderTitle is also rendered in the center of the x-axis. So why is it not possible to tell the renderer via C4Script, maybe with a constant (POS_CenterX/POS_CenterY/POS_CenterXY), to draw this graphic relatively to the center of any given axis. The position of the graphic could be used to define offset to the given axis. That way you could create an UI Element at the bottom of the screen, right in the middle like this:

obj->SetProperty("UI_Positioning", POS_CenterX);
obj->SetPosition(0, -graphic_height);

Maybe you also extend the principle with the mouse position (POS_Mouse) to make easier for users to create custom mouse graphics (also give Feedback when hovored over UI Elements of the backpack or such?). This might be thinking far in the future but I might find it usefull to get more control over how the mouse is displayed.
Reply
Parent - By Zapper [de] Date 2015-02-14 20:36
In the Controls branch, this is very possible. See here - not only is the big menu in the middle centered, but also the inventory slots at the bottom.

I hopeā„¢ I'll find some time during this semester break to continue work on the Controls branch
Parent - - By Pyrit Date 2015-02-14 21:03
It would also be cool if one would be able to get the screens position relative to the landscape. You could e.g. make raindrops appear on the screen, but only where there's sky on the screen.
Parent - By Zapper [de] Date 2015-02-14 21:27
That sounds dangerous. The screen position is not synchronized. Other clients do not know where your screen is.
Up Topic General / Feedback and Ideas / centered UI positioning

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill