This file contains hidden or 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
| //TEST [3] を見つけることを期待 | |
| std::vector<bool> array = {false, false, false, true, false}; | |
| for (std::vector<bool>::iterator it = array.begin(); it != array.end(); it++) | |
| { | |
| if ((*it) == true) | |
| { | |
| auto index = std::distance(array.begin(), it); | |
| CCLOG("%s iterator:%d", __PRETTY_FUNCTION__, index); | |
| break; |
This file contains hidden or 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
| bool AppDelegate::applicationDidFinishLaunching() { | |
| // initialize director | |
| auto director = Director::getInstance(); | |
| auto glview = director->getOpenGLView(); | |
| if(!glview) { | |
| glview = GLView::create("My Game"); | |
| director->setOpenGLView(glview); | |
| } | |
This file contains hidden or 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
| // | |
| // Twitter.h | |
| // XXX | |
| // | |
| // Created by takashi1975 on 2015/02/22. | |
| // | |
| // | |
| #ifndef __XXX__Twitter__ | |
| #define __XXX__Twitter__ |
This file contains hidden or 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
| # 隠しフォルダ 表示/非表示 切り替え | |
| if [[ $(defaults read com.apple.finder AppleShowAllFiles) == TRUE ]] | |
| then | |
| defaults write com.apple.finder AppleShowAllFiles FALSE | |
| else | |
| defaults write com.apple.finder AppleShowAllFiles TRUE | |
| fi | |
| # Finder 再起動 | |
| killAll Finder |
This file contains hidden or 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 ver.3.x ... Android用 .soファイル コンパイル時のオプション | |
| (他にもあるのか...わかっていないです^^; | |
| //Help | |
| ./build_native.py -h | |
| ./build_native.py --help | |
| //Release build (リリースビルド) | |
| ./build_native.py -b release |
This file contains hidden or 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
| // | |
| { | |
| newTiledMap->enumerateChildren("xxx", [](Node * node) -> bool { | |
| if (auto sprite = dynamic_cast<Sprite *>(node)) | |
| { | |
| //... | |
| } | |
| return false; |
This file contains hidden or 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
| info face="number" size=32 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=2,2 | |
| common lineHeight=55 base=26 scaleW=250 scaleH=32 pages=1 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0 | |
| page id=0 file="number.png" | |
| chars count=10 | |
| char id=48 x=0 y=0 width=24 height=32 xoffset=0 yoffset=0 xadvance=24 page=0 chnl=0 letter="0" | |
| char id=49 x=25 y=0 width=24 height=32 xoffset=0 yoffset=0 xadvance=24 page=0 chnl=0 letter="1" | |
| char id=50 x=50 y=0 width=24 height=32 xoffset=0 yoffset=0 xadvance=24 page=0 chnl=0 letter="2" | |
| char id=51 x=75 y=0 width=24 height=32 xoffset=0 yoffset=0 xadvance=24 page=0 chnl=0 letter="3" | |
| char id=52 x=100 y=0 width=24 height=32 xoffset=0 yoffset=0 xadvance=24 page=0 chnl=0 letter="4" | |
| char id=53 x=125 y=0 width=24 height=32 xoffset=0 yoffset=0 xadvance=24 page=0 chnl=0 letter="5" |
This file contains hidden or 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
| XCode プロジェクトファイル(*.xcodeproj)があるフォルダに 以下の .gitignore ファイルを置くといい。 | |
| (個々のユーザー設定の情報がコミットされない) | |
| [.gitignore] | |
| xcuserdata/ | |
| project.xcworkspace/ |
This file contains hidden or 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 Layer での使用例を想定 | |
| { | |
| auto children = this->getChildren(); | |
| auto func = [](Node * node){ | |
| bool result = false; | |
| { | |
| //TODO: 判定条件 | |
| if (/*判定条件*/) | |
| { |
This file contains hidden or 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
| std::mutex mtx; | |
| void HelloWorld::init() | |
| { | |
| do { | |
| if (! Layer::init() ) { | |
| return false; | |
| } | |
| // 別スレッドを生成して引数を渡して実行 |