Wikia

WoWWiki

XML/Inset

Talk0
102,017pages on
this wiki

< XML

Revision as of 23:24, September 24, 2012 by Celess22 (Talk | contribs)

(diff) ←Older revision | Latest revision (diff) | Newer revision → (diff)
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 Edit

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

Elements Edit

Attributes Edit

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

Summary Edit

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 Edit

<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 Edit

BackgroundInsets Edit

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.

Around Wikia's network

Random Wiki