This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define CCARRAY_FOREACH(__array__, __object__) \ | |
if (__array__ && __array__->data->num > 0) \ | |
for(id *arr = __array__->data->arr, *end = __array__->data->arr + __array__->data->num-1; \ | |
arr <= end && ((__object__ = *arr) != nil || true); \ | |
arr++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// cocos2d constants | |
// | |
cc.DIRECTOR_PROJECTION_2D = 0; | |
cc.DIRECTOR_PROJECTION_3D = 1; | |
cc.TEXTURE_PIXELFORMAT_RGBA8888 = 0; | |
cc.TEXTURE_PIXELFORMAT_RGB888 = 1; | |
cc.TEXTURE_PIXELFORMAT_RGB565 = 2; | |
cc.TEXTURE_PIXELFORMAT_A8 = 3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone git://github.com/cocos2d/cocos2d-html5.git | |
$ cd cocos2d-html5 | |
$ git submodule update --init | |
$ python -m SimpleHTTPServer | |
... and run a brower and open it in localhost:8000/tests | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation HelloWorldLayer | |
// on "init" you need to initialize your instance | |
-(id) init | |
{ | |
// always call "super" init | |
// Apple recommends to re-assign "self" with the "super's" return value | |
if( (self=[super init]) ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Matrix4 | |
{ | |
mult(const Matrix4& other) { | |
#if defined(CC_PLATFORM_IOS) || defined(CC_PLATFORM_MAC) | |
GLKMatrix4Multiply(...); | |
#elif defined(CC_PLATFORM_ANDROID) && defined(__ARMV7__) | |
// Use ne10 library | |
ne10XXXXX(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# cocos2d-x v3.0 renderer | |
# | |
# for further info read: https://docs.google.com/document/d/17zjC55vbP_PYTftTZEuvqXuMb9PbYNxRFu0EGTULPK8/edit#heading=h.3kpkd5ktk6p1 | |
# | |
# Populates the VBO. | |
# It stops if the command is a group or if | |
# the VBO's capacity is not enough for the current Quad Command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Option 1 | |
### director has a mode | |
def appdelegate: | |
# Projection / Camera is part of director | |
# Scene checks this value in order to create the correct Physics world | |
director.setMode(2D) | |
director.runScene( MyScene() ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// API to play 3d animations on Sprite3D | |
// | |
// create the sprite | |
auto sprite3d = Sprite3D::create(“duck.ckb”); | |
sprite3d->setPosition3D(0, 0, 0); | |
this->addChild(sprite3d); | |
// get the animation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
riq@retinita-2 ~/progs/cocos2d-x/mac (v3)$ make -j8 lua-empty-test | |
[ 1%] [ 1%] [ 1%] Built target xxhash | |
Built target tinyxml2 | |
Built target unzip | |
[ 4%] Built target protobuf | |
[ 78%] Built target cocos2d | |
[ 79%] [ 79%] [ 79%] [ 79%] Building C object cocos/scripting/lua-bindings/CMakeFiles/luacocos2d.dir/__/__/__/external/lua/luasocket/options.c.o | |
Building C object cocos/scripting/lua-bindings/CMakeFiles/luacocos2d.dir/__/__/__/external/lua/luasocket/inet.c.o | |
[ 80%] [ 80%] [ 80%] [ 80%] Building CXX object cocos/scripting/lua-bindings/CMakeFiles/luacocos2d.dir/manual/CCLuaBridge.cpp.o | |
Building CXX object cocos/scripting/lua-bindings/CMakeFiles/luacocos2d.dir/manual/CCLuaEngine.cpp.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.set macro | |
.set reorder | |
.end SetVerts | |
.size SetVerts, .-SetVerts | |
.align 2 | |
.set nomips16 | |
.set nomicromips | |
.ent cpPolyShapePointQuery | |
.type cpPolyShapePointQuery, @function |
OlderNewer