joybox 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +18 -0
  3. data/Gemfile +6 -0
  4. data/Gemfile.lock +27 -0
  5. data/LICENSE +22 -0
  6. data/README.md +86 -0
  7. data/Rakefile +14 -0
  8. data/app/app_delegate.rb +49 -0
  9. data/app/layers/box2d_layer.rb +109 -0
  10. data/app/layers/cocos2d_layer.rb +14 -0
  11. data/app/layers/cocos_motion_layer.rb +145 -0
  12. data/app/layers/menu_layer.rb +59 -0
  13. data/joybox.gemspec +25 -0
  14. data/lib/joybox.rb +47 -0
  15. data/lib/joybox/box2d/body.rb +106 -0
  16. data/lib/joybox/box2d/world.rb +79 -0
  17. data/lib/joybox/cocos2d/actions/actions.rb +7 -0
  18. data/lib/joybox/cocos2d/actions/move.rb +31 -0
  19. data/lib/joybox/cocos2d/actions/repeat.rb +24 -0
  20. data/lib/joybox/cocos2d/actions/rotate.rb +31 -0
  21. data/lib/joybox/cocos2d/actions/scale.rb +31 -0
  22. data/lib/joybox/cocos2d/actions/sequence.rb +22 -0
  23. data/lib/joybox/cocos2d/actions/skew.rb +36 -0
  24. data/lib/joybox/cocos2d/cocos2d.rb +15 -0
  25. data/lib/joybox/cocos2d/common/cg_point.rb +37 -0
  26. data/lib/joybox/cocos2d/common/color.rb +49 -0
  27. data/lib/joybox/cocos2d/common/gc_size.rb +39 -0
  28. data/lib/joybox/cocos2d/common/ns_set.rb +5 -0
  29. data/lib/joybox/cocos2d/common/numeric.rb +14 -0
  30. data/lib/joybox/cocos2d/common/screen.rb +39 -0
  31. data/lib/joybox/cocos2d/common/ui_touch.rb +15 -0
  32. data/lib/joybox/cocos2d/configuration/configuration.rb +68 -0
  33. data/lib/joybox/cocos2d/configuration/file_utils.rb +33 -0
  34. data/lib/joybox/cocos2d/configuration/gl_view.rb +44 -0
  35. data/lib/joybox/cocos2d/configuration/texture_2d.rb +27 -0
  36. data/lib/joybox/cocos2d/core/layer.rb +87 -0
  37. data/lib/joybox/cocos2d/core/node.rb +26 -0
  38. data/lib/joybox/cocos2d/core/physics_sprite.rb +52 -0
  39. data/lib/joybox/cocos2d/core/scene.rb +24 -0
  40. data/lib/joybox/cocos2d/core/sprite.rb +43 -0
  41. data/lib/joybox/cocos2d/core/sprite_batch.rb +24 -0
  42. data/lib/joybox/cocos2d/director.rb +43 -0
  43. data/lib/joybox/cocos2d/macros.rb +234 -0
  44. data/lib/joybox/cocos2d/ui/label.rb +34 -0
  45. data/lib/joybox/cocos2d/ui/menu.rb +25 -0
  46. data/lib/joybox/cocos2d/ui/menu_image.rb +22 -0
  47. data/lib/joybox/cocos2d/ui/menu_label.rb +45 -0
  48. data/lib/joybox/cocos2d/ui/ui.rb +7 -0
  49. data/lib/joybox/version.rb +3 -0
  50. data/resources/box2d/blocks_sprite_sheet.png +0 -0
  51. data/resources/cocos_motion/dot.png +0 -0
  52. data/resources/cocos_motion/dot_selected.png +0 -0
  53. data/resources/cocos_motion/grossini.png +0 -0
  54. data/resources/cocos_motion/grossinis_sister.png +0 -0
  55. data/resources/cocos_motion/grossinis_sister_two.png +0 -0
  56. data/resources/cocos_motion/left_arrow.png +0 -0
  57. data/resources/cocos_motion/left_arrow_selected.png +0 -0
  58. data/resources/cocos_motion/right_arrow.png +0 -0
  59. data/resources/cocos_motion/right_arrow_selected.png +0 -0
  60. data/resources/fps_images-hd.png +0 -0
  61. data/resources/fps_images-ipadhd.png +0 -0
  62. data/resources/fps_images.png +0 -0
  63. data/spec/lib/joybox/cocos2d/cocos2d_spec.rb +7 -0
  64. data/spec/lib/joybox/cocos2d/macros_spec.rb +37 -0
  65. data/spec/main_spec.rb +9 -0
  66. data/vendor/Box2D.framework/Box2D +0 -0
  67. data/vendor/Box2D.framework/Box2D.framework.bridgesupport +166 -0
  68. data/vendor/Box2D.framework/Versions/A/Box2D +0 -0
  69. data/vendor/Box2D.framework/Versions/A/Headers/Collision/B2DContactListener.h +25 -0
  70. data/vendor/Box2D.framework/Versions/A/Headers/Collision/Shapes/B2DEdgeShape.h +17 -0
  71. data/vendor/Box2D.framework/Versions/A/Headers/Collision/Shapes/B2DPolygonShape.h +16 -0
  72. data/vendor/Box2D.framework/Versions/A/Headers/Collision/Shapes/B2DShape.h +15 -0
  73. data/vendor/Box2D.framework/Versions/A/Headers/Dynamics/B2DBody.h +43 -0
  74. data/vendor/Box2D.framework/Versions/A/Headers/Dynamics/B2DWorld.h +41 -0
  75. data/vendor/Box2D.framework/Versions/A/Resources/Box2DConfig.cmake +3 -0
  76. data/vendor/Box2D.framework/Versions/A/Resources/CMakeLists.txt +205 -0
  77. data/vendor/Cocos2D/Cocos2D.bridgesupport +7808 -0
  78. data/vendor/Cocos2D/include/CCAction.h +195 -0
  79. data/vendor/Cocos2D/include/CCActionCamera.h +73 -0
  80. data/vendor/Cocos2D/include/CCActionCatmullRom.h +139 -0
  81. data/vendor/Cocos2D/include/CCActionEase.h +159 -0
  82. data/vendor/Cocos2D/include/CCActionGrid.h +165 -0
  83. data/vendor/Cocos2D/include/CCActionGrid3D.h +205 -0
  84. data/vendor/Cocos2D/include/CCActionInstant.h +227 -0
  85. data/vendor/Cocos2D/include/CCActionInterval.h +431 -0
  86. data/vendor/Cocos2D/include/CCActionManager.h +113 -0
  87. data/vendor/Cocos2D/include/CCActionPageTurn3D.h +42 -0
  88. data/vendor/Cocos2D/include/CCActionProgressTimer.h +59 -0
  89. data/vendor/Cocos2D/include/CCActionTiledGrid.h +211 -0
  90. data/vendor/Cocos2D/include/CCActionTween.h +62 -0
  91. data/vendor/Cocos2D/include/CCAnimation.h +150 -0
  92. data/vendor/Cocos2D/include/CCAnimationCache.h +74 -0
  93. data/vendor/Cocos2D/include/CCArray.h +119 -0
  94. data/vendor/Cocos2D/include/CCAtlasNode.h +96 -0
  95. data/vendor/Cocos2D/include/CCCamera.h +98 -0
  96. data/vendor/Cocos2D/include/CCConfiguration.h +126 -0
  97. data/vendor/Cocos2D/include/CCDirector.h +344 -0
  98. data/vendor/Cocos2D/include/CCDirectorIOS.h +104 -0
  99. data/vendor/Cocos2D/include/CCDrawingPrimitives.h +139 -0
  100. data/vendor/Cocos2D/include/CCES2Renderer.h +83 -0
  101. data/vendor/Cocos2D/include/CCESRenderer.h +54 -0
  102. data/vendor/Cocos2D/include/CCFileUtils.h +188 -0
  103. data/vendor/Cocos2D/include/CCGL.h +72 -0
  104. data/vendor/Cocos2D/include/CCGLProgram.h +150 -0
  105. data/vendor/Cocos2D/include/CCGLView.h +160 -0
  106. data/vendor/Cocos2D/include/CCGrabber.h +44 -0
  107. data/vendor/Cocos2D/include/CCGrid.h +130 -0
  108. data/vendor/Cocos2D/include/CCLabelAtlas.h +68 -0
  109. data/vendor/Cocos2D/include/CCLabelBMFont.h +216 -0
  110. data/vendor/Cocos2D/include/CCLabelTTF.h +132 -0
  111. data/vendor/Cocos2D/include/CCLayer.h +280 -0
  112. data/vendor/Cocos2D/include/CCMenu.h +100 -0
  113. data/vendor/Cocos2D/include/CCMenuItem.h +423 -0
  114. data/vendor/Cocos2D/include/CCMotionStreak.h +87 -0
  115. data/vendor/Cocos2D/include/CCNS.h +54 -0
  116. data/vendor/Cocos2D/include/CCNode+Debug.h +39 -0
  117. data/vendor/Cocos2D/include/CCNode.h +569 -0
  118. data/vendor/Cocos2D/include/CCParallaxNode.h +50 -0
  119. data/vendor/Cocos2D/include/CCParticleBatchNode.h +99 -0
  120. data/vendor/Cocos2D/include/CCParticleExamples.h +95 -0
  121. data/vendor/Cocos2D/include/CCParticleSystem.h +453 -0
  122. data/vendor/Cocos2D/include/CCParticleSystemQuad.h +73 -0
  123. data/vendor/Cocos2D/include/CCProfiling.h +89 -0
  124. data/vendor/Cocos2D/include/CCProgressTimer.h +94 -0
  125. data/vendor/Cocos2D/include/CCProtocols.h +132 -0
  126. data/vendor/Cocos2D/include/CCRenderTexture.h +139 -0
  127. data/vendor/Cocos2D/include/CCScene.h +43 -0
  128. data/vendor/Cocos2D/include/CCScheduler.h +230 -0
  129. data/vendor/Cocos2D/include/CCShaderCache.h +60 -0
  130. data/vendor/Cocos2D/include/CCSprite.h +288 -0
  131. data/vendor/Cocos2D/include/CCSpriteBatchNode.h +138 -0
  132. data/vendor/Cocos2D/include/CCSpriteFrame.h +126 -0
  133. data/vendor/Cocos2D/include/CCSpriteFrameCache.h +121 -0
  134. data/vendor/Cocos2D/include/CCTMXLayer.h +164 -0
  135. data/vendor/Cocos2D/include/CCTMXObjectGroup.h +67 -0
  136. data/vendor/Cocos2D/include/CCTMXTiledMap.h +145 -0
  137. data/vendor/Cocos2D/include/CCTMXXMLParser.h +217 -0
  138. data/vendor/Cocos2D/include/CCTexture2D.h +357 -0
  139. data/vendor/Cocos2D/include/CCTextureAtlas.h +188 -0
  140. data/vendor/Cocos2D/include/CCTextureCache.h +146 -0
  141. data/vendor/Cocos2D/include/CCTexturePVR.h +129 -0
  142. data/vendor/Cocos2D/include/CCTileMapAtlas.h +83 -0
  143. data/vendor/Cocos2D/include/CCTouchDelegateProtocol.h +75 -0
  144. data/vendor/Cocos2D/include/CCTouchDispatcher.h +120 -0
  145. data/vendor/Cocos2D/include/CCTouchHandler.h +93 -0
  146. data/vendor/Cocos2D/include/CCTransition.h +296 -0
  147. data/vendor/Cocos2D/include/CCTransitionPageTurn.h +60 -0
  148. data/vendor/Cocos2D/include/CCTransitionProgress.h +62 -0
  149. data/vendor/Cocos2D/include/CCVertex.h +36 -0
  150. data/vendor/Cocos2D/include/CGPointExtension.h +344 -0
  151. data/vendor/Cocos2D/include/CocosDenshion/CDAudioManager.h +243 -0
  152. data/vendor/Cocos2D/include/CocosDenshion/CDConfig.h +60 -0
  153. data/vendor/Cocos2D/include/CocosDenshion/CDOpenALSupport.h +77 -0
  154. data/vendor/Cocos2D/include/CocosDenshion/CDXPropertyModifierAction.h +45 -0
  155. data/vendor/Cocos2D/include/CocosDenshion/CocosDenshion.h +440 -0
  156. data/vendor/Cocos2D/include/CocosDenshion/SimpleAudioEngine.h +90 -0
  157. data/vendor/Cocos2D/include/NSThread+performBlock.h +22 -0
  158. data/vendor/Cocos2D/include/OpenGL_Internal.h +86 -0
  159. data/vendor/Cocos2D/include/RubyMotionSchedule.h +7 -0
  160. data/vendor/Cocos2D/include/TGAlib.h +55 -0
  161. data/vendor/Cocos2D/include/TransformUtils.h +36 -0
  162. data/vendor/Cocos2D/include/ZipUtils.h +91 -0
  163. data/vendor/Cocos2D/include/base64.h +33 -0
  164. data/vendor/Cocos2D/include/ccCArray.h +229 -0
  165. data/vendor/Cocos2D/include/ccConfig.h +245 -0
  166. data/vendor/Cocos2D/include/ccDeprecated.h +300 -0
  167. data/vendor/Cocos2D/include/ccGLStateCache.h +138 -0
  168. data/vendor/Cocos2D/include/ccMacros.h +353 -0
  169. data/vendor/Cocos2D/include/ccShader_PositionColor_frag.h +12 -0
  170. data/vendor/Cocos2D/include/ccShader_PositionColor_vert.h +17 -0
  171. data/vendor/Cocos2D/include/ccShader_PositionTextureA8Color_frag.h +16 -0
  172. data/vendor/Cocos2D/include/ccShader_PositionTextureA8Color_vert.h +21 -0
  173. data/vendor/Cocos2D/include/ccShader_PositionTextureColorAlphaTest_frag.h +23 -0
  174. data/vendor/Cocos2D/include/ccShader_PositionTextureColor_frag.h +14 -0
  175. data/vendor/Cocos2D/include/ccShader_PositionTextureColor_vert.h +22 -0
  176. data/vendor/Cocos2D/include/ccShader_PositionTexture_frag.h +13 -0
  177. data/vendor/Cocos2D/include/ccShader_PositionTexture_uColor_frag.h +16 -0
  178. data/vendor/Cocos2D/include/ccShader_PositionTexture_uColor_vert.h +18 -0
  179. data/vendor/Cocos2D/include/ccShader_PositionTexture_vert.h +17 -0
  180. data/vendor/Cocos2D/include/ccShader_Position_uColor_frag.h +12 -0
  181. data/vendor/Cocos2D/include/ccShader_Position_uColor_vert.h +19 -0
  182. data/vendor/Cocos2D/include/ccShaders.h +45 -0
  183. data/vendor/Cocos2D/include/ccTypes.h +374 -0
  184. data/vendor/Cocos2D/include/ccUtils.h +36 -0
  185. data/vendor/Cocos2D/include/cocos2d.h +178 -0
  186. data/vendor/Cocos2D/include/kazmath/GL/mat4stack.h +51 -0
  187. data/vendor/Cocos2D/include/kazmath/GL/matrix.h +58 -0
  188. data/vendor/Cocos2D/include/kazmath/aabb.h +53 -0
  189. data/vendor/Cocos2D/include/kazmath/kazmath.h +39 -0
  190. data/vendor/Cocos2D/include/kazmath/mat3.h +75 -0
  191. data/vendor/Cocos2D/include/kazmath/mat4.h +93 -0
  192. data/vendor/Cocos2D/include/kazmath/neon_matrix_impl.h +41 -0
  193. data/vendor/Cocos2D/include/kazmath/plane.h +70 -0
  194. data/vendor/Cocos2D/include/kazmath/quaternion.h +113 -0
  195. data/vendor/Cocos2D/include/kazmath/ray2.h +50 -0
  196. data/vendor/Cocos2D/include/kazmath/utility.h +74 -0
  197. data/vendor/Cocos2D/include/kazmath/vec2.h +64 -0
  198. data/vendor/Cocos2D/include/kazmath/vec3.h +68 -0
  199. data/vendor/Cocos2D/include/kazmath/vec4.h +68 -0
  200. data/vendor/Cocos2D/include/uthash.h +972 -0
  201. data/vendor/Cocos2D/include/utlist.h +490 -0
  202. data/vendor/Cocos2D/libCocosDenshion.a +0 -0
  203. data/vendor/Cocos2D/libcocos2d.a +0 -0
  204. metadata +277 -0
@@ -0,0 +1,165 @@
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 "CCActionInterval.h"
28
+ #import "CCActionInstant.h"
29
+ #import "CCGrid.h"
30
+
31
+ @class CCGridBase;
32
+
33
+ /** Base class for Grid actions */
34
+ @interface CCGridAction : CCActionInterval
35
+ {
36
+ ccGridSize gridSize_;
37
+ }
38
+
39
+ /** size of the grid */
40
+ @property (nonatomic,readwrite) ccGridSize gridSize;
41
+
42
+ /** creates the action with size and duration */
43
+ +(id) actionWithSize:(ccGridSize)size duration:(ccTime)d;
44
+ /** initializes the action with size and duration */
45
+ -(id) initWithSize:(ccGridSize)gridSize duration:(ccTime)d;
46
+ /** returns the grid */
47
+ -(CCGridBase *)grid;
48
+
49
+ @end
50
+
51
+ ////////////////////////////////////////////////////////////
52
+
53
+ /** Base class for CCGrid3D actions.
54
+ Grid3D actions can modify a non-tiled grid.
55
+ */
56
+ @interface CCGrid3DAction : CCGridAction
57
+ {
58
+ }
59
+
60
+ /** returns the vertex than belongs to certain position in the grid */
61
+ -(ccVertex3F)vertex:(ccGridSize)pos;
62
+ /** returns the non-transformed vertex than belongs to certain position in the grid */
63
+ -(ccVertex3F)originalVertex:(ccGridSize)pos;
64
+ /** sets a new vertex to a certain position of the grid */
65
+ -(void)setVertex:(ccGridSize)pos vertex:(ccVertex3F)vertex;
66
+
67
+ @end
68
+
69
+ ////////////////////////////////////////////////////////////
70
+
71
+ /** Base class for CCTiledGrid3D actions */
72
+ @interface CCTiledGrid3DAction : CCGridAction
73
+ {
74
+ }
75
+
76
+ /** returns the tile that belongs to a certain position of the grid */
77
+ -(ccQuad3)tile:(ccGridSize)pos;
78
+ /** returns the non-transformed tile that belongs to a certain position of the grid */
79
+ -(ccQuad3)originalTile:(ccGridSize)pos;
80
+ /** sets a new tile to a certain position of the grid */
81
+ -(void)setTile:(ccGridSize)pos coords:(ccQuad3)coords;
82
+
83
+ @end
84
+
85
+ ////////////////////////////////////////////////////////////
86
+
87
+ /** CCAccelDeccelAmplitude action */
88
+ @interface CCAccelDeccelAmplitude : CCActionInterval
89
+ {
90
+ float rate_;
91
+ CCActionInterval *other_;
92
+ }
93
+
94
+ /** amplitude rate */
95
+ @property (nonatomic,readwrite) float rate;
96
+
97
+ /** creates the action with an inner action that has the amplitude property, and a duration time */
98
+ +(id)actionWithAction:(CCAction*)action duration:(ccTime)d;
99
+ /** initializes the action with an inner action that has the amplitude property, and a duration time */
100
+ -(id)initWithAction:(CCAction*)action duration:(ccTime)d;
101
+
102
+ @end
103
+
104
+ ////////////////////////////////////////////////////////////
105
+
106
+ /** CCAccelAmplitude action */
107
+ @interface CCAccelAmplitude : CCActionInterval
108
+ {
109
+ float rate_;
110
+ CCActionInterval *other_;
111
+ }
112
+
113
+ /** amplitude rate */
114
+ @property (nonatomic,readwrite) float rate;
115
+
116
+ /** creates the action with an inner action that has the amplitude property, and a duration time */
117
+ +(id)actionWithAction:(CCAction*)action duration:(ccTime)d;
118
+ /** initializes the action with an inner action that has the amplitude property, and a duration time */
119
+ -(id)initWithAction:(CCAction*)action duration:(ccTime)d;
120
+
121
+ @end
122
+
123
+ ////////////////////////////////////////////////////////////
124
+
125
+ /** CCDeccelAmplitude action */
126
+ @interface CCDeccelAmplitude : CCActionInterval
127
+ {
128
+ float rate_;
129
+ CCActionInterval *other_;
130
+ }
131
+
132
+ /** amplitude rate */
133
+ @property (nonatomic,readwrite) float rate;
134
+
135
+ /** creates the action with an inner action that has the amplitude property, and a duration time */
136
+ +(id)actionWithAction:(CCAction*)action duration:(ccTime)d;
137
+ /** initializes the action with an inner action that has the amplitude property, and a duration time */
138
+ -(id)initWithAction:(CCAction*)action duration:(ccTime)d;
139
+
140
+ @end
141
+
142
+ ////////////////////////////////////////////////////////////
143
+
144
+ /** CCStopGrid action.
145
+ Don't call this action if another grid action is active.
146
+ Call if you want to remove the the grid effect. Example:
147
+ [Sequence actions:[Lens ...], [StopGrid action], nil];
148
+ */
149
+ @interface CCStopGrid : CCActionInstant
150
+ {
151
+ }
152
+ @end
153
+
154
+ ////////////////////////////////////////////////////////////
155
+
156
+ /** CCReuseGrid action */
157
+ @interface CCReuseGrid : CCActionInstant
158
+ {
159
+ int t_;
160
+ }
161
+ /** creates an action with the number of times that the current grid will be reused */
162
+ +(id) actionWithTimes: (int) times;
163
+ /** initializes an action with the number of times that the current grid will be reused */
164
+ -(id) initWithTimes: (int) times;
165
+ @end
@@ -0,0 +1,205 @@
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 "CCActionGrid.h"
28
+
29
+ /** CCWaves3D action */
30
+ @interface CCWaves3D : CCGrid3DAction
31
+ {
32
+ int waves;
33
+ float amplitude;
34
+ float amplitudeRate;
35
+ }
36
+
37
+ /** amplitude of the wave */
38
+ @property (nonatomic,readwrite) float amplitude;
39
+ /** amplitude rate of the wave */
40
+ @property (nonatomic,readwrite) float amplitudeRate;
41
+
42
+ +(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d;
43
+ -(id)initWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d;
44
+
45
+ @end
46
+
47
+ ////////////////////////////////////////////////////////////
48
+
49
+ /** CCFlipX3D action */
50
+ @interface CCFlipX3D : CCGrid3DAction
51
+ {
52
+ }
53
+
54
+ /** creates the action with duration */
55
+ +(id) actionWithDuration:(ccTime)d;
56
+ /** initizlies the action with duration */
57
+ -(id) initWithDuration:(ccTime)d;
58
+
59
+ @end
60
+
61
+ ////////////////////////////////////////////////////////////
62
+
63
+ /** CCFlipY3D action */
64
+ @interface CCFlipY3D : CCFlipX3D
65
+ {
66
+ }
67
+
68
+ @end
69
+
70
+ ////////////////////////////////////////////////////////////
71
+
72
+ /** CCLens3D action */
73
+ @interface CCLens3D : CCGrid3DAction
74
+ {
75
+ CGPoint position_;
76
+ float radius_;
77
+ float lensEffect_;
78
+ BOOL dirty_;
79
+ }
80
+
81
+ /** lens effect. Defaults to 0.7 - 0 means no effect, 1 is very strong effect */
82
+ @property (nonatomic,readwrite) float lensEffect;
83
+ /** lens center position in Points */
84
+ @property (nonatomic,readwrite) CGPoint position;
85
+
86
+ /** creates the action with center position in Points, radius, a grid size and duration */
87
+ +(id)actionWithPosition:(CGPoint)pos radius:(float)r grid:(ccGridSize)gridSize duration:(ccTime)d;
88
+ /** initializes the action with center position in Points, radius, a grid size and duration */
89
+ -(id)initWithPosition:(CGPoint)pos radius:(float)r grid:(ccGridSize)gridSize duration:(ccTime)d;
90
+
91
+ @end
92
+
93
+ ////////////////////////////////////////////////////////////
94
+
95
+ /** CCRipple3D action */
96
+ @interface CCRipple3D : CCGrid3DAction
97
+ {
98
+ CGPoint position_;
99
+ float radius_;
100
+ int waves_;
101
+ float amplitude_;
102
+ float amplitudeRate_;
103
+ }
104
+
105
+ /** center position in Points */
106
+ @property (nonatomic,readwrite) CGPoint position;
107
+ /** amplitude */
108
+ @property (nonatomic,readwrite) float amplitude;
109
+ /** amplitude rate */
110
+ @property (nonatomic,readwrite) float amplitudeRate;
111
+
112
+ /** creates the action with a position in points, radius, number of waves, amplitude, a grid size and duration */
113
+ +(id)actionWithPosition:(CGPoint)pos radius:(float)r waves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d;
114
+ /** initializes the action with a position in points, radius, number of waves, amplitude, a grid size and duration */
115
+ -(id)initWithPosition:(CGPoint)pos radius:(float)r waves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d;
116
+
117
+ @end
118
+
119
+ ////////////////////////////////////////////////////////////
120
+
121
+ /** CCShaky3D action */
122
+ @interface CCShaky3D : CCGrid3DAction
123
+ {
124
+ int randrange;
125
+ BOOL shakeZ;
126
+ }
127
+
128
+ /** creates the action with a range, shake Z vertices, a grid and duration */
129
+ +(id)actionWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(ccGridSize)gridSize duration:(ccTime)d;
130
+ /** initializes the action with a range, shake Z vertices, a grid and duration */
131
+ -(id)initWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(ccGridSize)gridSize duration:(ccTime)d;
132
+
133
+ @end
134
+
135
+ ////////////////////////////////////////////////////////////
136
+
137
+ /** CCLiquid action */
138
+ @interface CCLiquid : CCGrid3DAction
139
+ {
140
+ int waves;
141
+ float amplitude;
142
+ float amplitudeRate;
143
+
144
+ }
145
+
146
+ /** amplitude */
147
+ @property (nonatomic,readwrite) float amplitude;
148
+ /** amplitude rate */
149
+ @property (nonatomic,readwrite) float amplitudeRate;
150
+
151
+ /** creates the action with amplitude, a grid and duration */
152
+ +(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d;
153
+ /** initializes the action with amplitude, a grid and duration */
154
+ -(id)initWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d;
155
+
156
+ @end
157
+
158
+ ////////////////////////////////////////////////////////////
159
+
160
+ /** CCWaves action */
161
+ @interface CCWaves : CCGrid3DAction
162
+ {
163
+ int waves;
164
+ float amplitude;
165
+ float amplitudeRate;
166
+ BOOL vertical;
167
+ BOOL horizontal;
168
+ }
169
+
170
+ /** amplitude */
171
+ @property (nonatomic,readwrite) float amplitude;
172
+ /** amplitude rate */
173
+ @property (nonatomic,readwrite) float amplitudeRate;
174
+
175
+ /** initializes the action with amplitude, horizontal sin, vertical sin, a grid and duration */
176
+ +(id)actionWithWaves:(int)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v grid:(ccGridSize)gridSize duration:(ccTime)d;
177
+ /** creates the action with amplitude, horizontal sin, vertical sin, a grid and duration */
178
+ -(id)initWithWaves:(int)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v grid:(ccGridSize)gridSize duration:(ccTime)d;
179
+
180
+ @end
181
+
182
+ ////////////////////////////////////////////////////////////
183
+
184
+ /** CCTwirl action */
185
+ @interface CCTwirl : CCGrid3DAction
186
+ {
187
+ CGPoint position_;
188
+ int twirls_;
189
+ float amplitude_;
190
+ float amplitudeRate_;
191
+ }
192
+
193
+ /** twirl center */
194
+ @property (nonatomic,readwrite) CGPoint position;
195
+ /** amplitude */
196
+ @property (nonatomic,readwrite) float amplitude;
197
+ /** amplitude rate */
198
+ @property (nonatomic,readwrite) float amplitudeRate;
199
+
200
+ /** creates the action with center position, number of twirls, amplitude, a grid size and duration */
201
+ +(id)actionWithPosition:(CGPoint)pos twirls:(int)t amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d;
202
+ /** initializes the action with center position, number of twirls, amplitude, a grid size and duration */
203
+ -(id)initWithPosition:(CGPoint)pos twirls:(int)t amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d;
204
+
205
+ @end
@@ -0,0 +1,227 @@
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 "CCAction.h"
29
+
30
+ /** Instant actions are immediate actions. They don't have a duration like
31
+ the CCIntervalAction actions.
32
+ */
33
+ @interface CCActionInstant : CCFiniteTimeAction <NSCopying>
34
+ {
35
+ }
36
+ @end
37
+
38
+ /** Show the node
39
+ */
40
+ @interface CCShow : CCActionInstant
41
+ {
42
+ }
43
+ @end
44
+
45
+ /** Hide the node
46
+ */
47
+ @interface CCHide : CCActionInstant
48
+ {
49
+ }
50
+ @end
51
+
52
+ /** Toggles the visibility of a node
53
+ */
54
+ @interface CCToggleVisibility : CCActionInstant
55
+ {
56
+ }
57
+ @end
58
+
59
+ /** Flips the sprite horizontally
60
+ @since v0.99.0
61
+ */
62
+ @interface CCFlipX : CCActionInstant
63
+ {
64
+ BOOL flipX;
65
+ }
66
+ +(id) actionWithFlipX:(BOOL)x;
67
+ -(id) initWithFlipX:(BOOL)x;
68
+ @end
69
+
70
+ /** Flips the sprite vertically
71
+ @since v0.99.0
72
+ */
73
+ @interface CCFlipY : CCActionInstant
74
+ {
75
+ BOOL flipY;
76
+ }
77
+ +(id) actionWithFlipY:(BOOL)y;
78
+ -(id) initWithFlipY:(BOOL)y;
79
+ @end
80
+
81
+ /** Places the node in a certain position
82
+ */
83
+ @interface CCPlace : CCActionInstant <NSCopying>
84
+ {
85
+ CGPoint position;
86
+ }
87
+ /** creates a Place action with a position */
88
+ +(id) actionWithPosition: (CGPoint) pos;
89
+ /** Initializes a Place action with a position */
90
+ -(id) initWithPosition: (CGPoint) pos;
91
+ @end
92
+
93
+ /** Calls a 'callback'
94
+ */
95
+ @interface CCCallFunc : CCActionInstant <NSCopying>
96
+ {
97
+ id targetCallback_;
98
+ SEL selector_;
99
+ }
100
+
101
+ /** Target that will be called */
102
+ @property (nonatomic, readwrite, retain) id targetCallback;
103
+
104
+ /** creates the action with the callback */
105
+ +(id) actionWithTarget: (id) t selector:(SEL) s;
106
+ /** initializes the action with the callback */
107
+ -(id) initWithTarget: (id) t selector:(SEL) s;
108
+ /** exeuctes the callback */
109
+ -(void) execute;
110
+ @end
111
+
112
+ /** Calls a 'callback' with the node as the first argument.
113
+ N means Node
114
+ */
115
+ @interface CCCallFuncN : CCCallFunc
116
+ {
117
+ }
118
+ @end
119
+
120
+ typedef void (*CC_CALLBACK_ND)(id, SEL, id, void *);
121
+ /** Calls a 'callback' with the node as the first argument and the 2nd argument is data.
122
+ * ND means: Node and Data. Data is void *, so it could be anything.
123
+ */
124
+ @interface CCCallFuncND : CCCallFuncN
125
+ {
126
+ void *data_;
127
+ CC_CALLBACK_ND callbackMethod_;
128
+ }
129
+
130
+ /** Invocation object that has the target#selector and the parameters */
131
+ @property (nonatomic,readwrite) CC_CALLBACK_ND callbackMethod;
132
+
133
+ /** creates the action with the callback and the data to pass as an argument */
134
+ +(id) actionWithTarget: (id) t selector:(SEL) s data:(void*)d;
135
+ /** initializes the action with the callback and the data to pass as an argument */
136
+ -(id) initWithTarget:(id) t selector:(SEL) s data:(void*) d;
137
+ @end
138
+
139
+ /** Calls a 'callback' with an object as the first argument.
140
+ O means Object.
141
+ @since v0.99.5
142
+ */
143
+ @interface CCCallFuncO : CCCallFunc
144
+ {
145
+ id object_;
146
+ }
147
+ /** object to be passed as argument */
148
+ @property (nonatomic, readwrite, retain) id object;
149
+
150
+ /** creates the action with the callback and the object to pass as an argument */
151
+ +(id) actionWithTarget: (id) t selector:(SEL) s object:(id)object;
152
+ /** initializes the action with the callback and the object to pass as an argument */
153
+ -(id) initWithTarget:(id) t selector:(SEL) s object:(id)object;
154
+
155
+ @end
156
+
157
+ #pragma mark Blocks Support
158
+
159
+ /** Executes a callback using a block.
160
+ */
161
+ @interface CCCallBlock : CCActionInstant<NSCopying>
162
+ {
163
+ void (^block_)();
164
+ }
165
+
166
+ /** creates the action with the specified block, to be used as a callback.
167
+ The block will be "copied".
168
+ */
169
+ +(id) actionWithBlock:(void(^)())block;
170
+
171
+ /** initialized the action with the specified block, to be used as a callback.
172
+ The block will be "copied".
173
+ */
174
+ -(id) initWithBlock:(void(^)())block;
175
+
176
+ /** executes the callback */
177
+ -(void) execute;
178
+ @end
179
+
180
+ @class CCNode;
181
+
182
+ /** Executes a callback using a block with a single CCNode parameter.
183
+ */
184
+ @interface CCCallBlockN : CCActionInstant<NSCopying>
185
+ {
186
+ void (^block_)(CCNode *);
187
+ }
188
+
189
+ /** creates the action with the specified block, to be used as a callback.
190
+ The block will be "copied".
191
+ */
192
+ +(id) actionWithBlock:(void(^)(CCNode *node))block;
193
+
194
+ /** initialized the action with the specified block, to be used as a callback.
195
+ The block will be "copied".
196
+ */
197
+ -(id) initWithBlock:(void(^)(CCNode *node))block;
198
+
199
+ /** executes the callback */
200
+ -(void) execute;
201
+ @end
202
+
203
+ /** Executes a callback using a block with a single NSObject parameter.
204
+ @since v2.0
205
+ */
206
+ @interface CCCallBlockO : CCActionInstant<NSCopying>
207
+ {
208
+ void (^block_)(id object);
209
+ id object_;
210
+ }
211
+
212
+ /** object to be passed to the block */
213
+ @property (nonatomic,retain) id object;
214
+
215
+ /** creates the action with the specified block, to be used as a callback.
216
+ The block will be "copied".
217
+ */
218
+ +(id) actionWithBlock:(void(^)(id object))block object:(id)object;
219
+
220
+ /** initialized the action with the specified block, to be used as a callback.
221
+ The block will be "copied".
222
+ */
223
+ -(id) initWithBlock:(void(^)(id object))block object:(id)object;
224
+
225
+ /** executes the callback */
226
+ -(void) execute;
227
+ @end