/libs/cocos2d/CCGridAction.h
C Header | 169 lines | 66 code | 37 blank | 66 comment | 0 complexity | 9894aa3fd6ad0f45b4843f47cb084124 MD5 | raw file
Possible License(s): Apache-2.0
1/* 2 * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 * 4 * Copyright (c) 2009 On-Core 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 <UIKit/UIKit.h> 28 29#import "CCIntervalAction.h" 30#import "CCInstantAction.h" 31#import "CCGrid.h" 32 33@class CCGridBase; 34 35/** Base class for Grid actions */ 36@interface CCGridAction : CCIntervalAction 37{ 38 ccGridSize gridSize; 39} 40 41/** size of the grid */ 42@property (nonatomic,readwrite) ccGridSize gridSize; 43 44/** creates the action with size and duration */ 45+(id) actionWithSize:(ccGridSize)size duration:(ccTime)d; 46/** initializes the action with size and duration */ 47-(id) initWithSize:(ccGridSize)gridSize duration:(ccTime)d; 48/** returns the grid */ 49-(CCGridBase *)grid; 50 51@end 52 53//////////////////////////////////////////////////////////// 54 55/** Base class for CCGrid3D actions. 56 Grid3D actions can modify a non-tiled grid. 57 */ 58@interface CCGrid3DAction : CCGridAction 59{ 60 61} 62 63/** returns the vertex than belongs to certain position in the grid */ 64-(ccVertex3F)vertex:(ccGridSize)pos; 65/** returns the non-transformed vertex than belongs to certain position in the grid */ 66-(ccVertex3F)originalVertex:(ccGridSize)pos; 67/** sets a new vertex to a certain position of the grid */ 68-(void)setVertex:(ccGridSize)pos vertex:(ccVertex3F)vertex; 69 70@end 71 72//////////////////////////////////////////////////////////// 73 74/** Base class for CCTiledGrid3D actions */ 75@interface CCTiledGrid3DAction : CCGridAction 76{ 77 78} 79 80/** returns the tile that belongs to a certain position of the grid */ 81-(ccQuad3)tile:(ccGridSize)pos; 82/** returns the non-transformed tile that belongs to a certain position of the grid */ 83-(ccQuad3)originalTile:(ccGridSize)pos; 84/** sets a new tile to a certain position of the grid */ 85-(void)setTile:(ccGridSize)pos coords:(ccQuad3)coords; 86 87@end 88 89//////////////////////////////////////////////////////////// 90 91/** CCAccelDeccelAmplitude action */ 92@interface CCAccelDeccelAmplitude : CCIntervalAction 93{ 94 float rate; 95 CCIntervalAction *other; 96} 97 98/** amplitude rate */ 99@property (nonatomic,readwrite) float rate; 100 101/** creates the action with an inner action that has the amplitude property, and a duration time */ 102+(id)actionWithAction:(CCAction*)action duration:(ccTime)d; 103/** initializes the action with an inner action that has the amplitude property, and a duration time */ 104-(id)initWithAction:(CCAction*)action duration:(ccTime)d; 105 106@end 107 108//////////////////////////////////////////////////////////// 109 110/** CCAccelAmplitude action */ 111@interface CCAccelAmplitude : CCIntervalAction 112{ 113 float rate; 114 CCIntervalAction *other; 115} 116 117/** amplitude rate */ 118@property (nonatomic,readwrite) float rate; 119 120/** creates the action with an inner action that has the amplitude property, and a duration time */ 121+(id)actionWithAction:(CCAction*)action duration:(ccTime)d; 122/** initializes the action with an inner action that has the amplitude property, and a duration time */ 123-(id)initWithAction:(CCAction*)action duration:(ccTime)d; 124 125@end 126 127//////////////////////////////////////////////////////////// 128 129/** CCDeccelAmplitude action */ 130@interface CCDeccelAmplitude : CCIntervalAction 131{ 132 float rate; 133 CCIntervalAction *other; 134} 135 136/** amplitude rate */ 137@property (nonatomic,readwrite) float rate; 138 139/** creates the action with an inner action that has the amplitude property, and a duration time */ 140+(id)actionWithAction:(CCAction*)action duration:(ccTime)d; 141/** initializes the action with an inner action that has the amplitude property, and a duration time */ 142-(id)initWithAction:(CCAction*)action duration:(ccTime)d; 143 144@end 145 146//////////////////////////////////////////////////////////// 147 148/** CCStopGrid action. 149 Don't call this action if another grid action is active. 150 Call if you want to remove the the grid effect. Example: 151 [Sequence actions:[Lens ...], [StopGrid action], nil]; 152 */ 153@interface CCStopGrid : CCInstantAction 154{ 155} 156@end 157 158//////////////////////////////////////////////////////////// 159 160/** CCReuseGrid action */ 161@interface CCReuseGrid : CCInstantAction 162{ 163 int t; 164} 165/** creates an action with the number of times that the current grid will be reused */ 166+(id) actionWithTimes: (int) times; 167/** initializes an action with the number of times that the current grid will be reused */ 168-(id) initWithTimes: (int) times; 169@end