I am having trouble finding a tutorial on CCCamera. And have even heard from others there is no CCCamera tutorial. But, to the point, the thing that I really want to know is simply: How do I move the coordinates of the cammera? I tried this after looking at the reference:
CCCamera *myCam = [[CCCamera alloc] init];
[myCam setCenterX:10000 centerY:10000 centerZ:0];
This doesn't give any warnings, crashes or anything like that, but, I suspected not to see anything because of what I put it in my init (look at the "//" comments in my code for a summary of whats going on):
-(id) init {
if ( (self=[super init]) ) {
isTouchEnabled = YES;
//Make the characters and joystick here
character = [CCSprite spriteWithFile: @"character.png"];
character.position = ccp(50,100);
[self addChild:character];
leftJoy = [[[SneakyJoystickSkinnedBase alloc] init] autorelease];
leftJoy.position = ccp(64,64);
leftJoy.backgroundSprite = [ColoredCircleSprite circleWithColor:ccc4(255, 0, 0, 128) radius:32];
leftJoy.thumbSprite = [ColoredCircleSprite circleWithColor:ccc4(0, 0, 255, 200) radius:16];
leftJoy.joystick = [[SneakyJoystick alloc] initWithRect:CGRectMake(0,0,128,128)];
leftJoystick = [leftJoy.joystick retain];
[self addChild:leftJoy];
//Camera should go way out and not see the other two things.
CCCamera *myCam = [[CCCamera alloc] init];
[myCam setCenterX:10000 centerY:10000 centerZ:0];
[self schedule:@selector(tick:)];
}
return self;
}
You will need SneakyInput to run this. This question is similar but, it is only should I use the camera or not, not: How do I move the camera? Thanks in advanced for you help!