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
#define CCB_LOAD_SCENE(T) \ | |
[]()->cocos2d::Scene *{ \ | |
auto nodeLoaderLibrary = cocosbuilder::NodeLoaderLibrary::newDefaultNodeLoaderLibrary(); \ | |
nodeLoaderLibrary->registerNodeLoader(#T, T ## Loader::loader()); \ | |
auto ccbReader = new cocosbuilder::CCBReader(nodeLoaderLibrary); \ | |
auto layer = ccbReader->readNodeGraphFromFile(#T ".ccbi"); \ | |
auto scene = cocos2d::Scene::create(); \ | |
if (layer) { \ | |
scene->addChild(layer); \ | |
} \ |
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
CCNodeLoaderLibrary* nodeLoaderLibrary = CCNodeLoaderLibrary::newDefaultCCNodeLoaderLibrary(); | |
nodeLoaderLibrary->registerCCNodeLoader("TestScene", TestSceneLoader::loader()); | |
CCBReader* ccbReader = new CCBReader(nodeLoaderLibrary); | |
// ここで画像を保存したパスを指定する | |
ccbReader->setCCBRootPath(CCFileUtils::sharedFileUtils()->getWritablePath().c_str()); | |
CCNode* node = ccbReader->readNodeGraphFromFile("TestScene.ccbi"); |
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
// HTTP通信 | |
void ResourceDownloader::startDownload(char const *url) { | |
CCHttpRequest *request = new CCHttpRequest(); | |
request->setUrl(url); | |
request->setRequestType(cocos2d::extension::CCHttpRequest::kHttpGet); | |
request->setResponseCallback(this, httpresponse_selector(ResourceDownloader::onHttpRequestCompleted)); | |
CCHttpClient::getInstance()->send(request); | |
request->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
// | |
// Created by gin0606 on 2013/12/12. | |
// | |
#include "CCJson.h" | |
CCDictionary *CCJson::JSONObjectWithString(std::string jsonString) { | |
return CCJson::JSONObjectWithString(jsonString.c_str()); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<scheme name="myXcode" version="124" parent_scheme="Default"> | |
<option name="LINE_SPACING" value="0.99" /> | |
<option name="EDITOR_FONT_SIZE" value="15" /> | |
<option name="CONSOLE_FONT_NAME" value="Menlo" /> | |
<option name="CONSOLE_LINE_SPACING" value="1.0" /> | |
<option name="EDITOR_FONT_NAME" value="Ricty" /> | |
<colors> | |
<option name="ADDED_LINES_COLOR" value="5f665f" /> | |
<option name="CARET_COLOR" value="888888" /> |
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)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
// Override point for customization after application launch. | |
UIViewController *viewController1, *viewController2; | |
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { | |
viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController_iPhone" bundle:nil]; | |
viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController_iPhone" bundle:nil]; | |
} else { | |
viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController_iPad" bundle:nil]; |
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
#!/usr/local/bin/python | |
# -*- coding: utf-8; -*- | |
from urlparse import urlparse | |
from httplib import HTTPConnection | |
def expandURL(url): | |
""" | |
短縮URLを展開する | |
Arguments: | |
- `url`: 展開したいURL |
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
// | |
// Created by kkgn06 on 2013/05/29. | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSDictionary (KKWithoutNSNull) | |
-(id)objectOrNilForKey:(id)key; | |
@end |
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
// | |
// Created by gin0606 on 2013/05/10. | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSMutableArray (NonRetainedObject) | |
- (void)addNonretainedObject:(id)anObject; | |
- (id)nonretainedObjectAtIndex:(NSUInteger)index; |