Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HelloWorldをSplashSceneに変更 Classes内ディレクトリ構成変更
- Loading branch information
1 parent
5deb8dc
commit 1c223a8
Showing
7 changed files
with
79 additions
and
112 deletions.
There are no files selected for viewing
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
76 changes: 0 additions & 76 deletions
76
cocos2d-x-3.0alpha0/projects/ichi_okuman_yen/Classes/HelloWorldScene.cpp
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
cocos2d-x-3.0alpha0/projects/ichi_okuman_yen/Classes/HelloWorldScene.h
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
cocos2d-x-3.0alpha0/projects/ichi_okuman_yen/Classes/Opening/SplashScene.cpp
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "SplashScene.h" | ||
#include "CCBReader/CCBReader.h" | ||
#include "CCBReader/CCNodeLoaderLibrary.h" | ||
|
||
USING_NS_CC; | ||
USING_NS_CC_EXT; | ||
|
||
Scene* SplashScene::createScene() | ||
{ | ||
auto scene = Scene::create(); | ||
auto layer = SplashScene::create(); | ||
|
||
scene->addChild(layer); | ||
|
||
return scene; | ||
} | ||
|
||
|
||
bool SplashScene::init() | ||
{ | ||
if ( !Layer::init() ) | ||
{ | ||
return false; | ||
} | ||
|
||
// スプラッシュのccbiファイルを読み込む | ||
auto nodeLoaderLibrary = NodeLoaderLibrary::getInstance(); | ||
CCBReader* reader = new CCBReader(nodeLoaderLibrary); | ||
auto splashNode = reader->readNodeGraphFromFile("ccbi/SplashScene.ccbi"); | ||
|
||
// 追加 | ||
this->addChild(splashNode, 0); | ||
|
||
// 開放 | ||
reader->release(); | ||
|
||
return true; | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
cocos2d-x-3.0alpha0/projects/ichi_okuman_yen/Classes/Opening/SplashScene.h
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef __SPLASH_SCENE_H__ | ||
#define __SPLASH_SCENE_H__ | ||
|
||
#include "cocos2d.h" | ||
|
||
class SplashScene : public cocos2d::Layer | ||
{ | ||
public: | ||
static cocos2d::Scene* createScene(); | ||
|
||
virtual bool init(); | ||
|
||
CREATE_FUNC(SplashScene); | ||
}; | ||
|
||
#endif // __SPLASH_SCENE_H__ |
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
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