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.
- checksums.yaml +15 -0
- data/.gitignore +18 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +27 -0
- data/LICENSE +22 -0
- data/README.md +86 -0
- data/Rakefile +14 -0
- data/app/app_delegate.rb +49 -0
- data/app/layers/box2d_layer.rb +109 -0
- data/app/layers/cocos2d_layer.rb +14 -0
- data/app/layers/cocos_motion_layer.rb +145 -0
- data/app/layers/menu_layer.rb +59 -0
- data/joybox.gemspec +25 -0
- data/lib/joybox.rb +47 -0
- data/lib/joybox/box2d/body.rb +106 -0
- data/lib/joybox/box2d/world.rb +79 -0
- data/lib/joybox/cocos2d/actions/actions.rb +7 -0
- data/lib/joybox/cocos2d/actions/move.rb +31 -0
- data/lib/joybox/cocos2d/actions/repeat.rb +24 -0
- data/lib/joybox/cocos2d/actions/rotate.rb +31 -0
- data/lib/joybox/cocos2d/actions/scale.rb +31 -0
- data/lib/joybox/cocos2d/actions/sequence.rb +22 -0
- data/lib/joybox/cocos2d/actions/skew.rb +36 -0
- data/lib/joybox/cocos2d/cocos2d.rb +15 -0
- data/lib/joybox/cocos2d/common/cg_point.rb +37 -0
- data/lib/joybox/cocos2d/common/color.rb +49 -0
- data/lib/joybox/cocos2d/common/gc_size.rb +39 -0
- data/lib/joybox/cocos2d/common/ns_set.rb +5 -0
- data/lib/joybox/cocos2d/common/numeric.rb +14 -0
- data/lib/joybox/cocos2d/common/screen.rb +39 -0
- data/lib/joybox/cocos2d/common/ui_touch.rb +15 -0
- data/lib/joybox/cocos2d/configuration/configuration.rb +68 -0
- data/lib/joybox/cocos2d/configuration/file_utils.rb +33 -0
- data/lib/joybox/cocos2d/configuration/gl_view.rb +44 -0
- data/lib/joybox/cocos2d/configuration/texture_2d.rb +27 -0
- data/lib/joybox/cocos2d/core/layer.rb +87 -0
- data/lib/joybox/cocos2d/core/node.rb +26 -0
- data/lib/joybox/cocos2d/core/physics_sprite.rb +52 -0
- data/lib/joybox/cocos2d/core/scene.rb +24 -0
- data/lib/joybox/cocos2d/core/sprite.rb +43 -0
- data/lib/joybox/cocos2d/core/sprite_batch.rb +24 -0
- data/lib/joybox/cocos2d/director.rb +43 -0
- data/lib/joybox/cocos2d/macros.rb +234 -0
- data/lib/joybox/cocos2d/ui/label.rb +34 -0
- data/lib/joybox/cocos2d/ui/menu.rb +25 -0
- data/lib/joybox/cocos2d/ui/menu_image.rb +22 -0
- data/lib/joybox/cocos2d/ui/menu_label.rb +45 -0
- data/lib/joybox/cocos2d/ui/ui.rb +7 -0
- data/lib/joybox/version.rb +3 -0
- data/resources/box2d/blocks_sprite_sheet.png +0 -0
- data/resources/cocos_motion/dot.png +0 -0
- data/resources/cocos_motion/dot_selected.png +0 -0
- data/resources/cocos_motion/grossini.png +0 -0
- data/resources/cocos_motion/grossinis_sister.png +0 -0
- data/resources/cocos_motion/grossinis_sister_two.png +0 -0
- data/resources/cocos_motion/left_arrow.png +0 -0
- data/resources/cocos_motion/left_arrow_selected.png +0 -0
- data/resources/cocos_motion/right_arrow.png +0 -0
- data/resources/cocos_motion/right_arrow_selected.png +0 -0
- data/resources/fps_images-hd.png +0 -0
- data/resources/fps_images-ipadhd.png +0 -0
- data/resources/fps_images.png +0 -0
- data/spec/lib/joybox/cocos2d/cocos2d_spec.rb +7 -0
- data/spec/lib/joybox/cocos2d/macros_spec.rb +37 -0
- data/spec/main_spec.rb +9 -0
- data/vendor/Box2D.framework/Box2D +0 -0
- data/vendor/Box2D.framework/Box2D.framework.bridgesupport +166 -0
- data/vendor/Box2D.framework/Versions/A/Box2D +0 -0
- data/vendor/Box2D.framework/Versions/A/Headers/Collision/B2DContactListener.h +25 -0
- data/vendor/Box2D.framework/Versions/A/Headers/Collision/Shapes/B2DEdgeShape.h +17 -0
- data/vendor/Box2D.framework/Versions/A/Headers/Collision/Shapes/B2DPolygonShape.h +16 -0
- data/vendor/Box2D.framework/Versions/A/Headers/Collision/Shapes/B2DShape.h +15 -0
- data/vendor/Box2D.framework/Versions/A/Headers/Dynamics/B2DBody.h +43 -0
- data/vendor/Box2D.framework/Versions/A/Headers/Dynamics/B2DWorld.h +41 -0
- data/vendor/Box2D.framework/Versions/A/Resources/Box2DConfig.cmake +3 -0
- data/vendor/Box2D.framework/Versions/A/Resources/CMakeLists.txt +205 -0
- data/vendor/Cocos2D/Cocos2D.bridgesupport +7808 -0
- data/vendor/Cocos2D/include/CCAction.h +195 -0
- data/vendor/Cocos2D/include/CCActionCamera.h +73 -0
- data/vendor/Cocos2D/include/CCActionCatmullRom.h +139 -0
- data/vendor/Cocos2D/include/CCActionEase.h +159 -0
- data/vendor/Cocos2D/include/CCActionGrid.h +165 -0
- data/vendor/Cocos2D/include/CCActionGrid3D.h +205 -0
- data/vendor/Cocos2D/include/CCActionInstant.h +227 -0
- data/vendor/Cocos2D/include/CCActionInterval.h +431 -0
- data/vendor/Cocos2D/include/CCActionManager.h +113 -0
- data/vendor/Cocos2D/include/CCActionPageTurn3D.h +42 -0
- data/vendor/Cocos2D/include/CCActionProgressTimer.h +59 -0
- data/vendor/Cocos2D/include/CCActionTiledGrid.h +211 -0
- data/vendor/Cocos2D/include/CCActionTween.h +62 -0
- data/vendor/Cocos2D/include/CCAnimation.h +150 -0
- data/vendor/Cocos2D/include/CCAnimationCache.h +74 -0
- data/vendor/Cocos2D/include/CCArray.h +119 -0
- data/vendor/Cocos2D/include/CCAtlasNode.h +96 -0
- data/vendor/Cocos2D/include/CCCamera.h +98 -0
- data/vendor/Cocos2D/include/CCConfiguration.h +126 -0
- data/vendor/Cocos2D/include/CCDirector.h +344 -0
- data/vendor/Cocos2D/include/CCDirectorIOS.h +104 -0
- data/vendor/Cocos2D/include/CCDrawingPrimitives.h +139 -0
- data/vendor/Cocos2D/include/CCES2Renderer.h +83 -0
- data/vendor/Cocos2D/include/CCESRenderer.h +54 -0
- data/vendor/Cocos2D/include/CCFileUtils.h +188 -0
- data/vendor/Cocos2D/include/CCGL.h +72 -0
- data/vendor/Cocos2D/include/CCGLProgram.h +150 -0
- data/vendor/Cocos2D/include/CCGLView.h +160 -0
- data/vendor/Cocos2D/include/CCGrabber.h +44 -0
- data/vendor/Cocos2D/include/CCGrid.h +130 -0
- data/vendor/Cocos2D/include/CCLabelAtlas.h +68 -0
- data/vendor/Cocos2D/include/CCLabelBMFont.h +216 -0
- data/vendor/Cocos2D/include/CCLabelTTF.h +132 -0
- data/vendor/Cocos2D/include/CCLayer.h +280 -0
- data/vendor/Cocos2D/include/CCMenu.h +100 -0
- data/vendor/Cocos2D/include/CCMenuItem.h +423 -0
- data/vendor/Cocos2D/include/CCMotionStreak.h +87 -0
- data/vendor/Cocos2D/include/CCNS.h +54 -0
- data/vendor/Cocos2D/include/CCNode+Debug.h +39 -0
- data/vendor/Cocos2D/include/CCNode.h +569 -0
- data/vendor/Cocos2D/include/CCParallaxNode.h +50 -0
- data/vendor/Cocos2D/include/CCParticleBatchNode.h +99 -0
- data/vendor/Cocos2D/include/CCParticleExamples.h +95 -0
- data/vendor/Cocos2D/include/CCParticleSystem.h +453 -0
- data/vendor/Cocos2D/include/CCParticleSystemQuad.h +73 -0
- data/vendor/Cocos2D/include/CCProfiling.h +89 -0
- data/vendor/Cocos2D/include/CCProgressTimer.h +94 -0
- data/vendor/Cocos2D/include/CCProtocols.h +132 -0
- data/vendor/Cocos2D/include/CCRenderTexture.h +139 -0
- data/vendor/Cocos2D/include/CCScene.h +43 -0
- data/vendor/Cocos2D/include/CCScheduler.h +230 -0
- data/vendor/Cocos2D/include/CCShaderCache.h +60 -0
- data/vendor/Cocos2D/include/CCSprite.h +288 -0
- data/vendor/Cocos2D/include/CCSpriteBatchNode.h +138 -0
- data/vendor/Cocos2D/include/CCSpriteFrame.h +126 -0
- data/vendor/Cocos2D/include/CCSpriteFrameCache.h +121 -0
- data/vendor/Cocos2D/include/CCTMXLayer.h +164 -0
- data/vendor/Cocos2D/include/CCTMXObjectGroup.h +67 -0
- data/vendor/Cocos2D/include/CCTMXTiledMap.h +145 -0
- data/vendor/Cocos2D/include/CCTMXXMLParser.h +217 -0
- data/vendor/Cocos2D/include/CCTexture2D.h +357 -0
- data/vendor/Cocos2D/include/CCTextureAtlas.h +188 -0
- data/vendor/Cocos2D/include/CCTextureCache.h +146 -0
- data/vendor/Cocos2D/include/CCTexturePVR.h +129 -0
- data/vendor/Cocos2D/include/CCTileMapAtlas.h +83 -0
- data/vendor/Cocos2D/include/CCTouchDelegateProtocol.h +75 -0
- data/vendor/Cocos2D/include/CCTouchDispatcher.h +120 -0
- data/vendor/Cocos2D/include/CCTouchHandler.h +93 -0
- data/vendor/Cocos2D/include/CCTransition.h +296 -0
- data/vendor/Cocos2D/include/CCTransitionPageTurn.h +60 -0
- data/vendor/Cocos2D/include/CCTransitionProgress.h +62 -0
- data/vendor/Cocos2D/include/CCVertex.h +36 -0
- data/vendor/Cocos2D/include/CGPointExtension.h +344 -0
- data/vendor/Cocos2D/include/CocosDenshion/CDAudioManager.h +243 -0
- data/vendor/Cocos2D/include/CocosDenshion/CDConfig.h +60 -0
- data/vendor/Cocos2D/include/CocosDenshion/CDOpenALSupport.h +77 -0
- data/vendor/Cocos2D/include/CocosDenshion/CDXPropertyModifierAction.h +45 -0
- data/vendor/Cocos2D/include/CocosDenshion/CocosDenshion.h +440 -0
- data/vendor/Cocos2D/include/CocosDenshion/SimpleAudioEngine.h +90 -0
- data/vendor/Cocos2D/include/NSThread+performBlock.h +22 -0
- data/vendor/Cocos2D/include/OpenGL_Internal.h +86 -0
- data/vendor/Cocos2D/include/RubyMotionSchedule.h +7 -0
- data/vendor/Cocos2D/include/TGAlib.h +55 -0
- data/vendor/Cocos2D/include/TransformUtils.h +36 -0
- data/vendor/Cocos2D/include/ZipUtils.h +91 -0
- data/vendor/Cocos2D/include/base64.h +33 -0
- data/vendor/Cocos2D/include/ccCArray.h +229 -0
- data/vendor/Cocos2D/include/ccConfig.h +245 -0
- data/vendor/Cocos2D/include/ccDeprecated.h +300 -0
- data/vendor/Cocos2D/include/ccGLStateCache.h +138 -0
- data/vendor/Cocos2D/include/ccMacros.h +353 -0
- data/vendor/Cocos2D/include/ccShader_PositionColor_frag.h +12 -0
- data/vendor/Cocos2D/include/ccShader_PositionColor_vert.h +17 -0
- data/vendor/Cocos2D/include/ccShader_PositionTextureA8Color_frag.h +16 -0
- data/vendor/Cocos2D/include/ccShader_PositionTextureA8Color_vert.h +21 -0
- data/vendor/Cocos2D/include/ccShader_PositionTextureColorAlphaTest_frag.h +23 -0
- data/vendor/Cocos2D/include/ccShader_PositionTextureColor_frag.h +14 -0
- data/vendor/Cocos2D/include/ccShader_PositionTextureColor_vert.h +22 -0
- data/vendor/Cocos2D/include/ccShader_PositionTexture_frag.h +13 -0
- data/vendor/Cocos2D/include/ccShader_PositionTexture_uColor_frag.h +16 -0
- data/vendor/Cocos2D/include/ccShader_PositionTexture_uColor_vert.h +18 -0
- data/vendor/Cocos2D/include/ccShader_PositionTexture_vert.h +17 -0
- data/vendor/Cocos2D/include/ccShader_Position_uColor_frag.h +12 -0
- data/vendor/Cocos2D/include/ccShader_Position_uColor_vert.h +19 -0
- data/vendor/Cocos2D/include/ccShaders.h +45 -0
- data/vendor/Cocos2D/include/ccTypes.h +374 -0
- data/vendor/Cocos2D/include/ccUtils.h +36 -0
- data/vendor/Cocos2D/include/cocos2d.h +178 -0
- data/vendor/Cocos2D/include/kazmath/GL/mat4stack.h +51 -0
- data/vendor/Cocos2D/include/kazmath/GL/matrix.h +58 -0
- data/vendor/Cocos2D/include/kazmath/aabb.h +53 -0
- data/vendor/Cocos2D/include/kazmath/kazmath.h +39 -0
- data/vendor/Cocos2D/include/kazmath/mat3.h +75 -0
- data/vendor/Cocos2D/include/kazmath/mat4.h +93 -0
- data/vendor/Cocos2D/include/kazmath/neon_matrix_impl.h +41 -0
- data/vendor/Cocos2D/include/kazmath/plane.h +70 -0
- data/vendor/Cocos2D/include/kazmath/quaternion.h +113 -0
- data/vendor/Cocos2D/include/kazmath/ray2.h +50 -0
- data/vendor/Cocos2D/include/kazmath/utility.h +74 -0
- data/vendor/Cocos2D/include/kazmath/vec2.h +64 -0
- data/vendor/Cocos2D/include/kazmath/vec3.h +68 -0
- data/vendor/Cocos2D/include/kazmath/vec4.h +68 -0
- data/vendor/Cocos2D/include/uthash.h +972 -0
- data/vendor/Cocos2D/include/utlist.h +490 -0
- data/vendor/Cocos2D/libCocosDenshion.a +0 -0
- data/vendor/Cocos2D/libcocos2d.a +0 -0
- metadata +277 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2009 Sindesso Pty Ltd http://www.sindesso.com/
|
|
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 "CCActionGrid3D.h"
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* This action simulates a page turn from the bottom right hand corner of the screen
|
|
31
|
+
* It's not much use by itself but is used by the PageTurnTransition.
|
|
32
|
+
*
|
|
33
|
+
* Based on an original paper by L Hong et al.
|
|
34
|
+
* http://www.parc.com/publication/1638/turning-pages-of-3d-electronic-books.html
|
|
35
|
+
*
|
|
36
|
+
* @since v0.8.2
|
|
37
|
+
*/
|
|
38
|
+
@interface CCPageTurn3D : CCGrid3DAction
|
|
39
|
+
{
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2010 Lam Pham
|
|
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 <Foundation/Foundation.h>
|
|
28
|
+
#import "CCProgressTimer.h"
|
|
29
|
+
#import "CCActionInterval.h"
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
Progress to percentage
|
|
33
|
+
@since v0.99.1
|
|
34
|
+
*/
|
|
35
|
+
@interface CCProgressTo : CCActionInterval <NSCopying>
|
|
36
|
+
{
|
|
37
|
+
float to_;
|
|
38
|
+
float from_;
|
|
39
|
+
}
|
|
40
|
+
/** Creates and initializes with a duration and a percent */
|
|
41
|
+
+(id) actionWithDuration:(ccTime)duration percent:(float)percent;
|
|
42
|
+
/** Initializes with a duration and a percent */
|
|
43
|
+
-(id) initWithDuration:(ccTime)duration percent:(float)percent;
|
|
44
|
+
@end
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
Progress from a percentage to another percentage
|
|
48
|
+
@since v0.99.1
|
|
49
|
+
*/
|
|
50
|
+
@interface CCProgressFromTo : CCActionInterval <NSCopying>
|
|
51
|
+
{
|
|
52
|
+
float to_;
|
|
53
|
+
float from_;
|
|
54
|
+
}
|
|
55
|
+
/** Creates and initializes the action with a duration, a "from" percentage and a "to" percentage */
|
|
56
|
+
+(id) actionWithDuration:(ccTime)duration from:(float)fromPercentage to:(float) toPercentage;
|
|
57
|
+
/** Initializes the action with a duration, a "from" percentage and a "to" percentage */
|
|
58
|
+
-(id) initWithDuration:(ccTime)duration from:(float)fromPercentage to:(float) toPercentage;
|
|
59
|
+
@end
|
|
@@ -0,0 +1,211 @@
|
|
|
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
|
+
#import "CCActionGrid.h"
|
|
27
|
+
|
|
28
|
+
/** CCShakyTiles3D action */
|
|
29
|
+
@interface CCShakyTiles3D : CCTiledGrid3DAction
|
|
30
|
+
{
|
|
31
|
+
int randrange;
|
|
32
|
+
BOOL shakeZ;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** creates the action with a range, whether or not to shake Z vertices, a grid size, and duration */
|
|
36
|
+
+(id)actionWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(ccGridSize)gridSize duration:(ccTime)d;
|
|
37
|
+
/** initializes the action with a range, whether or not to shake Z vertices, a grid size, and duration */
|
|
38
|
+
-(id)initWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(ccGridSize)gridSize duration:(ccTime)d;
|
|
39
|
+
|
|
40
|
+
@end
|
|
41
|
+
|
|
42
|
+
////////////////////////////////////////////////////////////
|
|
43
|
+
|
|
44
|
+
/** CCShatteredTiles3D action */
|
|
45
|
+
@interface CCShatteredTiles3D : CCTiledGrid3DAction
|
|
46
|
+
{
|
|
47
|
+
int randrange;
|
|
48
|
+
BOOL once;
|
|
49
|
+
BOOL shatterZ;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** creates the action with a range, whether of not to shatter Z vertices, a grid size and duration */
|
|
53
|
+
+(id)actionWithRange:(int)range shatterZ:(BOOL)shatterZ grid:(ccGridSize)gridSize duration:(ccTime)d;
|
|
54
|
+
/** initializes the action with a range, whether or not to shatter Z vertices, a grid size and duration */
|
|
55
|
+
-(id)initWithRange:(int)range shatterZ:(BOOL)shatterZ grid:(ccGridSize)gridSize duration:(ccTime)d;
|
|
56
|
+
|
|
57
|
+
@end
|
|
58
|
+
|
|
59
|
+
////////////////////////////////////////////////////////////
|
|
60
|
+
|
|
61
|
+
/** CCShuffleTiles action
|
|
62
|
+
Shuffle the tiles in random order
|
|
63
|
+
*/
|
|
64
|
+
@interface CCShuffleTiles : CCTiledGrid3DAction
|
|
65
|
+
{
|
|
66
|
+
int seed;
|
|
67
|
+
NSUInteger tilesCount;
|
|
68
|
+
int *tilesOrder;
|
|
69
|
+
void *tiles;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** creates the action with a random seed, the grid size and the duration */
|
|
73
|
+
+(id)actionWithSeed:(int)s grid:(ccGridSize)gridSize duration:(ccTime)d;
|
|
74
|
+
/** initializes the action with a random seed, the grid size and the duration */
|
|
75
|
+
-(id)initWithSeed:(int)s grid:(ccGridSize)gridSize duration:(ccTime)d;
|
|
76
|
+
|
|
77
|
+
@end
|
|
78
|
+
|
|
79
|
+
////////////////////////////////////////////////////////////
|
|
80
|
+
|
|
81
|
+
/** CCFadeOutTRTiles action
|
|
82
|
+
Fades out the tiles in a Top-Right direction
|
|
83
|
+
*/
|
|
84
|
+
@interface CCFadeOutTRTiles : CCTiledGrid3DAction
|
|
85
|
+
{
|
|
86
|
+
}
|
|
87
|
+
@end
|
|
88
|
+
|
|
89
|
+
////////////////////////////////////////////////////////////
|
|
90
|
+
|
|
91
|
+
/** CCFadeOutBLTiles action.
|
|
92
|
+
Fades out the tiles in a Bottom-Left direction
|
|
93
|
+
*/
|
|
94
|
+
@interface CCFadeOutBLTiles : CCFadeOutTRTiles
|
|
95
|
+
{
|
|
96
|
+
}
|
|
97
|
+
@end
|
|
98
|
+
|
|
99
|
+
////////////////////////////////////////////////////////////
|
|
100
|
+
|
|
101
|
+
/** CCFadeOutUpTiles action.
|
|
102
|
+
Fades out the tiles in upwards direction
|
|
103
|
+
*/
|
|
104
|
+
@interface CCFadeOutUpTiles : CCFadeOutTRTiles
|
|
105
|
+
{
|
|
106
|
+
}
|
|
107
|
+
@end
|
|
108
|
+
|
|
109
|
+
////////////////////////////////////////////////////////////
|
|
110
|
+
|
|
111
|
+
/** CCFadeOutDownTiles action.
|
|
112
|
+
Fades out the tiles in downwards direction
|
|
113
|
+
*/
|
|
114
|
+
@interface CCFadeOutDownTiles : CCFadeOutUpTiles
|
|
115
|
+
{
|
|
116
|
+
}
|
|
117
|
+
@end
|
|
118
|
+
|
|
119
|
+
////////////////////////////////////////////////////////////
|
|
120
|
+
|
|
121
|
+
/** CCTurnOffTiles action.
|
|
122
|
+
Turn off the files in random order
|
|
123
|
+
*/
|
|
124
|
+
@interface CCTurnOffTiles : CCTiledGrid3DAction
|
|
125
|
+
{
|
|
126
|
+
int seed;
|
|
127
|
+
NSUInteger tilesCount;
|
|
128
|
+
int *tilesOrder;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** creates the action with a random seed, the grid size and the duration */
|
|
132
|
+
+(id)actionWithSeed:(int)s grid:(ccGridSize)gridSize duration:(ccTime)d;
|
|
133
|
+
/** initializes the action with a random seed, the grid size and the duration */
|
|
134
|
+
-(id)initWithSeed:(int)s grid:(ccGridSize)gridSize duration:(ccTime)d;
|
|
135
|
+
@end
|
|
136
|
+
|
|
137
|
+
////////////////////////////////////////////////////////////
|
|
138
|
+
|
|
139
|
+
/** CCWavesTiles3D action. */
|
|
140
|
+
@interface CCWavesTiles3D : CCTiledGrid3DAction
|
|
141
|
+
{
|
|
142
|
+
int waves;
|
|
143
|
+
float amplitude;
|
|
144
|
+
float amplitudeRate;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** waves amplitude */
|
|
148
|
+
@property (nonatomic,readwrite) float amplitude;
|
|
149
|
+
/** waves amplitude rate */
|
|
150
|
+
@property (nonatomic,readwrite) float amplitudeRate;
|
|
151
|
+
|
|
152
|
+
/** creates the action with a number of waves, the waves amplitude, the grid size and the duration */
|
|
153
|
+
+(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d;
|
|
154
|
+
/** initializes the action with a number of waves, the waves amplitude, the grid size and the duration */
|
|
155
|
+
-(id)initWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d;
|
|
156
|
+
|
|
157
|
+
@end
|
|
158
|
+
|
|
159
|
+
////////////////////////////////////////////////////////////
|
|
160
|
+
|
|
161
|
+
/** CCJumpTiles3D action.
|
|
162
|
+
A sin function is executed to move the tiles across the Z axis
|
|
163
|
+
*/
|
|
164
|
+
@interface CCJumpTiles3D : CCTiledGrid3DAction
|
|
165
|
+
{
|
|
166
|
+
int jumps;
|
|
167
|
+
float amplitude;
|
|
168
|
+
float amplitudeRate;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** amplitude of the sin*/
|
|
172
|
+
@property (nonatomic,readwrite) float amplitude;
|
|
173
|
+
/** amplitude rate */
|
|
174
|
+
@property (nonatomic,readwrite) float amplitudeRate;
|
|
175
|
+
|
|
176
|
+
/** creates the action with the number of jumps, the sin amplitude, the grid size and the duration */
|
|
177
|
+
+(id)actionWithJumps:(int)j amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d;
|
|
178
|
+
/** initializes the action with the number of jumps, the sin amplitude, the grid size and the duration */
|
|
179
|
+
-(id)initWithJumps:(int)j amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d;
|
|
180
|
+
|
|
181
|
+
@end
|
|
182
|
+
|
|
183
|
+
////////////////////////////////////////////////////////////
|
|
184
|
+
|
|
185
|
+
/** CCSplitRows action */
|
|
186
|
+
@interface CCSplitRows : CCTiledGrid3DAction
|
|
187
|
+
{
|
|
188
|
+
int rows;
|
|
189
|
+
CGSize winSize;
|
|
190
|
+
}
|
|
191
|
+
/** creates the action with the number of rows to split and the duration */
|
|
192
|
+
+(id)actionWithRows:(int)rows duration:(ccTime)duration;
|
|
193
|
+
/** initializes the action with the number of rows to split and the duration */
|
|
194
|
+
-(id)initWithRows:(int)rows duration:(ccTime)duration;
|
|
195
|
+
|
|
196
|
+
@end
|
|
197
|
+
|
|
198
|
+
////////////////////////////////////////////////////////////
|
|
199
|
+
|
|
200
|
+
/** CCSplitCols action */
|
|
201
|
+
@interface CCSplitCols : CCTiledGrid3DAction
|
|
202
|
+
{
|
|
203
|
+
int cols;
|
|
204
|
+
CGSize winSize;
|
|
205
|
+
}
|
|
206
|
+
/** creates the action with the number of columns to split and the duration */
|
|
207
|
+
+(id)actionWithCols:(int)cols duration:(ccTime)duration;
|
|
208
|
+
/** initializes the action with the number of columns to split and the duration */
|
|
209
|
+
-(id)initWithCols:(int)cols duration:(ccTime)duration;
|
|
210
|
+
|
|
211
|
+
@end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2009 lhunath (Maarten Billemont)
|
|
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 <Foundation/Foundation.h>
|
|
28
|
+
#import "CCActionInterval.h"
|
|
29
|
+
|
|
30
|
+
/** CCActionTween
|
|
31
|
+
|
|
32
|
+
CCActionTween is an action that lets you update any property of an object.
|
|
33
|
+
For example, if you want to modify the "width" property of a target from 200 to 300 in 2 seconds, then:
|
|
34
|
+
|
|
35
|
+
id modifyWidth = [CCActionTween actionWithDuration:2 key:@"width" from:200 to:300];
|
|
36
|
+
[target runAction:modifyWidth];
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
Another example: CCScaleTo action could be rewriten using CCPropertyAction:
|
|
40
|
+
|
|
41
|
+
// scaleA and scaleB are equivalents
|
|
42
|
+
id scaleA = [CCScaleTo actionWithDuration:2 scale:3];
|
|
43
|
+
id scaleB = [CCActionTween actionWithDuration:2 key:@"scale" from:1 to:3];
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@since v0.99.2
|
|
47
|
+
*/
|
|
48
|
+
@interface CCActionTween : CCActionInterval
|
|
49
|
+
{
|
|
50
|
+
NSString *key_;
|
|
51
|
+
|
|
52
|
+
float from_, to_;
|
|
53
|
+
float delta_;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** creates an initializes the action with the property name (key), and the from and to parameters. */
|
|
57
|
+
+ (id)actionWithDuration:(ccTime)aDuration key:(NSString *)key from:(float)from to:(float)to;
|
|
58
|
+
|
|
59
|
+
/** initializes the action with the property name (key), and the from and to parameters. */
|
|
60
|
+
- (id)initWithDuration:(ccTime)aDuration key:(NSString *)key from:(float)from to:(float)to;
|
|
61
|
+
|
|
62
|
+
@end
|
|
@@ -0,0 +1,150 @@
|
|
|
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
|
+
#import <Foundation/Foundation.h>
|
|
28
|
+
#ifdef __CC_PLATFORM_IOS
|
|
29
|
+
#import <CoreGraphics/CoreGraphics.h>
|
|
30
|
+
#endif // IPHONE
|
|
31
|
+
|
|
32
|
+
@class CCSpriteFrame;
|
|
33
|
+
@class CCTexture2D;
|
|
34
|
+
@class CCSpriteFrame;
|
|
35
|
+
|
|
36
|
+
/** CCAnimationFrame
|
|
37
|
+
A frame of the animation. It contains information like:
|
|
38
|
+
- sprite frame name
|
|
39
|
+
- # of delay units.
|
|
40
|
+
- offset
|
|
41
|
+
|
|
42
|
+
@since v2.0
|
|
43
|
+
*/
|
|
44
|
+
@interface CCAnimationFrame : NSObject <NSCopying>
|
|
45
|
+
{
|
|
46
|
+
CCSpriteFrame* spriteFrame_;
|
|
47
|
+
float delayUnits_;
|
|
48
|
+
NSDictionary *userInfo_;
|
|
49
|
+
}
|
|
50
|
+
/** CCSpriteFrameName to be used */
|
|
51
|
+
@property (nonatomic, readwrite, retain) CCSpriteFrame* spriteFrame;
|
|
52
|
+
|
|
53
|
+
/** how many units of time the frame takes */
|
|
54
|
+
@property (nonatomic, readwrite) float delayUnits;
|
|
55
|
+
|
|
56
|
+
/** A CCAnimationFrameDisplayedNotification notification will be broadcasted when the frame is displayed with this dictionary as UserInfo. If UserInfo is nil, then no notification will be broadcasted. */
|
|
57
|
+
@property (nonatomic, readwrite, retain) NSDictionary *userInfo;
|
|
58
|
+
|
|
59
|
+
/** initializes the animation frame with a spriteframe, number of delay units and a notification user info */
|
|
60
|
+
-(id) initWithSpriteFrame:(CCSpriteFrame*)spriteFrame delayUnits:(float)delayUnits userInfo:(NSDictionary*)userInfo;
|
|
61
|
+
@end
|
|
62
|
+
|
|
63
|
+
/** A CCAnimation object is used to perform animations on the CCSprite objects.
|
|
64
|
+
|
|
65
|
+
The CCAnimation object contains CCAnimationFrame objects, and a possible delay between the frames.
|
|
66
|
+
You can animate a CCAnimation object by using the CCAnimate action. Example:
|
|
67
|
+
|
|
68
|
+
[sprite runAction:[CCAnimate actionWithAnimation:animation]];
|
|
69
|
+
|
|
70
|
+
*/
|
|
71
|
+
@interface CCAnimation : NSObject <NSCopying>
|
|
72
|
+
{
|
|
73
|
+
NSMutableArray *frames_;
|
|
74
|
+
float totalDelayUnits_;
|
|
75
|
+
float delayPerUnit_;
|
|
76
|
+
BOOL restoreOriginalFrame_;
|
|
77
|
+
NSUInteger loops_;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** total Delay units of the CCAnimation. */
|
|
81
|
+
@property (nonatomic, readonly) float totalDelayUnits;
|
|
82
|
+
/** Delay in seconds of the "delay unit" */
|
|
83
|
+
@property (nonatomic, readwrite) float delayPerUnit;
|
|
84
|
+
/** duration in seconds of the whole animation. It is the result of totalDelayUnits * delayPerUnit */
|
|
85
|
+
@property (nonatomic,readonly) float duration;
|
|
86
|
+
/** array of CCAnimationFrames */
|
|
87
|
+
@property (nonatomic,readwrite,retain) NSMutableArray *frames;
|
|
88
|
+
/** whether or not it shall restore the original frame when the animation finishes */
|
|
89
|
+
@property (nonatomic,readwrite) BOOL restoreOriginalFrame;
|
|
90
|
+
/** how many times the animation is going to loop. 0 means animation is not animated. 1, animation is executed one time, ... */
|
|
91
|
+
@property (nonatomic, readwrite) NSUInteger loops;
|
|
92
|
+
|
|
93
|
+
/** Creates an animation
|
|
94
|
+
@since v0.99.5
|
|
95
|
+
*/
|
|
96
|
+
+(id) animation;
|
|
97
|
+
|
|
98
|
+
/** Creates an animation with an array of CCSpriteFrame.
|
|
99
|
+
The frames will be created with one "delay unit".
|
|
100
|
+
@since v0.99.5
|
|
101
|
+
*/
|
|
102
|
+
+(id) animationWithSpriteFrames:(NSArray*)arrayOfSpriteFrameNames;
|
|
103
|
+
|
|
104
|
+
/* Creates an animation with an array of CCSpriteFrame and a delay between frames in seconds.
|
|
105
|
+
The frames will be added with one "delay unit".
|
|
106
|
+
@since v0.99.5
|
|
107
|
+
*/
|
|
108
|
+
+(id) animationWithSpriteFrames:(NSArray*)arrayOfSpriteFrameNames delay:(float)delay;
|
|
109
|
+
|
|
110
|
+
/* Creates an animation with an array of CCAnimationFrame, the delay per units in seconds and and how many times it should be executed.
|
|
111
|
+
@since v2.0
|
|
112
|
+
*/
|
|
113
|
+
+(id) animationWithAnimationFrames:(NSArray*)arrayOfAnimationFrames delayPerUnit:(float)delayPerUnit loops:(NSUInteger)loops;
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
/** Initializes a CCAnimation with an array of CCSpriteFrame.
|
|
117
|
+
The frames will be added with one "delay unit".
|
|
118
|
+
@since v0.99.5
|
|
119
|
+
*/
|
|
120
|
+
-(id) initWithSpriteFrames:(NSArray*)arrayOfSpriteFrameNames;
|
|
121
|
+
|
|
122
|
+
/** Initializes a CCAnimation with an array of CCSpriteFrames and a delay between frames in seconds.
|
|
123
|
+
The frames will be added with one "delay unit".
|
|
124
|
+
@since v0.99.5
|
|
125
|
+
*/
|
|
126
|
+
-(id) initWithSpriteFrames:(NSArray *)arrayOfSpriteFrameNames delay:(float)delay;
|
|
127
|
+
|
|
128
|
+
/* Initializes an animation with an array of CCAnimationFrame and the delay per units in seconds.
|
|
129
|
+
@since v2.0
|
|
130
|
+
*/
|
|
131
|
+
-(id) initWithAnimationFrames:(NSArray*)arrayOfAnimationFrames delayPerUnit:(float)delayPerUnit loops:(NSUInteger)loops;
|
|
132
|
+
|
|
133
|
+
/** Adds a CCSpriteFrame to a CCAnimation.
|
|
134
|
+
The frame will be added with one "delay unit".
|
|
135
|
+
*/
|
|
136
|
+
-(void) addSpriteFrame:(CCSpriteFrame*)frame;
|
|
137
|
+
|
|
138
|
+
/** Adds a frame with an image filename. Internally it will create a CCSpriteFrame and it will add it.
|
|
139
|
+
The frame will be added with one "delay unit".
|
|
140
|
+
Added to facilitate the migration from v0.8 to v0.9.
|
|
141
|
+
*/
|
|
142
|
+
-(void) addSpriteFrameWithFilename:(NSString*)filename;
|
|
143
|
+
|
|
144
|
+
/** Adds a frame with a texture and a rect. Internally it will create a CCSpriteFrame and it will add it.
|
|
145
|
+
The frame will be added with one "delay unit".
|
|
146
|
+
Added to facilitate the migration from v0.8 to v0.9.
|
|
147
|
+
*/
|
|
148
|
+
-(void) addSpriteFrameWithTexture:(CCTexture2D*)texture rect:(CGRect)rect;
|
|
149
|
+
|
|
150
|
+
@end
|