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
#ifdef APPORTABLE | |
- (BOOL) canBecomeFirstResponder | |
{ | |
return YES; | |
} | |
- (void)buttonUpWithEvent:(UIEvent *)event | |
{ | |
switch (event.buttonCode) |
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
#ifndef ANDROID | |
// Only on iOS | |
#import "TestFlight.h" | |
#endif |
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
"config": { | |
... | |
"FEATURES": ["opengles2","landscape","true_color"], | |
... | |
} |
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 | |
{ | |
#ifdef ANDROID | |
[UIScreen mainScreen].currentMode = [UIScreenMode emulatedMode:UIScreenBestEmulatedMode]; | |
#endif | |
... | |
} |
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
" \n\ | |
#ifdef GL_ES \n\ | |
varying mediump vec4 v_color; \n\ | |
varying mediump vec2 v_texcoord; \n\ | |
#else \n\ | |
varying vec4 v_color; \n\ | |
varying vec2 v_texcoord; \n\ | |
#endif \n\ | |
\n\ | |
void main() \n\ |
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
" \n\ | |
#extension GL_OES_standard_derivatives : enable \n\ | |
\n\ | |
#ifdef GL_ES \n\ | |
varying mediump vec4 v_color; \n\ | |
varying mediump vec2 v_texcoord; \n\ | |
#else \n\ | |
varying vec4 v_color; \n\ | |
varying vec2 v_texcoord; \n\ | |
#endif \n\ |
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
visibleSize = director.getVisibleSize(); | |
visibleOrigin = director.getVisibleOrigin(); | |
LEFT_CENTER = cc.p(visibleOrigin.x, visibleOrigin.y+visibleSize.height/2); | |
RIGHT_CENTER = cc.p(visibleOrigin.x+visibleSize.width, visibleOrigin.y+visibleSize.height/2); | |
TOP_CENTER = cc.p(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height); | |
BOTTOM_CENTER = cc.p(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y); | |
CENTER = cc.p(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/2); | |
LEFT_TOP = cc.p(visibleOrigin.x, visibleOrigin.y+visibleSize.height); | |
RIGHT_TOP = cc.p(visibleOrigin.x+visibleSize.width, visibleOrigin.y+visibleSize.height); |
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 | |
CCDirector *pDirector = CCDirector::sharedDirector(); | |
pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); | |
CCSize designSize = CCSizeMake(480, 320); | |
CCSize resourceSize = CCSizeMake(480, 320); | |
CCSize screenSize = CCEGLView::sharedOpenGLView()->getFrameSize(); | |
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
-(id) init { | |
if(self = [super init]) { | |
self.touchMode = kCCTouchesOneByOne; | |
self.touchSwallow = NO; | |
self.touchEnabled = YES; | |
} | |
return self; | |
} |
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
-(id) init { | |
if(self = [super init]) { | |
self.touchEnabled = YES; | |
} | |
return self; | |
} | |
/* Need to override because we don't want to swallow touches */ | |
-(void) registerWithTouchDispatcher { | |
[[[CCDirector sharedDirector] touchDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:NO]; |