summary refs log tree commit diff stats
path: root/libs/cocos2d/CCTransition.h
diff options
context:
space:
mode:
authorStarla Insigna <starla4444@gmail.com>2011-07-30 11:19:14 -0400
committerStarla Insigna <starla4444@gmail.com>2011-07-30 11:19:14 -0400
commit9cd57b731ab1c666d4a1cb725538fdc137763d12 (patch)
tree5bac45ae5157a1cb10c6e45500cbf72789917980 /libs/cocos2d/CCTransition.h
downloadcartcollect-9cd57b731ab1c666d4a1cb725538fdc137763d12.tar.gz
cartcollect-9cd57b731ab1c666d4a1cb725538fdc137763d12.tar.bz2
cartcollect-9cd57b731ab1c666d4a1cb725538fdc137763d12.zip
Initial commit (version 0.2.1)
Diffstat (limited to 'libs/cocos2d/CCTransition.h')
-rwxr-xr-xlibs/cocos2d/CCTransition.h296
1 files changed, 296 insertions, 0 deletions
diff --git a/libs/cocos2d/CCTransition.h b/libs/cocos2d/CCTransition.h new file mode 100755 index 0000000..e37d3e8 --- /dev/null +++ b/libs/cocos2d/CCTransition.h
@@ -0,0 +1,296 @@
1/*
2 * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 *
4 * Copyright (c) 2008-2010 Ricardo Quesada
5 * Copyright (c) 2011 Zynga Inc.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE.
24 *
25 */
26
27
28#import "CCScene.h"
29@class CCActionInterval;
30@class CCNode;
31
32/** CCTransitionEaseScene can ease the actions of the scene protocol.
33 @since v0.8.2
34 */
35@protocol CCTransitionEaseScene <NSObject>
36/** returns the Ease action that will be performed on a linear action.
37 @since v0.8.2
38 */
39-(CCActionInterval*) easeActionWithAction:(CCActionInterval*)action;
40@end
41
42/** Orientation Type used by some transitions
43 */
44typedef enum {
45 /// An horizontal orientation where the Left is nearer
46 kOrientationLeftOver = 0,
47 /// An horizontal orientation where the Right is nearer
48 kOrientationRightOver = 1,
49 /// A vertical orientation where the Up is nearer
50 kOrientationUpOver = 0,
51 /// A vertical orientation where the Bottom is nearer
52 kOrientationDownOver = 1,
53} tOrientation;
54
55/** Base class for CCTransition scenes
56 */
57@interface CCTransitionScene : CCScene
58{
59 CCScene *inScene_;
60 CCScene *outScene_;
61 ccTime duration_;
62 BOOL inSceneOnTop_;
63 BOOL sendCleanupToScene_;
64}
65/** creates a base transition with duration and incoming scene */
66+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s;
67/** initializes a transition with duration and incoming scene */
68-(id) initWithDuration:(ccTime) t scene:(CCScene*)s;
69/** called after the transition finishes */
70-(void) finish;
71/** used by some transitions to hide the outter scene */
72-(void) hideOutShowIn;
73@end
74
75/** A CCTransition that supports orientation like.
76 * Possible orientation: LeftOver, RightOver, UpOver, DownOver
77 */
78@interface CCTransitionSceneOriented : CCTransitionScene
79{
80 tOrientation orientation;
81}
82/** creates a base transition with duration and incoming scene */
83+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s orientation:(tOrientation)o;
84/** initializes a transition with duration and incoming scene */
85-(id) initWithDuration:(ccTime) t scene:(CCScene*)s orientation:(tOrientation)o;
86@end
87
88
89/** CCTransitionRotoZoom:
90 Rotate and zoom out the outgoing scene, and then rotate and zoom in the incoming
91 */
92@interface CCTransitionRotoZoom : CCTransitionScene
93{}
94@end
95
96/** CCTransitionJumpZoom:
97 Zoom out and jump the outgoing scene, and then jump and zoom in the incoming
98*/
99@interface CCTransitionJumpZoom : CCTransitionScene
100{}
101@end
102
103/** CCTransitionMoveInL:
104 Move in from to the left the incoming scene.
105*/
106@interface CCTransitionMoveInL : CCTransitionScene <CCTransitionEaseScene>
107{}
108/** initializes the scenes */
109-(void) initScenes;
110/** returns the action that will be performed */
111-(CCActionInterval*) action;
112@end
113
114/** CCTransitionMoveInR:
115 Move in from to the right the incoming scene.
116 */
117@interface CCTransitionMoveInR : CCTransitionMoveInL
118{}
119@end
120
121/** CCTransitionMoveInT:
122 Move in from to the top the incoming scene.
123 */
124@interface CCTransitionMoveInT : CCTransitionMoveInL
125{}
126@end
127
128/** CCTransitionMoveInB:
129 Move in from to the bottom the incoming scene.
130 */
131@interface CCTransitionMoveInB : CCTransitionMoveInL
132{}
133@end
134
135/** CCTransitionSlideInL:
136 Slide in the incoming scene from the left border.
137 */
138@interface CCTransitionSlideInL : CCTransitionScene <CCTransitionEaseScene>
139{}
140/** initializes the scenes */
141-(void) initScenes;
142/** returns the action that will be performed by the incomming and outgoing scene */
143-(CCActionInterval*) action;
144@end
145
146/** CCTransitionSlideInR:
147 Slide in the incoming scene from the right border.
148 */
149@interface CCTransitionSlideInR : CCTransitionSlideInL
150{}
151@end
152
153/** CCTransitionSlideInB:
154 Slide in the incoming scene from the bottom border.
155 */
156@interface CCTransitionSlideInB : CCTransitionSlideInL
157{}
158@end
159
160/** CCTransitionSlideInT:
161 Slide in the incoming scene from the top border.
162 */
163@interface CCTransitionSlideInT : CCTransitionSlideInL
164{}
165@end
166
167/**
168 Shrink the outgoing scene while grow the incoming scene
169 */
170@interface CCTransitionShrinkGrow : CCTransitionScene <CCTransitionEaseScene>
171{}
172@end
173
174/** CCTransitionFlipX:
175 Flips the screen horizontally.
176 The front face is the outgoing scene and the back face is the incoming scene.
177 */
178@interface CCTransitionFlipX : CCTransitionSceneOriented
179{}
180@end
181
182/** CCTransitionFlipY:
183 Flips the screen vertically.
184 The front face is the outgoing scene and the back face is the incoming scene.
185 */
186@interface CCTransitionFlipY : CCTransitionSceneOriented
187{}
188@end
189
190/** CCTransitionFlipAngular:
191 Flips the screen half horizontally and half vertically.
192 The front face is the outgoing scene and the back face is the incoming scene.
193 */
194@interface CCTransitionFlipAngular : CCTransitionSceneOriented
195{}
196@end
197
198/** CCTransitionZoomFlipX:
199 Flips the screen horizontally doing a zoom out/in
200 The front face is the outgoing scene and the back face is the incoming scene.
201 */
202@interface CCTransitionZoomFlipX : CCTransitionSceneOriented
203{}
204@end
205
206/** CCTransitionZoomFlipY:
207 Flips the screen vertically doing a little zooming out/in
208 The front face is the outgoing scene and the back face is the incoming scene.
209 */
210@interface CCTransitionZoomFlipY : CCTransitionSceneOriented
211{}
212@end
213
214/** CCTransitionZoomFlipAngular:
215 Flips the screen half horizontally and half vertically doing a little zooming out/in.
216 The front face is the outgoing scene and the back face is the incoming scene.
217 */
218@interface CCTransitionZoomFlipAngular : CCTransitionSceneOriented
219{}
220@end
221
222/** CCTransitionFade:
223 Fade out the outgoing scene and then fade in the incoming scene.'''
224 */
225@interface CCTransitionFade : CCTransitionScene
226{
227 ccColor4B color;
228}
229/** creates the transition with a duration and with an RGB color
230 * Example: [FadeTransition transitionWithDuration:2 scene:s withColor:ccc3(255,0,0)]; // red color
231 */
232+(id) transitionWithDuration:(ccTime)duration scene:(CCScene*)scene withColor:(ccColor3B)color;
233/** initializes the transition with a duration and with an RGB color */
234-(id) initWithDuration:(ccTime)duration scene:(CCScene*)scene withColor:(ccColor3B)color;
235@end
236
237
238/**
239 CCTransitionCrossFade:
240 Cross fades two scenes using the CCRenderTexture object.
241 */
242@class CCRenderTexture;
243@interface CCTransitionCrossFade : CCTransitionScene
244{}
245@end
246
247/** CCTransitionTurnOffTiles:
248 Turn off the tiles of the outgoing scene in random order
249 */
250@interface CCTransitionTurnOffTiles : CCTransitionScene <CCTransitionEaseScene>
251{}
252@end
253
254/** CCTransitionSplitCols:
255 The odd columns goes upwards while the even columns goes downwards.
256 */
257@interface CCTransitionSplitCols : CCTransitionScene <CCTransitionEaseScene>
258{}
259-(CCActionInterval*) action;
260@end
261
262/** CCTransitionSplitRows:
263 The odd rows goes to the left while the even rows goes to the right.
264 */
265@interface CCTransitionSplitRows : CCTransitionSplitCols
266{}
267@end
268
269/** CCTransitionFadeTR:
270 Fade the tiles of the outgoing scene from the left-bottom corner the to top-right corner.
271 */
272@interface CCTransitionFadeTR : CCTransitionScene <CCTransitionEaseScene>
273{}
274-(CCActionInterval*) actionWithSize:(ccGridSize) vector;
275@end
276
277/** CCTransitionFadeBL:
278 Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner.
279 */
280@interface CCTransitionFadeBL : CCTransitionFadeTR
281{}
282@end
283
284/** CCTransitionFadeUp:
285 * Fade the tiles of the outgoing scene from the bottom to the top.
286 */
287@interface CCTransitionFadeUp : CCTransitionFadeTR
288{}
289@end
290
291/** CCTransitionFadeDown:
292 * Fade the tiles of the outgoing scene from the top to the bottom.
293 */
294@interface CCTransitionFadeDown : CCTransitionFadeTR
295{}
296@end