Created
June 24, 2009 02:17
-
-
Save akio0911/134963 to your computer and use it in GitHub Desktop.
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
@interface MainScene : Scene { | |
ColorLayer* colorLayer_; | |
} | |
@property (nonatomic, retain) ColorLayer *colorLayer; | |
@end | |
@implementation MainScene | |
@synthesize colorLayer = colorLayer_; | |
- (id) init { | |
self = [super init]; | |
if (self != nil) { | |
ColorLayer* colorLayer = [ColorLayer layerWithColor:0xff0000ff width:10 height:100]; | |
[colorLayer setPosition:ccp(480/2, 320/2)]; | |
colorLayer.transformAnchor = ccp(0,0); | |
colorLayer.rotation = 0; | |
[self addChild:colorLayer z:kZColorLayer tag:kTagColorLayer]; | |
self.colorLayer = colorLayer; | |
[self schedule:@selector(updateColorLayer:)]; | |
} | |
return self; | |
} | |
-(void) updateColorLayer:(ccTime) dt | |
{ | |
self.colorLayer.rotation += 360*dt; | |
} | |
- (void)dealloc { | |
[self.colorLayer release]; | |
[super dealloc]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment