Hello everyone!
I make simple template for Slider component in XML, such as:
Code:
<Slider name="SliderTemplate" orientation="HORIZONTAL" minValue="0" maxValue="1" valueStep="0.01" defaultValue="1" virtual="true">
<Size x="200" y="16" />
<Backdrop bgFile="Interface\Buttons\UI-SliderBar-Background" edgeFile="Interface\Buttons\UI-SliderBar-Border" tile="true">
<EdgeSize>
<AbsValue val="8"/>
</EdgeSize>
<TileSize>
<AbsValue val="8"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="3" right="3" top="6" bottom="6"/>
</BackgroundInsets>
</Backdrop>
<ThumbTexture file="Interface\Buttons\UI-SliderBar-Button-Horizontal">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
</ThumbTexture>
<Layers>
<Layer level="ARTWORK">
<FontString parentKey="curValue" name="$parentText" inherits="GameFontNormalSmall">
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM" x="0" y="-3" />
</Anchors>
</FontString>
<FontString parentKey="minValue" inherits="GameFontNormalSmall" text="0">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" x="0" y="-3" />
</Anchors>
</FontString>
<FontString parentKey="maxValue" inherits="GameFontNormalSmall" text="1">
<Anchors>
<Anchor point="TOPRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="-3" />
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnValueChanged>
self.curValue:SetText(string.format("%.2f", value))
</OnValueChanged>
</Scripts>
</Slider>
and using this template on a frame:
Code:
<Frame name="TestFrame" inherits="BorderFrameTemplate" parent="UIParent">
<Size x="300" y="200" />
<Anchors>
<Anchor point="CENTER" x="0" y="0" />
</Anchors>
<Frames>
<Frame parentKey="Content" inherits="ContentFrameTemplate">
<Anchors>
<Anchor point="TOPLEFT" x="-5" y="2" />
<Anchor point="BOTTOMRIGHT" x="5" y="-2" />
</Anchors>
<Frames>
<Slider parentKey="Slider1" inherits="SliderTemplate">
<Anchors>
<Anchor point="CENTER" x="0" y="0" />
</Anchors>
</Slider>
</Frames>
</Frame>
</Frames>
</Frame>
In game i have my test frame, but inside this frame not showing slider. Also mouse have reaction on this slider, such as this slider have no textures.
What i do wrong?