class flixel.addons.ui.FlxSlider extends FlxSpriteGroup
Available on all platforms
Sub classes | ||||
![]() | FlxUISlider |
|
A slider GUI element for float and integer manipulation. * @author Gama11
Instance Fields
var hoverAlpha:Float
The alpha value the slider uses when it's hovered over. 1 to turn the effect off.
var setVariable:Bool
Whether the slider sets the variable it tracks. Can be useful to deactivate this in conjunction with callbacks.
function new(Object:Dynamic, VarString:String, ?X:Float = 0, ?Y:Float = 0, ?MinValue:Float = 0, ?MaxValue:Float = 10, ?Width:Int = 100, ?Height:Int = 15, ?Thickness:Int = 3, ?Color:Int = -16777216, ?HandleColor:Int = -8224126):Void
Creates a new FlxSlider. * *
Object | Reference to the parent object of the variable * |
VarString | Variable that the slider controls * |
X | x Position * |
Y | y Position * |
MinValue | Mininum value the variable can be changed to * |
MaxValue | Maximum value the variable can be changed to * |
Width | Width of the slider * |
Height | Height of the slider * |
Thickness | Thickness of the slider * |
Color | Color of the slider background and all texts except for valueText showing the current value * |
HandleColor | Color of the slider handle and the valueText showing the current value |
function callback(:Float):Void
A function to be called when the slider was used. * The current relativePos is passed as an argument.
function setTexts(Name:String, ?Value:Bool = true, ?Min:String = null, ?Max:String = null, ?Size:Int = 8):Void
Handy function for changing the textfields. * *
Name | Text of nameLabel - null to hide * |
Value | Whether to show the valueText or not * |
Min | Text of minLabel - null to hide * |
Max | Text of maxLabel - null to hide * |
Size | Size to use for the texts |