WoW:XML/ButtonStyle: Difference between revisions

From AddOn Studio
< XML
Jump to navigation Jump to search
No edit summary
m (Move page script moved page XML/ButtonStyle to XML/ButtonStyle without leaving a redirect)
 
(6 intermediate revisions by one other user not shown)
Line 10: Line 10:


== Attributes ==
== Attributes ==
* style (string) - name of a [[XML/Font|Font]] or [[XML/FontString|FontString]] to base the font style on.
* style (string) - name of a [[XML/Font|Font]] or [[XML/FontString|FontString]] to base the font style on. Effective default value, none.


== Summary ==
== Summary ==
Line 16: Line 16:


=== Example ===
=== Example ===
<pre>
  <Frame name="MyFrame">
  <Frame name="MyFrame">
   <Layers>
   <Layers>
Line 31: Line 32:
   </Button>
   </Button>
  </Frame>
  </Frame>
</pre>


This example will show an opaque color texture, painted white, and a button where the normal state font has been changed to a large font.
This example will show an opaque color texture, painted white, and a button where the normal state font has been changed to a large font.


== Details ==
== Details ==
For a button, a ButtonStyle for a particular state overrides the Button's ButtonText element. So, for example, when a button is in the Normal state, then NormalFont would pick a Font to inherit to override ButtonText properties while the button is that state.


For the 'style' attribute, no value or empty string would act as though no ButtonStyle element was added. In this case would inherit ButtonStyle instead. If there is no ButtonStyle to inherit, then no text is rendered.
For the 'style' attribute, no value or empty string would act as though no ButtonStyle element was added. In this case would inherit ButtonStyle instead. If there is no ButtonStyle to inherit, and not enough details to render in the ButtonText element, then no text is rendered. So effectively there is no default value for the ButtonStyle elements.

Latest revision as of 04:49, 15 August 2023

XML UI ← XML types < ButtonStyle < Button

ButtonStyle defines a visual style for Button state. At this time, attribute values are basically names of Fonts or FontStrings which the button will use to render its font.

Inheritance[edit]

Inherited by: none, Inherits: none, Defined in: Button

Elements[edit]

none

Attributes[edit]

  • style (string) - name of a Font or FontString to base the font style on. Effective default value, none.

Summary[edit]

Although this type was meant to encapsulate a whole style for a button state or general button, it only conveys the font information. It does not itself define a font or FontString and has no attributes or elements to support this. Currently the ButtonStyle 'style' can basically be treated like 'inherits' on FontString.

Example[edit]

 <Frame name="MyFrame">
   <Layers>
     <Layer>
       <Texture>
         <Size x="100" y="100" />
         <Color a="1" r="1" g="1" b="1" />
       </Texture>
     </Layer>
   </Layers>
   <Button inherits="UIPanelButtonTemplate" text="Big Text">
     <Size x=150 y=60>
     <Anchors><Anchor point="BOTTOM"/></Anchors>
     <NormalFont style="GameFontNormalHuge"/>
   </Button>
 </Frame>

This example will show an opaque color texture, painted white, and a button where the normal state font has been changed to a large font.

Details[edit]

For a button, a ButtonStyle for a particular state overrides the Button's ButtonText element. So, for example, when a button is in the Normal state, then NormalFont would pick a Font to inherit to override ButtonText properties while the button is that state.

For the 'style' attribute, no value or empty string would act as though no ButtonStyle element was added. In this case would inherit ButtonStyle instead. If there is no ButtonStyle to inherit, and not enough details to render in the ButtonText element, then no text is rendered. So effectively there is no default value for the ButtonStyle elements.