WoW:XML/Inset: Difference between revisions

From AddOn Studio
< XML
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
Elements: AbsInset, RelInset
{{uixmltype}}


Attributes: left, right, top, bottom
[[XML/Inset|Inset]] alters the hit rectangle or 'hit rect' for user input. Defines a 4-way set of margins, positioning one area within another. See [[XML/Dimension|Dimension]] for numerical value pairs use type and [[XML/Value|Value]] for single value version. Inset is used for properties such as [[XML_properties#TextInsets|TextInsets]] and [[XML_properties#HitRectInsets|HitRectInsets]].


Defines a 4-way set of margins, positioning one area within another.
== Inheritance ==
Inherited by: none, Inherits: none, Defined in: [[XML/Backdrop|Backdrop]],[[XML/EditBox|EditBox]],[[XML/Frame|Frame]]


Used as:
== Elements ==
* [[XML/AbsInset|AbsInset]]
* [[XML/RelInset|RelInset]]


As <BackgroundInsets> to "push in" the background texture to put in line with the border or edge textures of the frame,
== Attributes ==
* left (int) - Default is '0'.
* right (int) - Default is '0'.
* top (int) - Default is '0'.
* bottom (int) - Default is '0'.


As <TextInsets> to define text margins,
== Summary ==
[[XML/Inset|Inset]] alters the active hit area for positional input devices.  Hit rects are used for determining which screen element belongs to an input event by having an associated screen rectangle. [[XML/Inset|Inset]] type changes the default 'hit rect' for its display element. Inset is used for properties like: <BackgroundInsets> to "push in" the background texture to put in line with the border or edge textures of the frame; <TextInsets> to define text margins; <HitRectInsets> to modify a frame's hit rectangle in relation to its normal size.


As <HitRectInsets> to modify a frame's hit rectangle in relation to its normal size.
=== Example ===
 
<CheckButton name="MyCheckTemplate" inherits="UICheckButtonTemplate" virtual="true">
Examples:
  <HitRectInsets>
 
    <[[XML/AbsInset|AbsInset]] left="0" right="-100" top="0" bottom="0"/>
<HitRectInsets>
  </HitRectInsets>
    <AbsInset left="0" right="-100" top="0" bottom="0"/>
</CheckButton>
</HitRectInsets>
  <[[XML/Frame|Frame]] name="MyFrame">
 
  <HitRectInsets>
  <HitRectInsets>
     <RelInset left="0" right="-0.1" top="0" bottom="0"/>
     <RelInset left="0" right="-100" top="0" bottom="0"/>
  </HitRectInsets>
</HitRectInsets>
  <Layers>
 
    <[[XML/Layer|Layer]]>
<HitRectInsets left="0" right="-100" top="0" bottom="0" />
      <[[XML/Texture|Texture]]>
 
        <Size x="100" y="100" />
<TextInsets left="2" right="2" top="2" bottom="2" />
        <HitRectInsets>
 
          <[[XML/AbsInset|AbsInset]] left="0" right="-100" top="0" bottom="0"/>
From FrameXML\OptionsFrameTemplates.xml:
        </HitRectInsets>
        <Color a="1" r="1" g="1" b="1" />
      </Texture>
      <Texture>
        <Size x="100" y="100" />
        <HitRectInsets left="0" right="-100" top="0" bottom="0" />
        <Color a="1" r="1" g="1" b="1" />
      </Texture>
    </Layer>
  </Layers>
</Frame>


<CheckButton name="OptionsCheckButtonTemplate" inherits="UICheckButtonTemplate" virtual="true">
This example will show a frame with several textures, with altered 'hit rect' insets. The <CheckBotton> template allows you to click the checkbox up to 100 pixels (scaled) to the right of the box itself (where the label would be).
<HitRectInsets>
<AbsInset left="0" right="-100" top="0" bottom="0"/>
</HitRectInsets>
</CheckButton>


This allows you to click the checkbox up to 100 pixels (scaled) to the right of the box itself (where the label would be).
== Details ==


== BackgroundInsets ==
== BackgroundInsets ==
You add the background file which is the dialog box background. You then add the edgeFile which will be the dialog box border texture (this will go around the border or "edge" of the frame). You will notice if you remove the background insets you will see the background texture on the outside of the edge texture. BackgroundInsets fixes this.
You add the background file which is the dialog box background. You then add the edgeFile which will be the dialog box border texture (this will go around the border or "edge" of the frame). You will notice if you remove the background insets you will see the background texture on the outside of the edge texture. BackgroundInsets fixes this.
[[Category:Interface customization]]
[[Category:Interface customization]]

Revision as of 15:45, 27 March 2017

XML UI ← XML types < Inset

Inset alters the hit rectangle or 'hit rect' for user input. Defines a 4-way set of margins, positioning one area within another. See Dimension for numerical value pairs use type and Value for single value version. Inset is used for properties such as TextInsets and HitRectInsets.

Inheritance

Inherited by: none, Inherits: none, Defined in: Backdrop,EditBox,Frame

Elements

Attributes

  • left (int) - Default is '0'.
  • right (int) - Default is '0'.
  • top (int) - Default is '0'.
  • bottom (int) - Default is '0'.

Summary

Inset alters the active hit area for positional input devices. Hit rects are used for determining which screen element belongs to an input event by having an associated screen rectangle. Inset type changes the default 'hit rect' for its display element. Inset is used for properties like: <BackgroundInsets> to "push in" the background texture to put in line with the border or edge textures of the frame; <TextInsets> to define text margins; <HitRectInsets> to modify a frame's hit rectangle in relation to its normal size.

Example

<CheckButton name="MyCheckTemplate" inherits="UICheckButtonTemplate" virtual="true">
  <HitRectInsets>
    <AbsInset left="0" right="-100" top="0" bottom="0"/>
  </HitRectInsets>
</CheckButton>
<Frame name="MyFrame">
 <HitRectInsets>
   <RelInset left="0" right="-0.1" top="0" bottom="0"/>
 </HitRectInsets>
 <Layers>
    <Layer>
      <Texture>
        <Size x="100" y="100" />
        <HitRectInsets>
          <AbsInset left="0" right="-100" top="0" bottom="0"/>
        </HitRectInsets>
        <Color a="1" r="1" g="1" b="1" />
      </Texture>
      <Texture>
        <Size x="100" y="100" />
        <HitRectInsets left="0" right="-100" top="0" bottom="0" />
        <Color a="1" r="1" g="1" b="1" />
      </Texture>
    </Layer>
  </Layers>
</Frame>

This example will show a frame with several textures, with altered 'hit rect' insets. The <CheckBotton> template allows you to click the checkbox up to 100 pixels (scaled) to the right of the box itself (where the label would be).

Details

BackgroundInsets

You add the background file which is the dialog box background. You then add the edgeFile which will be the dialog box border texture (this will go around the border or "edge" of the frame). You will notice if you remove the background insets you will see the background texture on the outside of the edge texture. BackgroundInsets fixes this.