Class SliderNode

#include <Geode/ui/SliderNode.hpp>
classSliderNode:publiccocos2d::CCNodeRGBA,publiccocos2d::CCTouchDelegate{ ... }
No description provided
Examples0
Public static methods2
staticgeode::SliderNode*createCustom(,
cocos2d::CCSprite*thumbSelected
,,,,)

Create a custom Slider

Parameters

thumb

The sprite for the thumb when not selected

thumbSelected

The sprite for the thumb when selected

groove

The NineSlice for the grove

bar

The sprite file name (cannot be a frame name) for the progress bar

callback

The callback for when the thumb is dragged

barOffset

The size offset (will be inset for each side) for the bar to fit within the groove
staticgeode::SliderNode*create(,
boolalt
)

Create a traditional Geometry Dash style Slider

Parameters

callback

The callback for when the thumb is dragged

alt

Use the alternative slider design (white border and bar)
Public member functions42
voidsetSlideCallback()

Set a callback for when the slider thumb is dragged

voidsetClickCallback()

Set a callback for when the slider thumb is clicked

voidsetReleaseCallback()

Set a callback for when the slider thumb is released

voidsetMin()

Set the minimum value the slider can go to

floatgetMin()
No description provided
voidsetMax()

Set the maximum value the slider can go to

floatgetMax()
No description provided
voidsetEnabled(
boolenabled
)

Set if the slider can be controlled by the thumb

boolisEnabled()
No description provided
voidsetValue(
floatvalue
)

Set the value of the slider

floatgetValue()
No description provided
voidsetPercent(
floatpercent
)

Set the percent relative to the min and max values

floatgetPercent()
No description provided
voidsetSnapStep(
floatsnapStep
)

Set the snap steps the slider will snap to when dragging

floatgetSnapStep()
No description provided
voidlinkTextInput(,
uintprecision
)

Link a text input. This will make the text input automatically update whenever the slider is dragged. Typing in the text input will also update the slider. Note that this will override any existing callback on the text input.

voidunlinkTextInput()

Unlink a linked text input

voidsetTextInputPrecision(
uintprecision
)

Sets the precision of the decimal shown in the linked text input. A value of 0 will make it int

uintgetTextInputPrecision()
No description provided
geode::TextInput*getLinkedTextInput()
No description provided
voidlinkLabel(,
uintprecision
)

Link a label. This will make the label automatically update whenever the slider is dragged.

voidunlinkLabel()

Unlink a linked label

voidsetLabelPrecision(
uintprecision
)

Sets the precision of the decimal shown in the linked label. A value of 0 will make it int

uintgetLabelPrecision()
No description provided
cocos2d::CCLabelBMFont*getLinkedLabel()
No description provided
voidsetReadOnly(
boolreadOnly
)

Set the slider as read only. This will hide the thumb and will disallow edits made in linked text inputs

boolisReadOnly()
No description provided
voidsetSliderBypass(
boolenabled
)

Allow the slider min and max to be bypassed similar to the slider bypass hacks

boolhasSliderBypass()
No description provided
cocos2d::CCNodeRGBA*getThumb()
No description provided
geode::NineSlice*getGroove()
No description provided
cocos2d::CCSprite*getBar()
No description provided
voidsetTouchPriority(
intpriority
)
No description provided
intgetTouchPriority()
No description provided
virtualvoidsetContentSize()
No description provided
virtualboolccTouchBegan(,)
No description provided
virtualvoidccTouchMoved(,)
No description provided
virtualvoidccTouchEnded(,)
No description provided
virtualvoidccTouchCancelled(,)
No description provided
virtualvoidonEnter()
No description provided
virtualvoidonExit()
No description provided
virtualvoidregisterWithTouchDispatcher()
No description provided
Fields0
Protected member functions7
boolinitCustom(,
cocos2d::CCSprite*thumbSelected
,,,,)
No description provided
boolinitStandard(,
boolalt
)
No description provided
voidupdateSize()
No description provided
voidupdateFromTouch()
No description provided
voidupdateLinkedTextInput()
No description provided
voidupdateLinkedLabel()
No description provided
floatapplySnap(
floatvalue
)
No description provided
Protected fields0
Derived classes0