Thread Tools Display Modes
01-20-14, 09:06 AM   #1
Mr.Dio
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 5
Unhappy Need Help! Crop Text...

Hello, please tell me. How to crop a text that goes beyond the frame.

Sorry for my english
  Reply With Quote
01-20-14, 09:43 AM   #2
jaliborc
A Chromatic Dragonspawn
 
jaliborc's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 196
I think you will need to parent it to a ScrollFrame. There might be other solutions, but I think this is the onyl one.
  Reply With Quote
01-20-14, 11:58 AM   #3
Malsomnus
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Apr 2013
Posts: 203
I'm almost certain you can achieve that by using :SetWidth().
__________________
SanityCheck - If you've ever said the words "Sorry, I forgot" then you need this add-on.

Remember, every time you post a comment on an add-on, a kitten gets its wings!
  Reply With Quote
01-20-14, 12:34 PM   #4
Clamsoda
A Frostmaul Preserver
Join Date: Nov 2011
Posts: 269
Originally Posted by Malsomnus View Post
I'm almost certain you can achieve that by using :SetWidth().
SetWidth() on a string results in "..." truncation, which he doesn't want, as indicated by the amazing MS Paint photo =3.
  Reply With Quote
01-20-14, 01:08 PM   #5
Mr.Dio
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 5
Originally Posted by Malsomnus View Post
I'm almost certain you can achieve that by using :SetWidth().
This Is not work
Originally Posted by jaliborc View Post
I think you will need to parent it to a ScrollFrame. There might be other solutions, but I think this is the onyl one.
Thx! Great works!

scrollframe = CreateFrame("ScrollFrame")
scrollframe:SetSize(50, 20)
scrollframe:SetPoint("CENTER")

content = CreateFrame("Frame", nil, scrollframe)
content:SetSize(200, 20)
content:SetPoint("CENTER")
text = content:CreateFontString("PlayerHealthPTextFrame", "OVERLAY")
text:SetAllPoints()
text:SetFont("Fonts\\FRIZQT__.TTF", 8, "OUTLINE")
text:SetText("Interface\\GLUES\\MainMenu\\Glues-BlizzardLogo")
text:SetWordWrap(false)
scrollframe:SetScrollChild(content)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Need Help! Crop 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