WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Help with Slider template (https://www.wowinterface.com/forums/showthread.php?t=55976)

Likos 01-16-18 05:52 AM

Help with Slider template
 
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?

zork 01-17-18 11:29 AM

Have you tried using the slider templates Blizzard provides?
http://www.wowinterface.com/forums/s...ad.php?t=40444

Fizzlemizz 01-17-18 12:14 PM

The slider shows up in the center of the screen for me. Are you sure you have the files/xml ordered so the the template is implemented before the TestFrame is created?

Likos 01-26-18 04:05 AM

Quote:

Originally Posted by zork (Post 326528)
Have you tried using the slider templates Blizzard provides?
http://www.wowinterface.com/forums/s...ad.php?t=40444

i change inheritor for test slider from my template to blizzard "OptionsSliderTemplate", and test slider appeared on test frame.

...

After some time i find my error... In other xml i already created a template with that name...

Thanks everyone for help


All times are GMT -6. The time now is 10:53 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI