Size Property in layout files and Font Size

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Wed Feb 03, 2016 21:58

Size Property in layout files and Font Size

Postby TheWanderer » Sat Nov 09, 2019 23:03

Hi everyone,

So I've created the UI for my project using the Taharez looknfeel files that come with the source and my own layout files. Almost all of elements in those layout files use the proportional field in UDim's when setting their size so that the UI will scale appropriately at different resolutions.

One problem which I've run across is that at certain resolutions, some elements are too short in order to fit the text. I wanted to see if there was a way to state in the layout files some minimum height for a window and whether that minimum height can be set to the height of the font being used in it.

For example, in the code below, the text in the "Seed_EditBox" element is not tall enough to fit the text input into it when at 1920x1200.

Code: Select all

   <Window type="HorizontalLayoutContainer" >
      <Property name="Position" value="{{0.01,0.0},{0.15,0}}" />
      <Property name="Size" value="{{0.98,0},{0.05,0}}" />

      <Window name="Seed_Label"  type="TaharezLook/Label" >
         <Property name="Text" value="Seed" />
         <Property name="Size" value="{{0.33,0},{0.05,0}}" />
         <Property name="HorzFormatting" value="LeftAligned" />

      <Window name="Seed_EditBox"  type="TaharezLook/Editbox" >
         <Property name="Size" value="{{0.63,0},{0.05,0}}" />
         <Property name="MaxTextLength" value="11" />
         <Property name="ValidationString" value="^[0-9]*$" />

Thank you for any help and let me know if there is any more information which I can provide!

Edit: Almost forgot:

Code: Select all

[14:55:12] Cegui: ---- Version: 0.8.4 (Build: Jan 16 2018 Static Debug Microsoft Windows MSVC++ 11.0 32 bit) ----
[14:55:12] Cegui: ---- Renderer module is: CEGUI::OgreRenderer - Official OGRE based 2nd generation renderer module. ----
[14:55:12] Cegui: ---- XML Parser module is: CEGUI::RapidXMLParser - Official RapidXML based parser module for CEGUI ----
[14:55:12] Cegui: ---- Image Codec module is: OgreImageCodec - Integrated ImageCodec using the Ogre engine. ----
[14:55:12] Cegui: ---- Scripting module is: None ----

Return to “Help”

Who is online

Users browsing this forum: No registered users and 5 guests