Creates a switch with a mask sprite, on/off sprites for on/off states and a thumb sprite.
Class CCControlSwitch
#include <Geode/cocos/extensions/GUI/CCControlExtension/CCControlSwitch.h>classCCControlSwitch:publiccocos2d::extension::CCControl{ ... }
No description provided
Examples0
Public static methods2
staticcocos2d::extension::CCControlSwitch*create(cocos2d::CCSprite*maskSprite,cocos2d::CCSprite*onSprite,cocos2d::CCSprite*offSprite,cocos2d::CCSprite*thumbSprite)
staticcocos2d::extension::CCControlSwitch*create(cocos2d::CCSprite*maskSprite,cocos2d::CCSprite*onSprite,cocos2d::CCSprite*offSprite,cocos2d::CCSprite*thumbSprite,cocos2d::CCLabelTTF*onLabel,cocos2d::CCLabelTTF*offLabel)
Creates a switch with a mask sprite, on/off sprites for on/off states, a thumb sprite and an on/off labels.
Public member functions12
boolinitWithMaskSprite(cocos2d::CCSprite*maskSprite,cocos2d::CCSprite*onSprite,cocos2d::CCSprite*offSprite,cocos2d::CCSprite*thumbSprite)
Initializes a switch with a mask sprite, on/off sprites for on/off states and a thumb sprite.
boolinitWithMaskSprite(cocos2d::CCSprite*maskSprite,cocos2d::CCSprite*onSprite,cocos2d::CCSprite*offSprite,cocos2d::CCSprite*thumbSprite,cocos2d::CCLabelTTF*onLabel,cocos2d::CCLabelTTF*offLabel)
Initializes a switch with a mask sprite, on/off sprites for on/off states, a thumb sprite and an on/off labels.
voidsetOn(boolisOn,boolanimated)
Set the state of the switch to On or Off, optionally animating the transition.
isOn
YES if the switch should be turned to the On position; NO if it should be turned to the Off position. If the switch is already in the designated position, nothing happens.
animated
YES to animate the "flipping" of the switch; otherwise NO.
boolisOn()
No description provided
boolhasMoved()
No description provided
cocos2d::CCPointlocationFromTouch(cocos2d::CCTouch*touch)
No description provided
virtualboolccTouchBegan(cocos2d::CCTouch*pTouch,cocos2d::CCEvent*pEvent)
No description provided
virtualvoidccTouchMoved(cocos2d::CCTouch*pTouch,cocos2d::CCEvent*pEvent)
No description provided
virtualvoidccTouchEnded(cocos2d::CCTouch*pTouch,cocos2d::CCEvent*pEvent)
No description provided
virtualvoidccTouchCancelled(cocos2d::CCTouch*pTouch,cocos2d::CCEvent*pEvent)
No description provided
Fields4
cocos2d::extension::CCControlSwitchSprite*m_pSwitchSprite;
Sprite which represents the view.
floatm_fInitialTouchXPosition;
No description provided
boolm_bMoved;
No description provided
boolm_bOn;
A Boolean value that determines the off/on state of the switch.