Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yoshiya0503/cocos2dx-translation
this is translation to cocos2dx v-3.0 from cocos2dx v-2.0
https://github.com/yoshiya0503/cocos2dx-translation
Last synced: 12 days ago
JSON representation
this is translation to cocos2dx v-3.0 from cocos2dx v-2.0
- Host: GitHub
- URL: https://github.com/yoshiya0503/cocos2dx-translation
- Owner: yoshiya0503
- Created: 2014-07-20T10:14:01.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-20T11:15:08.000Z (over 10 years ago)
- Last Synced: 2024-11-13T22:39:13.953Z (2 months ago)
- Size: 137 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
cocos2dx-translation
====================this is translation to cocos2dx v-3.0 from cocos2dx v-2.0
Director
======
v2.0
CCDirector* director = CCDirector::sharedDirector();v3.0
// sharedXXXX to getInstance(), this is singleton
auto director = Director::getInstance();Point
======
v2.0
CCP p = ccp(1024, 1024);v3.0
// ccp to Point
auto p = Point(1024, 1024);Touch Event
======
v2.0
class GameScene : public Layer {
public:
virtual bool ccTouchBegan(cocos2d::CCTouch*, cocos2d::CCEvent*);
virtual void ccTouchEnded(cocos2d::CCTouch*, cocos2d::CCEvent*)
};bool GameScene::ccTouchBegan(CCTouch* pt, CCEvent pe) {
return true;
}void GameScene::ccTouchEnded(CCTouch* pt, CCEvent pe) {
return;
}v3.0
class GameScene : public Layer {
public:
// remove CC prefix
virtual bool TouchBegan(cocos2d::Touch*, cocos2d::Event*);
virtual void TouchEnded(cocos2d::Touch*, cocos2d::Event*)
};bool GameScene::TouchBegan(Touch* pt, Event pe) {
return true;
}void GameScene::TouchEnded(Touch* pt, Event pe) {
return;
}Schedule
=======
v2.0class GameScene : public layer {
public:
void test();
void measure();
};
void GameScene::test() {
this->schedule(schedule_selector(GameScene::measure));
}void GameScene::measure() {
return;
}v3.0
class GameScene : public layer {
public:
void test();
void measure();
};
void GameScene::test() {
this->schedule(schedule_selector(GameScene::measure));
}// need float type arg
void GameScene::measure(float time) {
return;
}Label
=======
v2.0class GameScene : public layer {
public:
void test();
};void GameScene::test() {
CCLabelTTF* timerLabel = (CCLabelTTF*)this->getChildByTag(tag);
}v3.0
class GameScene : public layer {
public:
void test();
};void GameScene::test() {
// remove CC and TTF
auto timerLabel = (Label*)this->getChildByTag(tag);
}