12.07.2015 Views

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 29 ■ Widget <strong>Reference</strong> 1137This value is based on the text currently displayed; e.g. a short text label resultsin a smaller width than a longer block <strong>of</strong> text. Very long blocks <strong>of</strong> text that don’tfit the font string’s dimensions all result in similar widths, because this methodmeasures the width <strong>of</strong> the text displayed, which is truncated with an ellipsis(‘‘...’’).Returns:width—Width <strong>of</strong> the text currently displayed in the font string(in pixels) (number)GetTextReturns the text currently set <strong>for</strong> display in the font string.text = FontString:GetText()This is not necessarily the text actually displayed: text that does not fit withinthe FontString’s dimensions will be truncated with an ellipsis (‘‘...’’) <strong>for</strong>display.Returns:text—Text to be displayed in the font string (string)SetAlphaGradientCreates an opacity gradient over the text in the font string.FontString:SetAlphaGradient(start, length)Seen in the default UI when quest text is presented by a questgiver (if the‘‘Instant Quest Text’’ feature is not turned on): This method is used with alength <strong>of</strong> 30 to fade in the letters <strong>of</strong> the description, starting at the firstcharacter; then the start value is incremented in an OnUpdate script, creatingthe animated fade-in effect.Arguments:start—Character position in the font string’s text at which the gradient shouldbegin (between 0 <strong>and</strong> string.len(fontString:GetText()) - 6) (number)length—Width <strong>of</strong> the gradient in pixels, or 0 to restore the text to full opacity(number)SetFormattedTextSets the text displayed in the font string using <strong>for</strong>mat specifiers.FontString:SetFormattedText(“<strong>for</strong>matString“, ...)Equivalent to :SetText(<strong>for</strong>mat(<strong>for</strong>mat, ...)),butdoesnotcreateathrowaway Lua string object, resulting in greater memory-usage efficiency.Arguments:<strong>for</strong>matString—A string containing <strong>for</strong>mat specifiers (as withstring.<strong>for</strong>mat()) (string)...—A list <strong>of</strong> values to be included in the <strong>for</strong>matted string (list)SetMultilineIndentSets whether long lines <strong>of</strong> text are indented when wrapping.FontString:SetMultilineIndent(enable)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!