1. New File
(Template = CCNode class, Subclass of CCNode, Class name = MyLayer)
2. 기본 골격
MyLayer.m 에 기본 함수 넣음
@implementation MyLayer
+(CCScene *) scene
{
CCScene* scene = [CCScene node];
MyLayer* layer = [MyLayer node];
[scene addChild:layer];
return scene;
}
-(id) init
{
if( (self=[super init])) {
self.isTouchEnabled = YES;
[self scheduleUpdate];
}
return self;
}
-(void) update:(ccTime)delta
{
}
- (void) dealloc
{
[super dealloc];
}
@end
3. 실행
AppDelegate.m 에서 applicationDidFinishLaunching 의 맨 뒤에 다음 넣음
[[CCDirector sharedDirector] runWithScene: [MyLayer scene]];
No comments:
Post a Comment