CCSlider Class Reference
| Inherits from | CCControl : CCNode : CCResponder : NSObject |
| Declared in | CCSlider.h |
Overview
A CCSlider object is a visual control used to select a single value from a continuous range of values. An indicator, or an handle, notes the current value of the slider and can be moved by the user to change the setting.
Properties
background
The background’s sprite 9 slice.
@property (nonatomic, readonly) CCSprite9Slice *backgroundDeclared In
CCSlider.hsliderValue
Contains the receiver’s current value. Setting this property causes the receiver to redraw itself using the new value. If you try to set a value that is below 0.0f or above 1.0f, the minimum or maximum value is set instead. The default value of this property is 0.0.
@property (nonatomic, assign) float sliderValueDeclared In
CCSlider.hInstance Methods
backgroundSpriteFrameForState:
Gets the background’s sprite frame for the specified state.
- (CCSpriteFrame *)backgroundSpriteFrameForState:(CCControlState)stateParameters
- state
State to get the sprite frame for.
Return Value
Background sprite frame.
Declared In
CCSlider.hhandleSpriteFrameForState:
Gets the handle’s sprite frame for the specified state.
- (CCSpriteFrame *)handleSpriteFrameForState:(CCControlState)stateParameters
- state
State to get the sprite frame for.
Return Value
Handle sprite frame.
Declared In
CCSlider.hinitWithBackground:andHandleImage:
Initializes a new slider with a specified sprite frames for its background and handle.
- (id)initWithBackground:(CCSpriteFrame *)background andHandleImage:(CCSpriteFrame *)handleParameters
- background
Stretchable background image which represents the track bar for the normal state.
- handle
Handle image for the normal state.
Declared In
CCSlider.hsetBackgroundSpriteFrame:forState:
Sets the background’s sprite frame for the specified state. The sprite frame will be stretched to the preferred size of the label. If set to NULL no background will be drawn.
- (void)setBackgroundSpriteFrame:(CCSpriteFrame *)spriteFrame forState:(CCControlState)stateParameters
- spriteFrame
Sprite frame to use for drawing the background.
- state
State to set the background for.
Declared In
CCSlider.hsetHandleSpriteFrame:forState:
Sets the handle’s sprite frame for the specified state. If set to NULL no handle will be drawn.
- (void)setHandleSpriteFrame:(CCSpriteFrame *)spriteFrame forState:(CCControlState)stateParameters
- spriteFrame
Sprite frame to use for drawing the handle.
- state
State to set the handle for.
Declared In
CCSlider.h