CCControlStepper Class Reference
| Inherits from | CCControl : CCLayer |
| Declared in | CCControlStepper.h |
Overview
CCControlStepper is a stepper control which provides a user interface for incrementing or decrementing a value.
A stepper displays two buttons, one with a minus (“–”) symbol and one with a plus (“+”) symbol.
If you set stepper behavior to “autorepeat” (which is the default), pressing and holding one of its buttons increments or decrements the stepper’s value repeatedly. The rate of change depends on how long the user continues pressing the control.
Tasks
Creating Steppers
-
– initWithMinusSprite:plusSprite:Initializes a stepper with the given minus and plus sprites.
-
+ stepperWithMinusSprite:plusSprite:Creates a stepper with the given minus and plus sprites.
-
+ stepperWithMinusFile:plusFile:Creates a stepper with the given minus and plus filenames.
Accessing the Stepper’s Value
-
valueThe numeric value of the stepper.
property
Configuring the Stepper
-
continuousThe continuous vs. noncontinuous state of the stepper.
property -
autorepeatThe automatic vs. nonautomatic repeat state of the stepper.
property -
wrapsThe wrap vs. no-wrap state of the stepper.
property -
minimumValueThe lowest possible numeric value for the stepper.
property -
maximumValueThe highest possible numeric value for the stepper.
property -
stepValueThe step, or increment, value for the stepper.
property
Customizing the Appearance of the Stepper
-
pushedTintColorThe color used to tint the appearance of the minus or plus element when it is pushed.
property
Properties
autorepeat
The automatic vs. nonautomatic repeat state of the stepper.
@property (nonatomic) BOOL autorepeatDiscussion
If YES, the user pressing and holding on the stepper repeatedly alters value.
The default value for this property is YES.
Declared In
CCControlStepper.hcontinuous
The continuous vs. noncontinuous state of the stepper.
@property (nonatomic, getter=isContinuous) BOOL continuousDiscussion
If YES, value change events are sent immediately when the value changes during user interaction. If NO, a value change event is sent when user interaction ends.
The default value for this property is YES.
Declared In
CCControlStepper.hmaximumValue
The highest possible numeric value for the stepper.
@property (nonatomic) double maximumValueDiscussion
Must be numerically greater than minimumValue. If you attempt to set a value equal to or lower than minimumValue, the system raises an NSInvalidArgumentException exception.
The default value of this property is 100.
Declared In
CCControlStepper.hminimumValue
The lowest possible numeric value for the stepper.
@property (nonatomic) double minimumValueDiscussion
Must be numerically less than maximumValue. If you attempt to set a value equal to or greater than maximumValue, the system raises an NSInvalidArgumentException exception.
The default value for this property is 0.
Declared In
CCControlStepper.hpushedTintColor
The color used to tint the appearance of the minus or plus element when it is pushed.
@property (nonatomic, assign) ccColor3B pushedTintColorDiscussion
The default color is ccGRAY.
Declared In
CCControlStepper.hstepValue
The step, or increment, value for the stepper.
@property (nonatomic) double stepValueDiscussion
Must be numerically greater than 0. If you attempt to set this property’s value to 0 or to a negative number, the system raises an NSInvalidArgumentException exception.
The default value for this property is 1.
Declared In
CCControlStepper.hvalue
The numeric value of the stepper.
@property (nonatomic) double valueDiscussion
When the value changes, the stepper sends the CCControlEventValueChanged flag to its target (see addTarget:action:forControlEvents:). Refer to the description of the continuous property for information about whether value change events are sent continuously or when user interaction ends.
The default value for this property is 0. This property is clamped at its lower extreme to minimumValue and is clamped at its upper extreme to maximumValue.
Declared In
CCControlStepper.hwraps
The wrap vs. no-wrap state of the stepper.
@property (nonatomic) BOOL wrapsDiscussion
If YES, incrementing beyond maximumValue sets value to minimumValue; likewise, decrementing below minimumValue sets value to maximumValue. If NO, the stepper does not increment beyond maximumValue nor does it decrement below minimumValue but rather holds at those values.
The default value for this property is NO.
Declared In
CCControlStepper.hClass Methods
stepperWithMinusFile:plusFile:
Creates a stepper with the given minus and plus filenames.
+ (id)stepperWithMinusFile:(NSString *)minusFile plusFile:(NSString *)plusFileDiscussion
Creates a stepper with the given minus and plus filenames.
See Also
Declared In
CCControlStepper.hInstance Methods
initWithMinusSprite:plusSprite:
Initializes a stepper with the given minus and plus sprites.
- (id)initWithMinusSprite:(CCSprite *)minusSprite plusSprite:(CCSprite *)plusSpriteParameters
- minusSprite
CCSprite, that is used for the minus component.
- plusSprite
CCSprite, that is used for the plus component.
Discussion
Initializes a stepper with the given minus and plus sprites.
Declared In
CCControlStepper.h