摘要:#include "Common.h"#ifdef WIN32#include #else#include #include #endif#include "iconvstring/IconvString.h"#include "iconvstring/IconvStringEx.h"USING_NS_CC;namespace{ int MonthWeekDay [10][12][1] = { // 2013 { {0}, {0}, {0}, {0}, {0}, {0}, {1}, {4}, {7}, {2}, {5}, {7} ..
阅读全文
02 2014 档案
摘要:// 创建cat精灵 CCSprite* cat = CCSprite::create("Image\\grossini.png"); //change the transform anchor point to 0,0 (optional) cat->setAnchorPoint( ccp(0,0) ); //创建 background 精灵最为背景 CCSprite* background = CCSprite::create("Image\\background.png"); // scale the image (optional) bac
阅读全文
摘要:CCArmatureDataManager::sharedArmatureDataManager()-> addArmatureFileInfo("armature\\Cowboy0.png", "armature\\Cowboy0.plist", "armature\\Cowboy.ExportJson"); for (int i = 0; i getAnimation()->playWithIndex(0); armature->setPosition(ccp(CCDirector::sharedDirector
阅读全文
摘要:这个例子主要是用cocos2d-x引擎自带的资源cocos2d-x-2.2.2\samples\Cpp\TestCpp\Resources\armature新建工程之后#include "HelloWorldScene.h"#include "cocos-ext.h"USING_NS_CC;USING_NS_CC_EXT;CCScene* HelloWorld::scene(){ // 'scene' is an autorelease object CCScene *scene = CCScene::create(); // '
阅读全文
摘要:赋值是改变一个变量的值和改变表域的最基本的方法。a = "hello" .. "world"t.n = t.n + 1Lua可以对多个变量同时赋值,变量列表和值列表的各个元素用逗号分开,赋值语句右边的值会依次赋给左边的变量。a, b = 10, 2*x a=10; b=2*x遇到赋值语句Lua会先计算右边所有的值然后再执行赋值操作,所以我们可以这样进行交换变量的值:x, y = y, x -- swap 'x' for 'y'a[i], a[j] = a[j], a[i] -- swap 'a[i]' fo
阅读全文
摘要:CCRenderTexture,它允许你来动态创建纹理,并且可以在游戏中重用这些纹理。 使用CCRenderTexture非常简单 – 你只需要做以下5步就行了:创建一个新的CCRenderTexture. 这里,你可以指定将要创建的纹理的宽度和高度。.调用CCRenderTexture:begin. 这个方法会启动OpenGL,并且接下来,任何绘图的命令都会渲染到CCRenderTexture里面去,而不是画到屏幕上。绘制纹理. 你可以使用原始的OpenGL调用来绘图,或者你也可以使用cocos2d对象里面已经定义好的visit方法。(这个visit方法就会调用一些opengl命令来绘制c.
阅读全文
摘要:http://www.cnblogs.com/Martin_Q/archive/2011/04/09/2010201.html
阅读全文
摘要:/** * CCDictionary is a class like NSDictionary in Obj-C . * * @note Only the pointer of CCObject or its subclass can be inserted to CCDictionary. * @code * // Create a dictionary, return an autorelease object. * CCDictionary* pDict = CCDictionary::create(); * * // Insert objects to dictionary...
阅读全文

浙公网安备 33010602011771号