Wikia

WoWWiki

UIOBJECT Slider

Talk0
98,585pages on
this wiki
Revision as of 17:20, April 9, 2010 by Ameyaselene (Talk | contribs)

(diff) ←Older revision | Latest revision (diff) | Newer revision → (diff)

Contents

Class Hierarchy, API, And Derivatives Edit

For class hierarchy and method listing, see main listing here: Widget API Slider.

Construction Edit

 local MySlider = CreateFrame("Slider", "MySliderGlobalName", ParentFrame, "OptionsSliderTemplate")

Width, Height, Orientation, And Position Edit

Width and height are handled the same as any other widget:

 MySlider:SetWidth(20)
 MySlider:SetHeight(100)

To set your slider to a vertical orientation:

 MySlider:SetOrientation('VERTICAL')

Or for a horizontal slider:

 MySlider:SetOrientation('HORIZONTAL')

Special Global Objects Created By Template During Initialization Edit

Some special objects are created when using the "OptionsSliderTemplate" template during initialization (CreateFrame). You can access these objects using the LUA getglobal function, as outlined below:

 MySlider.tooltipText = 'This is the Tooltip hint' --Creates a tooltip on mouseover.
 getglobal(MySlider:GetName() .. 'Low'):SetText('1'); --Sets the left-side slider text (default is "Low").
 getglobal(MySlider:GetName() .. 'High'):SetText('100'); --Sets the right-side slider text (default is "High").
 getglobal(MySlider:GetName() .. 'Text'):SetText('5'); --Sets the "title" text (top-centre of slider).

These are useful shortcuts in lieu of having to manually define font strings.

Conclusion Edit

After all that you can show your slider using:

 MySlider:Show()
Advertisement | Your ad here

Photos

Add a Photo
62,230photos on this wiki
See all photos >

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki