Thread Tools Display Modes
03-27-21, 03:53 PM   #1
Benalish
A Flamescale Wyrmkin
 
Benalish's Avatar
Join Date: Dec 2012
Posts: 122
Wrap button text

Is there a way to set the maximum text length of a button, so that the text cannot come out from it?
For example, if I set the text with

Lua Code:
  1. button.text:SetText("This is a long long long text")

how can i make the text look like

Lua Code:
  1. This is a long...

Thanks in advance
  Reply With Quote
03-27-21, 05:11 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Either fix the size of the fontstring or anchor both ends

Code:
button.Text:ClearAllPoints()
button.Text:SetPoint("LEFT", 4, 0)
button.Text:SetPoint("RIGHT", -4, 0)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
03-28-21, 07:47 AM   #3
Benalish
A Flamescale Wyrmkin
 
Benalish's Avatar
Join Date: Dec 2012
Posts: 122
Thank you very much!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Wrap button text

Thread Tools
Display Modes

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