CCControlPotentiometer Class Reference
| Inherits from | CCControl : CCLayer |
| Declared in | CCControlPotentiometer.h |
Overview
Potentiometer control for Cocos2D.
A CCControlPotentiometer object is a visual control used to select a single value in a circular motion from a continuous range of values. An indicator notes the current value of the potentiometer and can be moved by the user to change the setting.
Tasks
Creating Potentiometers
-
– initWithTrackSprite:progressSprite:thumbSprite:Initializes a potentiometer with a track sprite and a progress bar.
-
+ potentiometerWithTrackFile:progressFile:thumbFile:Creates potentiometer with a track filename and a progress filename.
Accessing the Potentiometer’s Value
-
valueContains the receiver’s current value.
property -
– setValue:animated:Sets the receiver’s current value, allowing you to animate the change visually.
Accessing the Potentiometer’s Value Limits
-
minimumValueContains the minimum value of the receiver. The default value of this property is 0.0.
property -
maximumValueContains the maximum value of the receiver. The default value of this property is 1.0.
property
Customizing the Appearance of the Slider
-
onThumbTintColorThe color used to tint the appearance of the thumb when the potentiometer is pushed.
property
Properties
onThumbTintColor
The color used to tint the appearance of the thumb when the potentiometer is pushed.
@property (nonatomic, assign) ccColor3B onThumbTintColorDiscussion
The default color is ccGRAY.
Declared In
CCControlPotentiometer.hvalue
Contains the receiver’s current value.
@property (nonatomic, assign) float valueDiscussion
Setting this property causes the receiver to redraw itself using the new value. To render an animated transition from the current value to the new value, you should use the setValue:animated: method instead.
If you try to set a value that is below the minimum or above the maximum value, the minimum or maximum value is set instead. The default value of this property is 0.0.
Declared In
CCControlPotentiometer.hClass Methods
potentiometerWithTrackFile:progressFile:thumbFile:
Creates potentiometer with a track filename and a progress filename.
+ (id)potentiometerWithTrackFile:(NSString *)backgroundFile progressFile:(NSString *)progressFile thumbFile:(NSString *)thumbFileDiscussion
Creates potentiometer with a track filename and a progress filename.
Declared In
CCControlPotentiometer.hInstance Methods
initWithTrackSprite:progressSprite:thumbSprite:
Initializes a potentiometer with a track sprite and a progress bar.
- (id)initWithTrackSprite:(CCSprite *)trackSprite progressSprite:(CCProgressTimer *)progressTimer thumbSprite:(CCSprite *)thumbSpriteParameters
- trackSprite
CCSprite, that is used as a background.
- progressTimer
CCProgressTimer, that is used as a progress bar.
- thumbSprite
CCSprite, that is used as a thumb.
Discussion
Initializes a potentiometer with a track sprite and a progress bar.
Declared In
CCControlPotentiometer.hsetValue:animated:
Sets the receiver’s current value, allowing you to animate the change visually.
- (void)setValue:(float)value animated:(BOOL)animatedParameters
Discussion
If you try to set a value that is below the minimum or above the maximum value, the minimum or maximum value is set instead. The default value of this property is 0.0.
See Also
Declared In
CCControlPotentiometer.h