Not logged inOpenClonk Forum
Up Topic centered UI positioning

This board is threaded (i.e. has a tree structure). Please use the Reply button of the specific post you are referring to, not just any random button. If you want to reply to the topic in general, use the Post button near the top and bottom of the page.

Post Reply
In Response to Apfelclonk
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.

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill