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.

164 Part II ■ <strong>Programming</strong> in <strong>World</strong> <strong>of</strong> <strong>Warcraft</strong>Similarly, methods exist that allow you to set the gradient min <strong>and</strong> maxcolors. In general, if there is a way to accomplish something in XML, there is away to accomplish it in Lua as well.<strong>Creating</strong> Text using FontStringsAdding text to your frames is very similar to adding textures. Inside a element, you define a element <strong>and</strong> then customize it. Fontstrings have many different XML attributes that can be used to change thestyle <strong>of</strong> the displayed text, shown in Table 9-4.Table 9-4: Attributes Available to FontString ElementsATTRIBUTE DESCRIPTIONfontThe path to a font file to be used when displaying the text. Thiscan be a file included with <strong>WoW</strong>, or a true type font supplied bya custom addon.bytestextspacingoutlinemonochromenonspacewrapjustifyVjustifyHmaxLinesindentedinheritsA positive number expressing a limit on the number <strong>of</strong>characters to be displayed in the FontString.The text to be displayed.Sets the spacing, in pixels, between lines if the FontString hasmultiple lines.Specifies the outline type <strong>of</strong> the FontString. Should be one <strong>of</strong>the following values: NONE, NORMAL, THICK.A Boolean value specifying whether the font should bemonochromatic (grayscale).A Boolean value that specifies whether long strings withoutspaces are wrapped or truncated. When this is true, the string iswrapped.Specifies the vertical justification <strong>of</strong> the text using one <strong>of</strong> thefollowing values: TOP, MIDDLE, BOTTOM.Specifies the horizontal justification <strong>of</strong> the text as one <strong>of</strong> thefollowing values: LEFT, CENTER, RIGHT.Specifies the maximum number <strong>of</strong> lines to be displayed in aFontString.Specifies whether or not lines after the first line in theFontString are indented, if the FontString has multiplelines.Specifies a font definition from which attributes <strong>and</strong> elementsshould be inherited.

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

Saved successfully!

Ooh no, something went wrong!