1.is that the concepts of layers because i need diiferent things to do in single scene
2.If yes then how i can add different layers to a scene..plz help me
waiting for your reply Developers :)
A fast, easy to use, free, and community supported 2D game engine
1.is that the concepts of layers because i need diiferent things to do in single scene
2.If yes then how i can add different layers to a scene..plz help me
waiting for your reply Developers :)
I'm not exactly sure what you mean about setting an image x.png when you start the simulator. "Default.png" gets loaded up immediately, so look for it in your project and replace it with whatever image you want. Just make sure you rename it. Is that what you meant?
Re: 1, and 2, sort of:
To add a layer to a scene, do this:
GameLayer * gl = [[[GameLayer alloc] init]autorelease];
[self addChild:gl z:0 tag:0];
Do this for whatever layers you want to add. From my experiments, adding about 4-5 full-graphic layers starts to drop frames on an iTouch 2nd gen.
thankx for your reply jonathan...actually when i run my simulator i need in first there shud be a image...i did the code
-(id) init
{
if( (self=[super init] )) {
mySprite=[CCSprite spriteWithFile:@"x.png"];
mySprite.position=ccp(0,0); //i also tried without this..
[self addChild:mySprite];
}
return self;
}
but i get the output not on the full screen.my image is 480*320 ...but it dosent cover the whole view (scene)..what wud be the reason???
Sprites coordinates are set to the center of the sprite by default. 0,0 is the bottom left of the screen so you'll only see a quarter of the image.. If you want your sprite to take up the whole screen, set its position to 240,160.
tahnkx andrew..its working man.....metal horn for u \m/ \m/ \m/
You must log in to post.