Create a custom Slider
Class SliderNode
#include <Geode/ui/SliderNode.hpp>Examples0
Public static methods2
staticgeode::SliderNode*createCustom(cocos2d::CCSprite*thumb,cocos2d::CCSprite*thumbSelected,geode::NineSlice*groove,,,cocos2d::CCSizeconst&barOffset)
thumb
thumbSelected
groove
bar
callback
barOffset
staticgeode::SliderNode*create(,boolalt)
Create a traditional Geometry Dash style Slider
callback
alt
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
floatgetMin()
floatgetMax()
boolisEnabled()
floatgetValue()
floatgetPercent()
floatgetSnapStep()
voidlinkTextInput(geode::TextInput*input,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()
geode::TextInput*getLinkedTextInput()
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()
cocos2d::CCLabelBMFont*getLinkedLabel()
voidsetReadOnly(boolreadOnly)
Set the slider as read only. This will hide the thumb and will disallow edits made in linked text inputs
boolisReadOnly()
voidsetSliderBypass(boolenabled)
Allow the slider min and max to be bypassed similar to the slider bypass hacks