Jump to content

Recommended Posts

Posted

I don't know if it's technically possible to do this, but I think a GetLabelSize() should be added for the UI. While designing the main menu for my game, I had to get the width and height of the label many times. Since there is no command like GetLabelSize(), I tried to do it manually with mathematical formulas, but the result is not 100% accurate

(The reason I do this with mathematical formulas is that when the window resolution changes, the font height and width change. I have to use a formula so that the width and height values of the label are appropriate for each resolution)

  • Like 1
Posted

In C++ there is a method in the Interface class I use for some positioning:
int GetTextWidth(shared_ptr<Font> font, const float scale, const WString& text, const int weight);

I have not documented this because I am not 100% sure how it works with DPI scaling, outside of my own usage of it.

  • Like 1

Let's build cool stuff and have fun. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...