Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
<key>NSAppTransportSecurity</key> | |
<dict> | |
<key>NSExceptionDomains</key> | |
<dict> | |
<key>tadamatu0001.web.fc2.com</key> | |
<dict> | |
<key>NSIncludesSubdomains</key> | |
<true/> | |
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key> | |
<true/> |
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
// 固定された物体(壁などに利用) | |
auto map = this->addNewBoxAtPosition(this, Point(0, 100), false, "map.png"); | |
// 物理計算されてダイナミックに動く物体(プレイヤーなどに利用) | |
auto player = this->addNewBoxAtPosition(this, Point(100, 100), true, "player.png"); | |
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
<activity android:name="org.cocos2dx.cpp.AppActivity" | |
android:label="@string/app_name" | |
android:screenOrientation="portrait" //★この部分★ | |
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" | |
android:configChanges="orientation"> |
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
// スクリーンショットを取得し、ツイートする | |
void screenShot() { | |
// スクリーンショットのテクスチャを取得する | |
Size size = Director::getInstance()->getWinSize(); | |
RenderTexture* texture = RenderTexture::create((int)size.width, (int)size.height); | |
texture->setPosition(Point(size.width/2, size.height/2)); | |
texture->begin(); | |
Director::getInstance()->getRunningScene()->visit(); | |
texture->end(); |
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] | |
//ローカライズ文字の取得関数 | |
//searchKey 対象キー | |
//comment コメント(覚書などに利用) | |
//Return ローカライズ文字列 | |
std::string LocalizedString(const char* searchKey, const char* comment){ | |
std::string ret = comment; | |
static map<std::string, std::string> localizable; | |
if(localizable.empty()){ |
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] | |
//文字列をデリミタで分解しリスト化する関数 | |
//str 対象文字列 | |
//delim デリミタ | |
//Return 分解後リスト | |
std::list<std::string> split(std::string str, std::string delim) { | |
std::list<std::string> result; | |
long cutAt; | |
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] | |
//トリミング関数 | |
//str 対象文字列 | |
//[trimCharacterList] トリミングしたい文字 | |
//Return トリミング後の文字列 | |
std::string trim(const std::string& str, const char* trimCharacterList = "; \t\v\r\n\"\'") { | |
std::string result; | |
std::string::size_type left = str.find_first_not_of(trimCharacterList); | |
if (left != std::string::npos) { |
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] | |
//文字列の置換 | |
//target 対象文字列 | |
//from 検索する文字列(置換される文字列) | |
//to 置換する文字列 | |
//Return 置換後文字列 | |
std::string stringReplace(const std::string target, const std::string from, const std::string to) { | |
std::string result = target; | |
std::string::size_type pos = 0; | |
while(pos = result.find(from, pos), pos != std::string::npos) { |
NewerOlder