I've defined a sprite using the spriteWithFile method, providing a 120px by 30px .png
Sprite *trampoline = [Sprite spriteWithFile:@"trampoline.png"];
[self addChild:trampoline];
When I add this to my Layer and position it, it is where I expect it to be on the screen.
trampoline = [Trampoline node];
trampoline.position = ccp(160,15);
[self addChild:trampoline z:0 tag:1];
However, it seems to have no contentSize. The following NSLog statement:
NSLog(@"Content Size x:%f, y:%f", trampoline.contentSize.width,trampoline.contentSize.height);
Gives the following read out:
2009-07-10 18:24:06.385 TouchSprite[3251:20b] Content Size x:0.000000, y:0.000000
Am I missing something? Shouldn't that be 120.000000 by 30.000000
Any help would be greatly appreciated.
Regards,
Rich