Inherits from CCLayer : CCNode : NSObject
Declared in CCSlider.h

Overview

@class CCSlider Slider control for Cocos2D. Designed with SFX/Music level options in mind.

Tasks

Properties

value

Current chosen value, min is 0.0f, max is 1.0f.

@property (nonatomic, assign) float value

Declared In

CCSlider.h

Class Methods

sliderWithBackgroundFile:thumbFile:

Creates slider with backround image filename & thumb image filename.

+ (id)sliderWithBackgroundFile:(NSString *)bgFile thumbFile:(NSString *)thumbFile

Declared In

CCSlider.h

sliderWithBackgroundSprite:thumbMenuItem:

Creates slider with given bg sprite and menu item as a thumb.

+ (id)sliderWithBackgroundSprite:(CCSprite *)bgSprite thumbMenuItem:(CCMenuItem *)aThumb

See Also

Declared In

CCSlider.h

Instance Methods

initWithBackgroundFile:thumbFile:

Easy init – filenames instead of CCSprite & CCMenuItem. Uses designated init inside.

- (id)initWithBackgroundFile:(NSString *)bgFile thumbFile:(NSString *)thumbFile

Parameters

bgFile

Filename for background CCSprite.

thumbFile

Filename, that is used to create normal & selected images for thumbMenuItem. Selected sprite is darker than normal sprite.

Declared In

CCSlider.h

initWithBackgroundSprite:thumbMenuItem:

Designated init.

- (id)initWithBackgroundSprite:(CCSprite *)bgSprite thumbMenuItem:(CCMenuItem *)aThumb

Parameters

bgSprite

CCSprite, that is used as a background. It’s bounding box is used to determine max & min x position for a thumb menu item.

aThumb

MenuItem that is used as a thumb. Used without CCMenu, so CCMenuItem#activate doesn’t get called.

Declared In

CCSlider.h