WoW:XML/FontString: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 3: Line 3:


== Inheritance ==
== Inheritance ==
Inherited by: none, Inherits: [[XML/LayoutFrame|LayoutFrame]], Defined in: [[XML/Layer|Layer]], [[XML/Button|Button]], others<br/>
:Inherited by: none, Inherits: [[XML/LayoutFrame|LayoutFrame]], Widget API: [[UIOBJECT FontString|FontString]]
Widget API: [[UIOBJECT FontString|UIObject FontString]]
:Defined in: [[XML/Layer|Layer]], [[XML/Button|Button]], ...


== Elements ==
== Elements ==
Line 29: Line 29:


== Summary ==
== Summary ==
''The Fontstring element is used to display a text in the user interface. The text displayed by the Fontstring element can be changed with the LUA function <fontstringobject>:SetText() or read with the function <fontstringobject>:GetText().''
The Fontstring element is used to display a text in the user interface. The text displayed by the Fontstring element can be changed with the LUA function fontStringObject:SetText() or read with the function fontStringObject:GetText().


=== Example ===
=== Example ===
Line 36: Line 36:
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <[[XML/Font|Font]] name="MyFont" font="myfont.ttf" virtual="true">
   <[[XML/Font|Font]] name="MyFont" font="myfont.ttf" virtual="true">
     <FontHeight>
     <nowiki><FontHeight>
       <AbsValue val="12"/>
       <AbsValue val="12"/>
     </FontHeight>
     </FontHeight>
Line 52: Line 52:
       </Layer>
       </Layer>
     </Layers>
     </Layers>
   </Frame>
   </Frame></nowiki>
  </Ui>
  </Ui>


This example creates a Font that is used by a FontString.
This example creates a Font that is used by a FontString.
Line 72: Line 71:


=== Another Example ===
=== Another Example ===
 
<pre>
<FontString name="$parentFontString" font="Fonts\FRIZQT__.TTF"
<FontString name="$parentFontString" font="Fonts\FRIZQT__.TTF"
      text="Example Text" justifyH="LEFT" justifyV="TOP">
      text="Example Text" justifyH="LEFT" justifyV="TOP">
  <Color r="1" g="0.8" b="1" a="1"/>
  <Color r="1" g="0.8" b="1" a="1"/>
  <FontHeight val="12"/>
  <FontHeight val="12"/>
  <Anchors>
  <Anchors>
     <Anchor point="TOPLEFT" relativeTo="$parent" x="20" y="-20" />
     <Anchor point="TOPLEFT" relativeTo="$parent" x="20" y="-20" />
  </Anchors>
  </Anchors>
  <Shadow>
  <Shadow>
    <Offset x="1" y="1" />
    <Offset x="1" y="1" />
    <Color r="0" g="0" b="0"/>
    <Color r="0" g="0" b="0"/>
  </Shadow>
  </Shadow>
</FontString>
</FontString>
 
</pre>


== Notes ==
== Notes ==
* <FontString> must be within a ''[[XML_User_Interface#Layers_and_Textures|&lt;Layer&gt;]]
* <nowiki><FontString></nowiki> must be within a [[XML_User_Interface#Layers_and_Textures|&lt;Layer&gt;]]
* attribute 'font' needs to be set in order for element "FontHeight" to work
* attribute 'font' needs to be set in order for element 'FontHeight' to work


== See also ==
== See also ==
* [{{wdnlink|FrameXML/Fonts.xml}} FrameXML/Fonts.xml] - for the system default list of inheritable fonts
* {{wdnlink|FrameXML/Fonts.xml}} FrameXML/Fonts.xml - for the system default list of inheritable fonts
* [[Widget_API#FontString]] for more code
* [[Widget_API#FontString]] for more code
[[Category:XML elements]]
[[Category:XML elements]]