joybox 0.0.5 → 0.0.6
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 +8 -8
- data/Gemfile.lock +1 -1
- data/LICENSE +1 -1
- data/LICENSE_Box2D +20 -0
- data/LICENSE_Cocos2D +24 -0
- data/README.md +34 -66
- data/Rakefile +2 -3
- data/bin/joybox +49 -0
- data/command/joybox/USAGE +24 -0
- data/command/joybox/templates/layer.erb +11 -0
- data/command/joybox/templates/layer_spec.erb +3 -0
- data/command/joybox/templates/scene.erb +11 -0
- data/command/joybox/templates/scene_spec.erb +3 -0
- data/command/joybox/templates/sprite.erb +11 -0
- data/command/joybox/templates/sprite_spec.erb +3 -0
- data/command/joybox_generate_command.rb +114 -0
- data/joybox.gemspec +44 -0
- data/lib/joybox/joybox-ios.rb +47 -0
- data/lib/joybox/joybox-osx.rb +47 -0
- data/lib/joybox/version.rb +1 -1
- data/lib/joybox.rb +18 -36
- data/{lib/joybox/cocos2d → motion/joybox}/actions/actions.rb +0 -0
- data/motion/joybox/actions/animate.rb +22 -0
- data/motion/joybox/actions/bezier.rb +33 -0
- data/motion/joybox/actions/blink.rb +24 -0
- data/motion/joybox/actions/ease.rb +149 -0
- data/motion/joybox/actions/fade.rb +38 -0
- data/motion/joybox/actions/jump.rb +39 -0
- data/{lib/joybox/cocos2d → motion/joybox}/actions/move.rb +4 -2
- data/motion/joybox/actions/place.rb +22 -0
- data/{lib/joybox/cocos2d → motion/joybox}/actions/repeat.rb +10 -1
- data/{lib/joybox/cocos2d → motion/joybox}/actions/rotate.rb +4 -2
- data/{lib/joybox/cocos2d → motion/joybox}/actions/scale.rb +4 -2
- data/{lib/joybox/cocos2d → motion/joybox}/actions/sequence.rb +3 -3
- data/{lib/joybox/cocos2d → motion/joybox}/actions/skew.rb +0 -0
- data/motion/joybox/actions/spawn.rb +22 -0
- data/motion/joybox/actions/tint.rb +37 -0
- data/motion/joybox/animations/animation.rb +60 -0
- data/{lib/joybox/cocos2d → motion/joybox}/common/color.rb +12 -1
- data/{lib/joybox/cocos2d → motion/joybox}/common/gc_size.rb +4 -4
- data/{lib/joybox/cocos2d → motion/joybox}/common/ns_set.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox}/common/numeric.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox}/common/screen.rb +4 -4
- data/motion/joybox/core/layer.rb +51 -0
- data/{lib/joybox/cocos2d → motion/joybox}/core/node.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox}/core/scene.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox}/core/sprite.rb +22 -3
- data/{lib/joybox/cocos2d → motion/joybox}/core/sprite_batch.rb +0 -0
- data/motion/joybox/core/sprite_frame_cache.rb +147 -0
- data/{lib/joybox/cocos2d/cocos2d.rb → motion/joybox/joybox.rb} +3 -1
- data/{lib/joybox/cocos2d → motion/joybox}/macros.rb +0 -0
- data/{lib/joybox/box2d → motion/joybox/physics}/body.rb +44 -17
- data/{lib/joybox/cocos2d/core → motion/joybox/physics}/physics_sprite.rb +1 -1
- data/motion/joybox/physics/world.rb +79 -0
- data/{lib/joybox/cocos2d → motion/joybox}/ui/label.rb +3 -2
- data/{lib/joybox/cocos2d → motion/joybox}/ui/menu.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox}/ui/menu_image.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox}/ui/menu_label.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox}/ui/ui.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox-ios}/common/cg_point.rb +9 -2
- data/{lib/joybox/cocos2d → motion/joybox-ios}/common/ui_touch.rb +1 -1
- data/{lib/joybox/cocos2d → motion/joybox-ios}/configuration/configuration.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox-ios}/configuration/file_utils.rb +0 -3
- data/{lib/joybox/cocos2d → motion/joybox-ios}/configuration/gl_view.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox-ios}/configuration/texture_2d.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox-ios}/core/layer.rb +1 -45
- data/{lib/joybox/cocos2d → motion/joybox-ios}/director.rb +6 -6
- data/motion/joybox-osx/common/ats_point.rb +48 -0
- data/motion/joybox-osx/common/ns_event.rb +8 -0
- data/motion/joybox-osx/configuration/configuration.rb +46 -0
- data/motion/joybox-osx/configuration/gl_view.rb +57 -0
- data/motion/joybox-osx/core/layer.rb +135 -0
- data/motion/joybox-osx/director.rb +42 -0
- data/template/joybox-ios/files/Rakefile.erb +9 -0
- data/{app → template/joybox-ios/files/app}/app_delegate.rb +1 -5
- data/{resources → template/joybox-ios/files/resources}/fps_images-hd.png +0 -0
- data/{resources → template/joybox-ios/files/resources}/fps_images-ipadhd.png +0 -0
- data/{resources → template/joybox-ios/files/resources}/fps_images.png +0 -0
- data/template/joybox-ios/files/spec/main_spec.rb.erb +9 -0
- data/template/joybox-osx/files/Rakefile.erb +9 -0
- data/template/joybox-osx/files/app/app_delegate.rb +23 -0
- data/template/joybox-osx/files/app/layers/default_layer.rb +5 -0
- data/template/joybox-osx/files/app/menu.rb +51 -0
- data/template/joybox-osx/files/resources/Credits.rtf +29 -0
- data/template/joybox-osx/files/resources/fps_images-hd.png +0 -0
- data/template/joybox-osx/files/resources/fps_images-ipadhd.png +0 -0
- data/template/joybox-osx/files/resources/fps_images.png +0 -0
- data/template/joybox-osx/files/spec/main_spec.rb.erb +9 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Box2D +0 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Box2D.framework.bridgesupport +47 -37
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Box2D +0 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Collision/B2DContactListener.h +0 -0
- data/vendor/vendor-ios/Box2D.framework/Versions/A/Headers/Collision/Shapes/B2DCircleShape.h +16 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Collision/Shapes/B2DEdgeShape.h +0 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Collision/Shapes/B2DPolygonShape.h +0 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Collision/Shapes/B2DShape.h +0 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Dynamics/B2DBody.h +6 -6
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Dynamics/B2DWorld.h +0 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Resources/Box2DConfig.cmake +0 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Resources/CMakeLists.txt +0 -0
- data/vendor/vendor-ios/Box2D.framework/Versions/A/Resources/LICENSE +22 -0
- data/vendor/vendor-ios/cocos_2d/cocos_2d.bridgesupport +9154 -0
- data/vendor/vendor-ios/cocos_2d/cocos_2d_exceptions.bridgesupport +39 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCAction.h +23 -23
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionCamera.h +21 -19
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionCatmullRom.h +18 -6
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionEase.h +117 -31
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionGrid.h +19 -17
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionGrid3D.h +45 -42
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionInstant.h +21 -13
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionInterval.h +123 -81
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionManager.h +2 -2
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionPageTurn3D.h +2 -1
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionProgressTimer.h +4 -4
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionTiledGrid.h +46 -38
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionTween.h +3 -3
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCAnimation.h +8 -8
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCAnimationCache.h +2 -2
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCAtlasNode.h +19 -17
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCCamera.h +12 -12
- data/vendor/vendor-ios/cocos_2d/include/CCClippingNode.h +77 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCConfiguration.h +31 -13
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCDirector.h +51 -42
- data/vendor/vendor-ios/cocos_2d/include/CCDrawNode.h +65 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCDrawingPrimitives.h +42 -8
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCGLProgram.h +56 -21
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCGrabber.h +2 -2
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCGrid.h +29 -29
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCLabelAtlas.h +5 -2
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCLabelBMFont.h +56 -32
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCLabelTTF.h +20 -20
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCLayer.h +107 -79
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCMenu.h +10 -14
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCMenuItem.h +37 -32
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCMotionStreak.h +18 -19
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCNode+Debug.h +0 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCNode.h +87 -37
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParallaxNode.h +2 -2
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParticleBatchNode.h +2 -2
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParticleExamples.h +22 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParticleSystem.h +51 -40
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParticleSystemQuad.h +4 -4
- data/vendor/vendor-ios/cocos_2d/include/CCPhysicsDebugNode.h +58 -0
- data/vendor/vendor-ios/cocos_2d/include/CCPhysicsSprite.h +82 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCProgressTimer.h +9 -11
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCProtocols.h +54 -26
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCRenderTexture.h +29 -9
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCScene.h +4 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCScheduler.h +94 -40
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCShaderCache.h +1 -1
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCSprite.h +21 -28
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCSpriteBatchNode.h +16 -9
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCSpriteFrame.h +10 -10
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCSpriteFrameCache.h +6 -6
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTMXLayer.h +16 -16
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTMXObjectGroup.h +4 -4
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTMXTiledMap.h +9 -9
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTMXXMLParser.h +44 -33
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTexture2D.h +17 -25
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTextureAtlas.h +10 -10
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTextureCache.h +4 -4
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTexturePVR.h +25 -8
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTileMapAtlas.h +6 -6
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTransition.h +57 -12
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTransitionPageTurn.h +2 -2
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTransitionProgress.h +27 -5
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms}/CCGL.h +4 -2
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms}/CCNS.h +0 -0
- data/vendor/vendor-ios/cocos_2d/include/Platforms/Mac/CCDirectorMac.h +110 -0
- data/vendor/vendor-ios/cocos_2d/include/Platforms/Mac/CCEventDispatcher.h +343 -0
- data/vendor/vendor-ios/cocos_2d/include/Platforms/Mac/CCGLView.h +103 -0
- data/vendor/vendor-ios/cocos_2d/include/Platforms/Mac/CCWindow.h +41 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCDirectorIOS.h +12 -5
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCES2Renderer.h +12 -12
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCESRenderer.h +0 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCGLView.h +28 -13
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCTouchDelegateProtocol.h +4 -4
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCTouchDispatcher.h +2 -2
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCTouchHandler.h +7 -7
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/CCArray.h +1 -1
- data/vendor/vendor-ios/cocos_2d/include/Support/CCFileUtils.h +394 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/CCProfiling.h +0 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/CCVertex.h +1 -1
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/CGPointExtension.h +4 -2
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/NSThread+performBlock.h +0 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/OpenGL_Internal.h +0 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/TGAlib.h +0 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/TransformUtils.h +0 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/ZipUtils.h +4 -4
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/base64.h +0 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/ccCArray.h +15 -15
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/ccUtils.h +0 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/uthash.h +129 -184
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/utlist.h +298 -55
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccConfig.h +56 -9
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccDeprecated.h +131 -0
- data/vendor/vendor-ios/cocos_2d/include/ccFPSImages.h +39 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccGLStateCache.h +44 -26
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccMacros.h +9 -9
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionColorLengthTexture_frag.h +41 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionColorLengthTexture_vert.h +47 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionColor_frag.h +37 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionColor_vert.h +40 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureA8Color_frag.h +41 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureA8Color_vert.h +45 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureColorAlphaTest_frag.h +47 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureColor_frag.h +39 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureColor_vert.h +45 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTexture_frag.h +38 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTexture_uColor_frag.h +41 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTexture_uColor_vert.h +41 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTexture_vert.h +41 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_Position_uColor_frag.h +37 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_Position_uColor_vert.h +43 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccShaders.h +11 -0
- data/vendor/vendor-ios/cocos_2d/include/ccTypes.h +392 -0
- data/vendor/vendor-ios/cocos_2d/include/cocos2d-ios-exceptions.bridgesupport +39 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/cocos2d.h +28 -3
- data/vendor/vendor-ios/cocos_2d/include/gen_cocos2d_bridgesupport.sh +17 -0
- data/vendor/vendor-ios/cocos_2d/include/gen_cocos2d_complement.sh +17 -0
- data/vendor/vendor-ios/cocos_2d/libcocos2d.a +0 -0
- data/vendor/vendor-osx/box_2d/box_2d.bridgesupport +176 -0
- data/vendor/vendor-osx/box_2d/include/B2DBody.h +46 -0
- data/vendor/vendor-osx/box_2d/include/B2DCircleShape.h +16 -0
- data/vendor/vendor-osx/box_2d/include/B2DContactListener.h +30 -0
- data/vendor/vendor-osx/box_2d/include/B2DEdgeShape.h +17 -0
- data/vendor/vendor-osx/box_2d/include/B2DPolygonShape.h +16 -0
- data/vendor/vendor-osx/box_2d/include/B2DShape.h +18 -0
- data/vendor/vendor-osx/box_2d/include/B2DWorld.h +44 -0
- data/vendor/vendor-osx/box_2d/libBox2D.a +0 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d.bridgesupport +8292 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCAction.h +195 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionCamera.h +75 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionCatmullRom.h +151 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionEase.h +245 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionGrid.h +167 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionGrid3D.h +208 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionInstant.h +235 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionInterval.h +473 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionManager.h +113 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionPageTurn3D.h +43 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionProgressTimer.h +59 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionTiledGrid.h +219 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionTween.h +62 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCAnimation.h +150 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCAnimationCache.h +74 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCAtlasNode.h +98 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCCamera.h +98 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCClippingNode.h +77 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCConfiguration.h +144 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCDirector.h +353 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCDrawNode.h +65 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCDrawingPrimitives.h +173 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCGLProgram.h +185 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCGrabber.h +44 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCGrid.h +130 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLabelAtlas.h +71 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLabelBMFont.h +240 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLabelTTF.h +132 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLayer.h +308 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCMenu.h +96 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCMenuItem.h +428 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCMotionStreak.h +86 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCNode+Debug.h +39 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCNode.h +619 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParallaxNode.h +50 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParticleBatchNode.h +99 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParticleExamples.h +117 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParticleSystem.h +464 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParticleSystemQuad.h +73 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCPhysicsDebugNode.h +58 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCPhysicsSprite.h +82 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCProgressTimer.h +92 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCProtocols.h +160 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCRenderTexture.h +159 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCScene.h +47 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCScheduler.h +284 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCShaderCache.h +60 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCSprite.h +281 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCSpriteBatchNode.h +145 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCSpriteFrame.h +126 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCSpriteFrameCache.h +121 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXLayer.h +164 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXObjectGroup.h +67 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXTiledMap.h +145 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXXMLParser.h +228 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTexture2D.h +349 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTextureAtlas.h +188 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTextureCache.h +146 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTexturePVR.h +146 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTileMapAtlas.h +83 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTransition.h +341 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTransitionPageTurn.h +60 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTransitionProgress.h +84 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/CCGL.h +74 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/CCNS.h +54 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/Mac/CCDirectorMac.h +110 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/Mac/CCEventDispatcher.h +343 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/Mac/CCGLView.h +103 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/Mac/CCWindow.h +41 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CCArray.h +119 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CCFileUtils.h +394 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CCProfiling.h +89 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CCVertex.h +36 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CGPointExtension.h +346 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/NSThread+performBlock.h +22 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/OpenGL_Internal.h +86 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/TGAlib.h +55 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/TransformUtils.h +36 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/ZipUtils.h +91 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/base64.h +33 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/ccCArray.h +229 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/ccUtils.h +36 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/uthash.h +917 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/utlist.h +733 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccConfig.h +292 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccDeprecated.h +431 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccFPSImages.h +39 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccGLStateCache.h +156 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccMacros.h +353 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionColorLengthTexture_frag.h +41 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionColorLengthTexture_vert.h +47 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionColor_frag.h +37 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionColor_vert.h +40 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureA8Color_frag.h +41 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureA8Color_vert.h +45 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureColorAlphaTest_frag.h +47 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureColor_frag.h +39 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureColor_vert.h +45 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTexture_frag.h +38 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTexture_uColor_frag.h +41 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTexture_uColor_vert.h +41 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTexture_vert.h +41 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_Position_uColor_frag.h +37 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_Position_uColor_vert.h +43 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShaders.h +56 -0
- data/vendor/{Cocos2D/include → vendor-osx/cocos_2d/cocos_2d_include}/ccTypes.h +39 -35
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/cocos2d.h +203 -0
- data/vendor/vendor-osx/cocos_2d/libcocos2d.a +0 -0
- metadata +363 -195
- data/app/layers/box2d_layer.rb +0 -109
- data/app/layers/cocos2d_layer.rb +0 -14
- data/app/layers/cocos_motion_layer.rb +0 -145
- data/app/layers/menu_layer.rb +0 -59
- data/lib/joybox/box2d/world.rb +0 -79
- 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/vendor/Cocos2D/Cocos2D.bridgesupport +0 -7808
- data/vendor/Cocos2D/include/CCFileUtils.h +0 -188
- data/vendor/Cocos2D/include/CocosDenshion/CDAudioManager.h +0 -243
- data/vendor/Cocos2D/include/CocosDenshion/CDConfig.h +0 -60
- data/vendor/Cocos2D/include/CocosDenshion/CDOpenALSupport.h +0 -77
- data/vendor/Cocos2D/include/CocosDenshion/CDXPropertyModifierAction.h +0 -45
- data/vendor/Cocos2D/include/CocosDenshion/CocosDenshion.h +0 -440
- data/vendor/Cocos2D/include/CocosDenshion/SimpleAudioEngine.h +0 -90
- data/vendor/Cocos2D/include/RubyMotionSchedule.h +0 -7
- data/vendor/Cocos2D/include/ccShader_PositionColor_frag.h +0 -12
- data/vendor/Cocos2D/include/ccShader_PositionColor_vert.h +0 -17
- data/vendor/Cocos2D/include/ccShader_PositionTextureA8Color_frag.h +0 -16
- data/vendor/Cocos2D/include/ccShader_PositionTextureA8Color_vert.h +0 -21
- data/vendor/Cocos2D/include/ccShader_PositionTextureColorAlphaTest_frag.h +0 -23
- data/vendor/Cocos2D/include/ccShader_PositionTextureColor_frag.h +0 -14
- data/vendor/Cocos2D/include/ccShader_PositionTextureColor_vert.h +0 -22
- data/vendor/Cocos2D/include/ccShader_PositionTexture_frag.h +0 -13
- data/vendor/Cocos2D/include/ccShader_PositionTexture_uColor_frag.h +0 -16
- data/vendor/Cocos2D/include/ccShader_PositionTexture_uColor_vert.h +0 -18
- data/vendor/Cocos2D/include/ccShader_PositionTexture_vert.h +0 -17
- data/vendor/Cocos2D/include/ccShader_Position_uColor_frag.h +0 -12
- data/vendor/Cocos2D/include/ccShader_Position_uColor_vert.h +0 -19
- data/vendor/Cocos2D/include/kazmath/GL/mat4stack.h +0 -51
- data/vendor/Cocos2D/include/kazmath/GL/matrix.h +0 -58
- data/vendor/Cocos2D/include/kazmath/aabb.h +0 -53
- data/vendor/Cocos2D/include/kazmath/kazmath.h +0 -39
- data/vendor/Cocos2D/include/kazmath/mat3.h +0 -75
- data/vendor/Cocos2D/include/kazmath/mat4.h +0 -93
- data/vendor/Cocos2D/include/kazmath/neon_matrix_impl.h +0 -41
- data/vendor/Cocos2D/include/kazmath/plane.h +0 -70
- data/vendor/Cocos2D/include/kazmath/quaternion.h +0 -113
- data/vendor/Cocos2D/include/kazmath/ray2.h +0 -50
- data/vendor/Cocos2D/include/kazmath/utility.h +0 -74
- data/vendor/Cocos2D/include/kazmath/vec2.h +0 -64
- data/vendor/Cocos2D/include/kazmath/vec3.h +0 -68
- data/vendor/Cocos2D/include/kazmath/vec4.h +0 -68
- data/vendor/Cocos2D/libCocosDenshion.a +0 -0
- data/vendor/Cocos2D/libcocos2d.a +0 -0
@@ -3,6 +3,7 @@
|
|
3
3
|
*
|
4
4
|
* Copyright (c) 2008-2010 Ricardo Quesada
|
5
5
|
* Copyright (c) 2011 Zynga Inc.
|
6
|
+
* Copyright (c) 2013 Nader Eloshaiker
|
6
7
|
*
|
7
8
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
9
|
* of this software and associated documentation files (the "Software"), to deal
|
@@ -24,6 +25,17 @@
|
|
24
25
|
*/
|
25
26
|
|
26
27
|
|
28
|
+
/*
|
29
|
+
*
|
30
|
+
* IMPORTANT IMPORTANT IMPORTANT IMPORTANT
|
31
|
+
*
|
32
|
+
*
|
33
|
+
* LEGACY FUNCTIONS
|
34
|
+
*
|
35
|
+
* USE CCDrawNode instead
|
36
|
+
*
|
37
|
+
*/
|
38
|
+
|
27
39
|
#ifndef __CC_DRAWING_PRIMITIVES_H
|
28
40
|
#define __CC_DRAWING_PRIMITIVES_H
|
29
41
|
|
@@ -47,20 +59,33 @@ extern "C" {
|
|
47
59
|
/**
|
48
60
|
@file
|
49
61
|
Drawing OpenGL ES primitives.
|
50
|
-
- ccDrawPoint
|
62
|
+
- ccDrawPoint, ccDrawPoints
|
51
63
|
- ccDrawLine
|
52
|
-
-
|
53
|
-
-
|
64
|
+
- ccDrawRect, ccDrawSolidRect
|
65
|
+
- ccDrawPoly, ccDrawSolidPoly
|
66
|
+
- ccDrawCircle, ccDrawSolidCircle
|
67
|
+
- ccDrawArc, ccDrawSolidArc
|
54
68
|
- ccDrawQuadBezier
|
55
69
|
- ccDrawCubicBezier
|
70
|
+
- ccDrawCatmullRom
|
71
|
+
- ccDrawCardinalSpline
|
56
72
|
|
57
|
-
You can change the color,
|
58
|
-
|
73
|
+
You can change the color, point size, width by calling:
|
74
|
+
- ccDrawColor4B(), ccDrawColor4F()
|
75
|
+
- ccPointSize()
|
76
|
+
- glLineWidth()
|
59
77
|
|
60
|
-
@warning These functions draws the Line, Point, Polygon, immediately. They aren't batched. If you are going to make a game that depends on these primitives, I suggest creating a batch.
|
78
|
+
@warning These functions draws the Line, Point, Polygon, immediately. They aren't batched. If you are going to make a game that depends on these primitives, I suggest creating a batch. Instead you should use CCDrawNode
|
79
|
+
|
61
80
|
*/
|
62
81
|
|
63
82
|
|
83
|
+
/** Initializes the drawing primitives */
|
84
|
+
void ccDrawInit(void);
|
85
|
+
|
86
|
+
/** Frees allocated resources by the drawing primitives */
|
87
|
+
void ccDrawFree(void);
|
88
|
+
|
64
89
|
/** draws a point given x and y coordinate measured in points. */
|
65
90
|
void ccDrawPoint( CGPoint point );
|
66
91
|
|
@@ -80,18 +105,27 @@ void ccDrawRect( CGPoint origin, CGPoint destination );
|
|
80
105
|
*/
|
81
106
|
void ccDrawSolidRect( CGPoint origin, CGPoint destination, ccColor4F color );
|
82
107
|
|
83
|
-
/** draws a
|
108
|
+
/** draws a polygon given a pointer to CGPoint coordinates and the number of vertices measured in points.
|
84
109
|
The polygon can be closed or open
|
85
110
|
*/
|
86
111
|
void ccDrawPoly( const CGPoint *vertices, NSUInteger numOfVertices, BOOL closePolygon );
|
87
112
|
|
88
|
-
/** draws a solid polygon given a pointer to CGPoint
|
113
|
+
/** draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color.
|
89
114
|
*/
|
90
115
|
void ccDrawSolidPoly( const CGPoint *poli, NSUInteger numberOfPoints, ccColor4F color );
|
91
116
|
|
92
117
|
/** draws a circle given the center, radius and number of segments measured in points */
|
93
118
|
void ccDrawCircle( CGPoint center, float radius, float angle, NSUInteger segments, BOOL drawLineToCenter);
|
94
119
|
|
120
|
+
/** draws a solid circle given the center, radius and number of segments measured in points */
|
121
|
+
void ccDrawSolidCircle( CGPoint center, float radius, NSUInteger segments);
|
122
|
+
|
123
|
+
/** draws a arc given the center, radius, arc length and number of segments measured in points */
|
124
|
+
void ccDrawArc(CGPoint center, CGFloat r, CGFloat a, CGFloat arcLength, NSUInteger segs, BOOL drawLineToCenter);
|
125
|
+
|
126
|
+
/** draws a solid arc given the center, radius, arc length and number of segments measured in points */
|
127
|
+
void ccDrawSolidArc(CGPoint center, CGFloat r, CGFloat a, CGFloat arcLength, NSUInteger segs);
|
128
|
+
|
95
129
|
/** draws a quad bezier path measured in points.
|
96
130
|
@warning This function could be pretty slow. Use it only for debugging purposes.
|
97
131
|
@since v0.8
|
@@ -40,7 +40,13 @@ enum {
|
|
40
40
|
};
|
41
41
|
|
42
42
|
enum {
|
43
|
+
kCCUniformPMatrix,
|
44
|
+
kCCUniformMVMatrix,
|
43
45
|
kCCUniformMVPMatrix,
|
46
|
+
kCCUniformTime,
|
47
|
+
kCCUniformSinTime,
|
48
|
+
kCCUniformCosTime,
|
49
|
+
kCCUniformRandom01,
|
44
50
|
kCCUniformSampler,
|
45
51
|
|
46
52
|
kCCUniform_MAX,
|
@@ -53,11 +59,18 @@ enum {
|
|
53
59
|
#define kCCShader_PositionTexture_uColor @"ShaderPositionTexture_uColor"
|
54
60
|
#define kCCShader_PositionTextureA8Color @"ShaderPositionTextureA8Color"
|
55
61
|
#define kCCShader_Position_uColor @"ShaderPosition_uColor"
|
62
|
+
#define kCCShader_PositionLengthTexureColor @"ShaderPositionLengthTextureColor"
|
56
63
|
|
57
64
|
// uniform names
|
58
|
-
#define
|
59
|
-
#define
|
60
|
-
#define
|
65
|
+
#define kCCUniformPMatrix_s "CC_PMatrix"
|
66
|
+
#define kCCUniformMVMatrix_s "CC_MVMatrix"
|
67
|
+
#define kCCUniformMVPMatrix_s "CC_MVPMatrix"
|
68
|
+
#define kCCUniformTime_s "CC_Time"
|
69
|
+
#define kCCUniformSinTime_s "CC_SinTime"
|
70
|
+
#define kCCUniformCosTime_s "CC_CosTime"
|
71
|
+
#define kCCUniformRandom01_s "CC_Random01"
|
72
|
+
#define kCCUniformSampler_s "CC_Texture0"
|
73
|
+
#define kCCUniformAlphaTestValue_s "CC_AlphaValue"
|
61
74
|
|
62
75
|
// Attribute names
|
63
76
|
#define kCCAttributeNameColor @"a_color"
|
@@ -75,16 +88,31 @@ struct _hashUniformEntry;
|
|
75
88
|
*/
|
76
89
|
@interface CCGLProgram : NSObject
|
77
90
|
{
|
78
|
-
struct _hashUniformEntry *
|
91
|
+
struct _hashUniformEntry *_hashForUniforms;
|
79
92
|
|
80
93
|
@public
|
81
|
-
GLuint
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
GLint
|
94
|
+
GLuint _program,
|
95
|
+
_vertShader,
|
96
|
+
_fragShader;
|
97
|
+
|
98
|
+
GLint _uniforms[kCCUniform_MAX];
|
99
|
+
|
100
|
+
struct {
|
101
|
+
unsigned int usesTime:1;
|
102
|
+
unsigned int usesMVP:1;
|
103
|
+
unsigned int usesMV:1;
|
104
|
+
unsigned int usesRandom:1;
|
105
|
+
} _flags;
|
86
106
|
}
|
87
107
|
|
108
|
+
@property(nonatomic, readonly) GLuint program;
|
109
|
+
|
110
|
+
/** creates the CCGLProgram with a vertex and fragment from byte arrays */
|
111
|
+
+ (id)programWithVertexShaderByteArray:(const GLchar*)vShaderByteArray fragmentShaderByteArray:(const GLchar*)fShaderByteArray;
|
112
|
+
|
113
|
+
/** creates the CCGLProgram with a vertex and fragment with contents of filenames */
|
114
|
+
+ (id)programWithVertexShaderFilename:(NSString *)vShaderFilename fragmentShaderFilename:(NSString *)fShaderFilename;
|
115
|
+
|
88
116
|
/** Initializes the CCGLProgram with a vertex and fragment with bytes array */
|
89
117
|
- (id)initWithVertexShaderByteArray:(const GLchar*)vShaderByteArray fragmentShaderByteArray:(const GLchar*)fShaderByteArray;
|
90
118
|
|
@@ -100,44 +128,51 @@ struct _hashUniformEntry;
|
|
100
128
|
/** it will call glUseProgram() */
|
101
129
|
- (void)use;
|
102
130
|
|
103
|
-
/** It will create
|
131
|
+
/** It will create 4 uniforms:
|
104
132
|
- kCCUniformPMatrix
|
105
133
|
- kCCUniformMVMatrix
|
134
|
+
- kCCUniformMVPMatrix
|
106
135
|
- kCCUniformSampler
|
107
136
|
|
108
137
|
And it will bind "kCCUniformSampler" to 0
|
109
138
|
*/
|
110
139
|
- (void) updateUniforms;
|
111
140
|
|
141
|
+
/** calls retrieves the named uniform location for this shader program. */
|
142
|
+
- (GLint)uniformLocationForName:(NSString*)name;
|
143
|
+
|
112
144
|
/** calls glUniform1i only if the values are different than the previous call for this same shader program. */
|
113
|
-
-(void) setUniformLocation:(
|
145
|
+
-(void) setUniformLocation:(GLint)location withI1:(GLint)i1;
|
114
146
|
|
115
147
|
/** calls glUniform1f only if the values are different than the previous call for this same shader program. */
|
116
|
-
-(void) setUniformLocation:(
|
148
|
+
-(void) setUniformLocation:(GLint)location withF1:(GLfloat)f1;
|
117
149
|
|
118
150
|
/** calls glUniform2f only if the values are different than the previous call for this same shader program. */
|
119
|
-
-(void) setUniformLocation:(
|
151
|
+
-(void) setUniformLocation:(GLint)location withF1:(GLfloat)f1 f2:(GLfloat)f2;
|
120
152
|
|
121
153
|
/** calls glUniform3f only if the values are different than the previous call for this same shader program. */
|
122
|
-
-(void) setUniformLocation:(
|
154
|
+
-(void) setUniformLocation:(GLint)location withF1:(GLfloat)f1 f2:(GLfloat)f2 f3:(GLfloat)f3;
|
123
155
|
|
124
156
|
/** calls glUniform4f only if the values are different than the previous call for this same shader program. */
|
125
|
-
-(void) setUniformLocation:(
|
157
|
+
-(void) setUniformLocation:(GLint)location withF1:(GLfloat)f1 f2:(GLfloat)f2 f3:(GLfloat)f3 f4:(GLfloat)f4;
|
126
158
|
|
127
159
|
/** calls glUniform2fv only if the values are different than the previous call for this same shader program. */
|
128
|
-
-(void) setUniformLocation:(
|
160
|
+
-(void) setUniformLocation:(GLint)location with2fv:(GLfloat*)floats count:(NSUInteger)numberOfArrays;
|
129
161
|
|
130
162
|
/** calls glUniform3fv only if the values are different than the previous call for this same shader program. */
|
131
|
-
-(void) setUniformLocation:(
|
163
|
+
-(void) setUniformLocation:(GLint)location with3fv:(GLfloat*)floats count:(NSUInteger)numberOfArrays;
|
132
164
|
|
133
165
|
/** calls glUniform4fv only if the values are different than the previous call for this same shader program. */
|
134
|
-
-(void) setUniformLocation:(
|
166
|
+
-(void) setUniformLocation:(GLint)location with4fv:(GLvoid*)floats count:(NSUInteger)numberOfArrays;
|
135
167
|
|
136
168
|
/** calls glUniformMatrix4fv only if the values are different than the previous call for this same shader program. */
|
137
|
-
-(void) setUniformLocation:(
|
169
|
+
-(void) setUniformLocation:(GLint)location withMatrix4fv:(GLvoid*)matrix_array count:(NSUInteger)numberOfMatrix;
|
170
|
+
|
171
|
+
/** will update the builtin uniforms if they are different than the previous call for this same shader program. */
|
172
|
+
-(void) setUniformsForBuiltins;
|
138
173
|
|
139
|
-
/**
|
140
|
-
-(void)
|
174
|
+
/** Deprecated alias for setUniformsForBuiltins */
|
175
|
+
-(void)setUniformForModelViewProjectionMatrix __attribute__((__deprecated__));
|
141
176
|
|
142
177
|
/** returns the vertexShader error log */
|
143
178
|
- (NSString *)vertexShaderLog;
|
@@ -40,25 +40,25 @@
|
|
40
40
|
*/
|
41
41
|
@interface CCGridBase : NSObject
|
42
42
|
{
|
43
|
-
BOOL
|
44
|
-
int
|
45
|
-
|
46
|
-
CCTexture2D *
|
47
|
-
CGPoint
|
48
|
-
CCGrabber *
|
49
|
-
BOOL
|
43
|
+
BOOL _active;
|
44
|
+
int _reuseGrid;
|
45
|
+
CGSize _gridSize;
|
46
|
+
CCTexture2D *_texture;
|
47
|
+
CGPoint _step;
|
48
|
+
CCGrabber *_grabber;
|
49
|
+
BOOL _isTextureFlipped;
|
50
50
|
|
51
|
-
CCGLProgram *
|
51
|
+
CCGLProgram *_shaderProgram;
|
52
52
|
|
53
|
-
ccDirectorProjection
|
53
|
+
ccDirectorProjection _directorProjection;
|
54
54
|
}
|
55
55
|
|
56
|
-
/**
|
56
|
+
/** whether or not the grid is active */
|
57
57
|
@property (nonatomic,readwrite) BOOL active;
|
58
58
|
/** number of times that the grid will be reused */
|
59
59
|
@property (nonatomic,readwrite) int reuseGrid;
|
60
60
|
/** size of the grid */
|
61
|
-
@property (nonatomic,readonly)
|
61
|
+
@property (nonatomic,readonly) CGSize gridSize;
|
62
62
|
/** pixels between the grids */
|
63
63
|
@property (nonatomic,readwrite) CGPoint step;
|
64
64
|
/** texture used */
|
@@ -70,11 +70,11 @@
|
|
70
70
|
/** shader program */
|
71
71
|
@property (nonatomic, readwrite, assign) CCGLProgram *shaderProgram;
|
72
72
|
|
73
|
-
+(id) gridWithSize:(
|
74
|
-
+(id) gridWithSize:(
|
73
|
+
+(id) gridWithSize:(CGSize)gridSize texture:(CCTexture2D*)texture flippedTexture:(BOOL)flipped;
|
74
|
+
+(id) gridWithSize:(CGSize)gridSize;
|
75
75
|
|
76
|
-
-(id) initWithSize:(
|
77
|
-
-(id)initWithSize:(
|
76
|
+
-(id) initWithSize:(CGSize)gridSize texture:(CCTexture2D*)texture flippedTexture:(BOOL)flipped;
|
77
|
+
-(id)initWithSize:(CGSize)gridSize;
|
78
78
|
-(void)beforeDraw;
|
79
79
|
-(void)afterDraw:(CCNode*)target;
|
80
80
|
-(void)blit;
|
@@ -91,18 +91,18 @@
|
|
91
91
|
*/
|
92
92
|
@interface CCGrid3D : CCGridBase
|
93
93
|
{
|
94
|
-
GLvoid *
|
95
|
-
GLvoid *
|
96
|
-
GLvoid *
|
97
|
-
GLushort *
|
94
|
+
GLvoid *_texCoordinates;
|
95
|
+
GLvoid *_vertices;
|
96
|
+
GLvoid *_originalVertices;
|
97
|
+
GLushort *_indices;
|
98
98
|
}
|
99
99
|
|
100
100
|
/** returns the vertex at a given position */
|
101
|
-
-(ccVertex3F)vertex:(
|
101
|
+
-(ccVertex3F)vertex:(CGPoint)pos;
|
102
102
|
/** returns the original (non-transformed) vertex at a given position */
|
103
|
-
-(ccVertex3F)originalVertex:(
|
103
|
+
-(ccVertex3F)originalVertex:(CGPoint)pos;
|
104
104
|
/** sets a new vertex at a given position */
|
105
|
-
-(void)setVertex:(
|
105
|
+
-(void)setVertex:(CGPoint)pos vertex:(ccVertex3F)vertex;
|
106
106
|
|
107
107
|
@end
|
108
108
|
|
@@ -114,17 +114,17 @@
|
|
114
114
|
*/
|
115
115
|
@interface CCTiledGrid3D : CCGridBase
|
116
116
|
{
|
117
|
-
GLvoid *
|
118
|
-
GLvoid *
|
119
|
-
GLvoid *
|
120
|
-
GLushort *
|
117
|
+
GLvoid *_texCoordinates;
|
118
|
+
GLvoid *_vertices;
|
119
|
+
GLvoid *_originalVertices;
|
120
|
+
GLushort *_indices;
|
121
121
|
}
|
122
122
|
|
123
123
|
/** returns the tile at the given position */
|
124
|
-
-(ccQuad3)tile:(
|
124
|
+
-(ccQuad3)tile:(CGPoint)pos;
|
125
125
|
/** returns the original tile (untransformed) at the given position */
|
126
|
-
-(ccQuad3)originalTile:(
|
126
|
+
-(ccQuad3)originalTile:(CGPoint)pos;
|
127
127
|
/** sets a new tile */
|
128
|
-
-(void)setTile:(
|
128
|
+
-(void)setTile:(CGPoint)pos coords:(ccQuad3)coords;
|
129
129
|
|
130
130
|
@end
|
@@ -42,10 +42,10 @@
|
|
42
42
|
@interface CCLabelAtlas : CCAtlasNode <CCLabelProtocol>
|
43
43
|
{
|
44
44
|
// string to render
|
45
|
-
NSString *
|
45
|
+
NSString *_string;
|
46
46
|
|
47
47
|
// the first char in the charmap
|
48
|
-
NSUInteger
|
48
|
+
NSUInteger _mapStartChar;
|
49
49
|
}
|
50
50
|
|
51
51
|
|
@@ -60,6 +60,9 @@
|
|
60
60
|
/** initializes the CCLabelAtlas with a string, a char map file(the atlas), the width and height in points of each element and the starting char of the atlas */
|
61
61
|
-(id) initWithString:(NSString*) string charMapFile: (NSString*) charmapfile itemWidth:(NSUInteger)w itemHeight:(NSUInteger)h startCharMap:(NSUInteger)firstElement;
|
62
62
|
|
63
|
+
/** initializes the CCLabelAtlas with a string, a texture, the width and height in points of each element and the starting char of the atlas */
|
64
|
+
-(id) initWithString:(NSString*) theString texture:(CCTexture2D*)texture itemWidth:(NSUInteger)w itemHeight:(NSUInteger)h startCharMap:(NSUInteger)c;
|
65
|
+
|
63
66
|
/** initializes the CCLabelAtlas with a string and a configuration file
|
64
67
|
@since v2.0
|
65
68
|
*/
|
@@ -40,8 +40,6 @@ enum {
|
|
40
40
|
kCCLabelAutomaticWidth = -1,
|
41
41
|
};
|
42
42
|
|
43
|
-
struct _KerningHashElement;
|
44
|
-
|
45
43
|
/** @struct ccBMFontDef
|
46
44
|
BMFont definition
|
47
45
|
*/
|
@@ -73,31 +71,53 @@ typedef struct _BMFontPadding {
|
|
73
71
|
int bottom;
|
74
72
|
} ccBMFontPadding;
|
75
73
|
|
74
|
+
#pragma mark - Hash Element
|
75
|
+
typedef struct _FontDefHashElement
|
76
|
+
{
|
77
|
+
NSUInteger key; // key. Font Unicode value
|
78
|
+
ccBMFontDef fontDef; // font definition
|
79
|
+
UT_hash_handle hh;
|
80
|
+
} tCCFontDefHashElement;
|
81
|
+
|
82
|
+
// Equal function for targetSet.
|
83
|
+
typedef struct _KerningHashElement
|
84
|
+
{
|
85
|
+
int key; // key for the hash. 16-bit for 1st element, 16-bit for 2nd element
|
86
|
+
int amount;
|
87
|
+
UT_hash_handle hh;
|
88
|
+
} tCCKerningHashElement;
|
89
|
+
#pragma mark -
|
76
90
|
|
77
91
|
/** CCBMFontConfiguration has parsed configuration of the the .fnt file
|
78
92
|
@since v0.8
|
79
93
|
*/
|
80
94
|
@interface CCBMFontConfiguration : NSObject
|
81
95
|
{
|
96
|
+
// Character Set defines the letters that actually exist in the font
|
97
|
+
NSCharacterSet *_characterSet;
|
98
|
+
|
82
99
|
// atlas name
|
83
|
-
NSString *
|
84
|
-
|
85
|
-
// XXX: Creating a public interface so that the bitmapFontArray[] is
|
100
|
+
NSString *_atlasName;
|
101
|
+
|
102
|
+
// XXX: Creating a public interface so that the bitmapFontArray[] is accessible
|
86
103
|
@public
|
87
|
-
|
104
|
+
|
88
105
|
// BMFont definitions
|
89
|
-
|
90
|
-
|
106
|
+
tCCFontDefHashElement *_fontDefDictionary;
|
107
|
+
|
91
108
|
// FNTConfig: Common Height. Should be signed (issue #1343)
|
92
|
-
NSInteger
|
93
|
-
|
109
|
+
NSInteger _commonHeight;
|
110
|
+
|
94
111
|
// Padding
|
95
|
-
ccBMFontPadding
|
96
|
-
|
112
|
+
ccBMFontPadding _padding;
|
113
|
+
|
97
114
|
// values for kerning
|
98
|
-
|
115
|
+
tCCKerningHashElement *_kerningDictionary;
|
99
116
|
}
|
100
117
|
|
118
|
+
// Character set
|
119
|
+
@property (nonatomic, retain, readonly) NSCharacterSet *characterSet;
|
120
|
+
|
101
121
|
// atlasName
|
102
122
|
@property (nonatomic, readwrite, retain) NSString *atlasName;
|
103
123
|
|
@@ -109,7 +129,7 @@ typedef struct _BMFontPadding {
|
|
109
129
|
|
110
130
|
|
111
131
|
/** CCLabelBMFont is a subclass of CCSpriteBatchNode
|
112
|
-
|
132
|
+
|
113
133
|
Features:
|
114
134
|
- Treats each character like a CCSprite. This means that each individual character can be:
|
115
135
|
- rotated
|
@@ -120,49 +140,53 @@ typedef struct _BMFontPadding {
|
|
120
140
|
- It can be used as part of a menu item.
|
121
141
|
- anchorPoint can be used to align the "label"
|
122
142
|
- Supports AngelCode text format
|
123
|
-
|
143
|
+
|
124
144
|
Limitations:
|
125
145
|
- All inner characters are using an anchorPoint of (0.5f, 0.5f) and it is not recommend to change it
|
126
146
|
because it might affect the rendering
|
127
|
-
|
147
|
+
|
128
148
|
CCLabelBMFont implements the protocol CCLabelProtocol, like CCLabel and CCLabelAtlas.
|
129
149
|
CCLabelBMFont has the flexibility of CCLabel, the speed of CCLabelAtlas and all the features of CCSprite.
|
130
150
|
If in doubt, use CCLabelBMFont instead of CCLabelAtlas / CCLabel.
|
131
|
-
|
151
|
+
|
132
152
|
Supported editors:
|
133
153
|
- http://glyphdesigner.71squared.com/
|
134
154
|
- http://www.bmglyph.com/
|
135
155
|
- http://www.n4te.com/hiero/hiero.jnlp
|
136
156
|
- http://slick.cokeandcode.com/demos/hiero.jnlp
|
137
157
|
- http://www.angelcode.com/products/bmfont/
|
138
|
-
|
158
|
+
|
139
159
|
@since v0.8
|
140
160
|
*/
|
141
161
|
|
142
162
|
@interface CCLabelBMFont : CCSpriteBatchNode <CCLabelProtocol, CCRGBAProtocol>
|
143
163
|
{
|
144
164
|
// string to render
|
145
|
-
NSString *
|
165
|
+
NSString *_string;
|
146
166
|
|
147
167
|
// name of fntFile
|
148
|
-
NSString *
|
149
|
-
|
168
|
+
NSString *_fntFile;
|
169
|
+
|
150
170
|
// initial string without line breaks
|
151
|
-
NSString *
|
171
|
+
NSString *_initialString;
|
152
172
|
// max width until a line break is added
|
153
|
-
float
|
173
|
+
float _width;
|
154
174
|
// alignment of all lines
|
155
|
-
CCTextAlignment
|
156
|
-
|
157
|
-
CCBMFontConfiguration *
|
158
|
-
|
175
|
+
CCTextAlignment _alignment;
|
176
|
+
|
177
|
+
CCBMFontConfiguration *_configuration;
|
178
|
+
|
159
179
|
// texture RGBA
|
160
|
-
GLubyte
|
161
|
-
ccColor3B
|
162
|
-
BOOL
|
180
|
+
GLubyte _displayedOpacity, _realOpacity;
|
181
|
+
ccColor3B _displayedColor, _realColor;
|
182
|
+
BOOL _cascadeOpacityEnabled, _cascadeColorEnabled;
|
183
|
+
BOOL _opacityModifyRGB;
|
163
184
|
|
164
185
|
// offset of the texture atlas
|
165
|
-
CGPoint
|
186
|
+
CGPoint _imageOffset;
|
187
|
+
|
188
|
+
// reused char
|
189
|
+
CCSprite *_reusedChar;
|
166
190
|
}
|
167
191
|
|
168
192
|
/** Purges the cached data.
|
@@ -185,7 +209,7 @@ typedef struct _BMFontPadding {
|
|
185
209
|
+(id) labelWithString:(NSString*)string fntFile:(NSString*)fntFile;
|
186
210
|
/** creates a BMFont label with an initial string, the FNT file, width, and alignment option */
|
187
211
|
+(id) labelWithString:(NSString*)string fntFile:(NSString*)fntFile width:(float)width alignment:(CCTextAlignment)alignment;
|
188
|
-
/** creates a BMFont label with an initial string, the FNT file, width, alignment option and the offset of where the
|
212
|
+
/** creates a BMFont label with an initial string, the FNT file, width, alignment option and the offset of where the glyphs start on the .PNG image */
|
189
213
|
+(id) labelWithString:(NSString*)string fntFile:(NSString*)fntFile width:(float)width alignment:(CCTextAlignment)alignment imageOffset:(CGPoint)offset;
|
190
214
|
|
191
215
|
/** init a BMFont label with an initial string and the FNT file */
|
@@ -39,13 +39,13 @@
|
|
39
39
|
|
40
40
|
@interface CCLabelTTF : CCSprite <CCLabelProtocol>
|
41
41
|
{
|
42
|
-
CGSize
|
43
|
-
CCTextAlignment
|
44
|
-
CCVerticalTextAlignment
|
45
|
-
NSString *
|
46
|
-
CGFloat
|
47
|
-
CCLineBreakMode
|
48
|
-
NSString *
|
42
|
+
CGSize _dimensions;
|
43
|
+
CCTextAlignment _hAlignment;
|
44
|
+
CCVerticalTextAlignment _vAlignment;
|
45
|
+
NSString * _fontName;
|
46
|
+
CGFloat _fontSize;
|
47
|
+
CCLineBreakMode _lineBreakMode;
|
48
|
+
NSString *_string;
|
49
49
|
}
|
50
50
|
|
51
51
|
/** Font name used in the label */
|
@@ -69,7 +69,7 @@
|
|
69
69
|
- Mac: Only NSLineBreakByWordWrapping is supported.
|
70
70
|
@since v1.0
|
71
71
|
*/
|
72
|
-
+ (id) labelWithString:(NSString*)string
|
72
|
+
+ (id) labelWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment;
|
73
73
|
|
74
74
|
/** creates a CCLabelTTF from a fontname, horizontal alignment, dimension in points, line break mode, and font size in points.
|
75
75
|
Supported lineBreakModes:
|
@@ -77,29 +77,29 @@
|
|
77
77
|
- Mac: Only NSLineBreakByWordWrapping is supported.
|
78
78
|
@since v1.0
|
79
79
|
*/
|
80
|
-
+ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode
|
80
|
+
+ (id) labelWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode;
|
81
81
|
|
82
|
-
/** creates a CCLabelTTF from a fontname, horizontal
|
82
|
+
/** creates a CCLabelTTF from a fontname, horizontal alignment, vertical alignment, dimension in points, line break mode, and font size in points.
|
83
83
|
Supported lineBreakModes:
|
84
84
|
- iOS: all UILineBreakMode supported modes
|
85
85
|
- Mac: Only NSLineBreakByWordWrapping is supported.
|
86
86
|
@since v1.0
|
87
87
|
*/
|
88
|
-
+ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment)vertAlignment lineBreakMode:(CCLineBreakMode)lineBreakMode
|
88
|
+
+ (id) labelWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment)vertAlignment lineBreakMode:(CCLineBreakMode)lineBreakMode ;
|
89
89
|
|
90
90
|
/** creates a CCLabel from a fontname, alignment, dimension in points and font size in points*/
|
91
|
-
+ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment)vertAlignment
|
91
|
+
+ (id) labelWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment)vertAlignment;
|
92
92
|
|
93
93
|
|
94
94
|
/** initializes the CCLabelTTF with a font name and font size in points */
|
95
|
-
- (id) initWithString:(NSString*)string
|
95
|
+
- (id) initWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size;
|
96
96
|
|
97
|
-
/** initializes the CCLabelTTF with a font name,
|
97
|
+
/** initializes the CCLabelTTF with a font name, horizontal alignment, dimension in points, and font size in points.
|
98
98
|
Default verticalAlignment: kCCVerticalTextAlignmentTop
|
99
99
|
Default lineBreakMode: CCLineBreakModeWordWrap
|
100
100
|
@since v1.0
|
101
101
|
*/
|
102
|
-
- (id) initWithString:(NSString*)string
|
102
|
+
- (id) initWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment;
|
103
103
|
|
104
104
|
/** initializes the CCLabelTTF with a font name, horizontal alignment, dimension in points, line break mode and font size in points.
|
105
105
|
Default verticalAlignment: kCCVerticalTextAlignmentTop
|
@@ -109,20 +109,20 @@
|
|
109
109
|
- Mac: Only NSLineBreakByWordWrapping is supported.
|
110
110
|
@since v1.0
|
111
111
|
*/
|
112
|
-
- (id) initWithString:(NSString*)str dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode
|
112
|
+
- (id) initWithString:(NSString*)str fontName:(NSString*)name fontSize:(CGFloat)size dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode;
|
113
113
|
|
114
|
-
/** initializes the CCLabelTTF with a font name,
|
114
|
+
/** initializes the CCLabelTTF with a font name, horizontal alignment, vertical alignment, dimension in points and font size in points.
|
115
115
|
Default lineBreakMode: CCLineBreakModeWordWrap
|
116
116
|
*/
|
117
|
-
- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment)vertAlignment
|
117
|
+
- (id) initWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment)vertAlignment;
|
118
118
|
|
119
|
-
/** initializes the CCLabelTTF with a font name, horizontal alignment, vertical
|
119
|
+
/** initializes the CCLabelTTF with a font name, horizontal alignment, vertical alignment, dimension in points, line break mode and font size in points.
|
120
120
|
Supported lineBreakModes:
|
121
121
|
- iOS: all UILineBreakMode supported modes
|
122
122
|
- Mac: Only NSLineBreakByWordWrapping is supported.
|
123
123
|
@since v2.0
|
124
124
|
*/
|
125
|
-
- (id) initWithString:(NSString*)str dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment)vAlignment lineBreakMode:(CCLineBreakMode)lineBreakMode
|
125
|
+
- (id) initWithString:(NSString*)str fontName:(NSString*)name fontSize:(CGFloat)size dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment)vAlignment lineBreakMode:(CCLineBreakMode)lineBreakMode ;
|
126
126
|
|
127
127
|
/** changes the string to render
|
128
128
|
* @warning Changing the string is as expensive as creating a new CCLabelTTF. To obtain better performance use CCLabelAtlas or CCLabelBMFont.
|