Slider

The slider is similar to the progress bar, but the slider has a “button” button that allows the player to drag it to change the value of the progress bar.

Create slider

There are two ways to create a slider component.

Edit-mode properties

In the component editing state, the properties panel of the slider component is:

Instructions

Instance properties

Select a slider component on the stage, and the property panel list on the right appears:

GSlider

GSlider slider = gcom.GetChild("n1").asSlider;
slider.value = 50;

There are notification events when the slider progress changes:

//Unity/Cry
slider.onChanged.Add(onChanged);
//AS3
slider.addEventListener(StateChangeEvent.CHANGED, onChanged);
//Egret
slider.addEventListener(StateChangeEvent.CHANGED, this.onChanged, this);
//Laya
slider.on(fairygui.Events.STATE_CHANGED, this, this.onChanged);
//Cocos2dx
slider->addEventListener(UIEventType::Changed, CC_CALLBACK_1(AClass::onChanged, this));
//CocosCreator
slider.on(fgui.Event.STATUS_CHANGED, this.onChanged, this);