/libs/cocos2d/CCEaseAction.h
C Header | 159 lines | 43 code | 20 blank | 96 comment | 0 complexity | df0134e4dc711cfd77ce9bdb121c6137 MD5 | raw file
Possible License(s): Apache-2.0
1/* 2 * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 * 4 * Copyright (c) 2008-2009 Jason Booth 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights 9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 * copies of the Software, and to permit persons to whom the Software is 11 * furnished to do so, subject to the following conditions: 12 * 13 * The above copyright notice and this permission notice shall be included in 14 * all copies or substantial portions of the Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 * THE SOFTWARE. 23 * 24 */ 25 26 27#import "CCIntervalAction.h" 28 29/** Base class for Easing actions 30 */ 31@interface CCEaseAction : CCIntervalAction <NSCopying> 32{ 33 CCIntervalAction * other; 34} 35/** creates the action */ 36+(id) actionWithAction: (CCIntervalAction*) action; 37/** initializes the action */ 38-(id) initWithAction: (CCIntervalAction*) action; 39@end 40 41/** Base class for Easing actions with rate parameters 42 */ 43@interface CCEaseRateAction : CCEaseAction <NSCopying> 44{ 45 float rate; 46} 47/** rate value for the actions */ 48@property (nonatomic,readwrite,assign) float rate; 49/** Creates the action with the inner action and the rate parameter */ 50+(id) actionWithAction: (CCIntervalAction*) action rate:(float)rate; 51/** Initializes the action with the inner action and the rate parameter */ 52-(id) initWithAction: (CCIntervalAction*) action rate:(float)rate; 53@end 54 55/** CCEaseIn action with a rate 56 */ 57@interface CCEaseIn : CCEaseRateAction <NSCopying> {} @end 58 59/** CCEaseOut action with a rate 60 */ 61@interface CCEaseOut : CCEaseRateAction <NSCopying> {} @end 62 63/** CCEaseInOut action with a rate 64 */ 65@interface CCEaseInOut : CCEaseRateAction <NSCopying> {} @end 66 67/** CCEase Exponential In 68 */ 69@interface CCEaseExponentialIn : CCEaseAction <NSCopying> {} @end 70/** Ease Exponential Out 71 */ 72@interface CCEaseExponentialOut : CCEaseAction <NSCopying> {} @end 73/** Ease Exponential InOut 74 */ 75@interface CCEaseExponentialInOut : CCEaseAction <NSCopying> {} @end 76/** Ease Sine In 77 */ 78@interface CCEaseSineIn : CCEaseAction <NSCopying> {} @end 79/** Ease Sine Out 80 */ 81@interface CCEaseSineOut : CCEaseAction <NSCopying> {} @end 82/** Ease Sine InOut 83 */ 84@interface CCEaseSineInOut : CCEaseAction <NSCopying> {} @end 85 86/** Ease Elastic abstract class 87 @since v0.8.2 88 */ 89@interface CCEaseElastic : CCEaseAction <NSCopying> 90{ 91 float period_; 92} 93 94/** period of the wave in radians. default is 0.3 */ 95@property (nonatomic,readwrite) float period; 96 97/** Creates the action with the inner action and the period in radians (default is 0.3) */ 98+(id) actionWithAction: (CCIntervalAction*) action period:(float)period; 99/** Initializes the action with the inner action and the period in radians (default is 0.3) */ 100-(id) initWithAction: (CCIntervalAction*) action period:(float)period; 101@end 102 103/** Ease Elastic In action. 104 @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. 105 @since v0.8.2 106 */ 107@interface CCEaseElasticIn : CCEaseElastic <NSCopying> {} @end 108/** Ease Elastic Out action. 109 @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. 110 @since v0.8.2 111 */ 112@interface CCEaseElasticOut : CCEaseElastic <NSCopying> {} @end 113/** Ease Elastic InOut action. 114 @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. 115 @since v0.8.2 116 */ 117@interface CCEaseElasticInOut : CCEaseElastic <NSCopying> {} @end 118 119/** CCEaseBounce abstract class. 120 @since v0.8.2 121*/ 122@interface CCEaseBounce : CCEaseAction <NSCopying> {} @end 123 124/** CCEaseBounceIn action. 125 @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. 126 @since v0.8.2 127*/ 128@interface CCEaseBounceIn : CCEaseBounce <NSCopying> {} @end 129 130/** EaseBounceOut action. 131 @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. 132 @since v0.8.2 133 */ 134@interface CCEaseBounceOut : CCEaseBounce <NSCopying> {} @end 135 136/** CCEaseBounceInOut action. 137 @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. 138 @since v0.8.2 139 */ 140@interface CCEaseBounceInOut : CCEaseBounce <NSCopying> {} @end 141 142/** CCEaseBackIn action. 143 @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. 144 @since v0.8.2 145 */ 146@interface CCEaseBackIn : CCEaseAction <NSCopying> {} @end 147 148/** CCEaseBackOut action. 149 @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. 150 @since v0.8.2 151 */ 152@interface CCEaseBackOut : CCEaseAction <NSCopying> {} @end 153 154/** CCEaseBackInOut action. 155 @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. 156 @since v0.8.2 157 */ 158@interface CCEaseBackInOut : CCEaseAction <NSCopying> {} @end 159