ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   How can i set a label text's max width? (https://www.esoui.com/forums/showthread.php?t=9636)

Armodeniz 03/18/21 08:16 PM

How can i set a label text's max width?
 
I set a Label control like this:
xml Code:
  1. <Label name="$(parent)Name" font="ZoFontGameSmall" color="INTERFACE_COLOR_TYPE_TEXT_COLORS:INTERFACE_TEXT_COLOR_DISABLED" width="110" height="20" wrapMode="TEXT_WRAP_MODE_TRUNCATE">
  2.     <Anchor relativeTo="$(parent)Star" point="LEFT" relativePoint="RIGHT" offsetX="2" offsetY="0"/>
  3. </Label>

It is in a virtual control and will be created many times in lua file.

But it seems that the wrapMode="TEXT_WRAP_MODE_TRUNCATE" doesnt work, the long text will expand without being truncated. How can i set the max width of a text?

andy.s 03/19/21 02:54 AM

Lua Code:
  1. <Label wrapMode="TRUNCATE">
  2.     <Dimensions x="110" y="20" />

Baertram 03/19/21 04:11 AM

You need to set the Dimensions for a height & width, and/or DimensionConstraints for the min and max values of a control in order to assure it's not getting wider e.g.
https://wiki.esoui.com/UI_XML#DimensionConstraints

Armodeniz 03/19/21 04:17 AM

Quote:

Originally Posted by andy.s (Post 43496)
Lua Code:
  1. <Label wrapMode="TRUNCATE">
  2.     <Dimensions x="110" y="20" />

Thank you! problem solved

Armodeniz 03/19/21 04:17 AM

Quote:

Originally Posted by Baertram (Post 43497)
You need to set the Dimensions for a height & width, and/or DimensionConstraints for the min and max values of a control in order to assure it's not getting wider e.g.
https://wiki.esoui.com/UI_XML#DimensionConstraints

Thank you! problem solved


All times are GMT -6. The time now is 12:10 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI