Thread Tools Display Modes
03/18/21, 08:16 PM   #1
Armodeniz
 
Armodeniz's Avatar
AddOn Author - Click to view addons
Join Date: May 2020
Posts: 3
Question 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?
  Reply With Quote
03/19/21, 02:54 AM   #2
andy.s
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 40
Lua Code:
  1. <Label wrapMode="TRUNCATE">
  2.     <Dimensions x="110" y="20" />
  Reply With Quote
03/19/21, 04:11 AM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,966
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
  Reply With Quote
03/19/21, 04:17 AM   #4
Armodeniz
 
Armodeniz's Avatar
AddOn Author - Click to view addons
Join Date: May 2020
Posts: 3
Talking

Originally Posted by andy.s View Post
Lua Code:
  1. <Label wrapMode="TRUNCATE">
  2.     <Dimensions x="110" y="20" />
Thank you! problem solved
  Reply With Quote
03/19/21, 04:17 AM   #5
Armodeniz
 
Armodeniz's Avatar
AddOn Author - Click to view addons
Join Date: May 2020
Posts: 3
Talking

Originally Posted by Baertram View Post
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
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » How can i set a label text's max width?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off