Quantcast Help with Slider template - WoWInterface
Thread Tools Display Modes
01-16-18, 05:52 AM   #1
Likos
A Murloc Raider
 
Likos's Avatar
Join Date: Jul 2015
Posts: 5
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?
  Reply With Quote
01-17-18, 11:29 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,685
Have you tried using the slider templates Blizzard provides?
http://www.wowinterface.com/forums/s...ad.php?t=40444
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
01-17-18, 12:14 PM   #3
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 883
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?
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle and Move Pad Plus.
  Reply With Quote
01-26-18, 04:05 AM   #4
Likos
A Murloc Raider
 
Likos's Avatar
Join Date: Jul 2015
Posts: 5
Originally Posted by zork View Post
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
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Help with Slider template

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off