Thread Tools Display Modes
Prev Previous Post   Next Post Next
04-28-22, 10:15 PM   #1
onesock
A Murloc Raider
Join Date: May 2021
Posts: 6
Fontstring sizing or something else?

I am trying to create simple frame that displays text. I definitely made the containing frame wide enough to fit the string but it is still wrapping. The string is multiline (will have multiple \n).

Code:
raidLockoutFrame = CreateFrame("ScrollFrame", "NITRaidLockoutFrame", UIParent, "TooltipBorderedFrameTemplate");
raidLockoutFrame:SetPoint("Center", UIParent, "Center", 0, 0)
raidLockoutFrame:SetWidth(400);
raidLockoutFrame:SetHeight(400);
raidLockoutFrame:SetMovable(true);

local text = raidLockoutFrame:CreateFontString(nil, "OVERLAY", "GameFontNormal");
text:SetPoint("TOPLEFT");
text:SetJustifyH("LEFT");
--text:SetNonSpaceWrap(false);
--text:SetWordWrap(false);
raidLockoutFrame.text = text;

...

raidLockoutFrame.text:SetText(CreateLockoutText())
It ends up wordwrapping to this:


I've looked for solutions, tested word wrapping on the fontstring itself (does not work), and the GetWidth function returns 220 for the string (and I am setting the parent frame width to 400).

Any help out there?
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Fontstring sizing or something else?


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