cocos2d

How do I create a MenuItemImage with some text on it ?

Hey Guys, I would like to create a menu item from an image with some text on it. Image is a button and I have to write the name of the player on the button, so I presume I have to use both MenuItemImage and MenuItemFont. Maybe I can create an AtlasSprite using both image and text on it and then us MenuItemAtlasSprite object? If so how ...

Detect touch *anywhere on the screen* in cocos2d?

I'm really sorry, I realize there have been several questions asked about cocos2d touch detection (including this answer which helped me a bunch), but I just can't get any of them to work. I would have commented on the answer I linked instead of asking my own question, but i don't have enough rep to leave comments. All I want to do i...

Sprite backgrounds

I use cocos2d for iphone and in my game I'm using a sprite as static background image. I've noticed that when removing code for adding the sprite the framerate goes from ~30fps to over 40fps. Is it any other way to show a static background that is less expensive? I'm not moving the background sprite at all. To code right now: backgrou...

How to alter the effect which is apply?

Hi all, I create one Layer on which I add One Sprite (Image of grid). I use Ripple3D effect to that layer. I want original layer (layer before applying effect). for that I reverse that effect but it don't show the original Layer. please guide me to solve this problem ...

Can the cocos2d Director return time?

I am currently using the cocos2d Director for controlling my animation with the pause, resume, and stopAnimation methods. Is it also possible to use the Director to return the time that the animation has played? I am currently using this method: -(void)stopAnimation:(id)sender { //Timer initialized elsewhere: startTimer = [NSDate ...

iPhone Device's touch events stops responding

Hello, I'm using cocos2d version 0.73, 2.2.1 SDK on the device, 2.2.1 and 3.0 on the simulator. I have a layer with 2 menu items, and a sprite that's being dragged over the screen (using ccTouchesBegan, ccTouchesMoved and ccTouchesEnded). It's all working good on the simulator, but on the device - the menu items can be pressed many ti...

Nearest-neighbour "pixelly" texture scaling in Cocos2d?

I'm trying to scale a sprite, but have the texture be scaled in a "pixelly" way, like retro games. I know how to do this in OpenGL, but I'm not sure how to do this in Cocos2d. How do I do this? Is there a way of getting at the OpenGL? Or something through Cocos2d? Thanks, uaq ...

Problem with facebook login page and iphone keybord?

Hi All, I am developing a game in cocos2d in which I have to connect my iphone game with face-book. for that I have code FBLoginButton *button=[[[FBLoginButton alloc]init] autorelease]; [[[Director sharedDirector]openGLView] addSubview :button] ; when I click on button face-book login page is display. when I click on Username t...

Use Objective-C game engine in C++ iphone game?

You often hear that C++ is preferable to Objective-C for games, especially in a resource-constrained environment like the iPhone. (I know you still need some Objective-C to initially talk to iPhone services.) Yet, the 2D game engine of choice these days seems to be Cocos2d, which is Objective-C. I understand that what Apple calls "Obje...

Image stretching

Hi All, I want Stretch a image. For that i use sprite. I want stretch sprite & this stretching is may be Circular or curve animation. I don't understand what methode used for that. Can anyone help me? ...

How can i rotate body when user touch the screen in cocos2d.

Hi, I am facing one problem. I have done some coding to rotate cpSegmentShapeNew but its not working . Have a look on the following code, //**creating shape testBody = cpBodyNew(INFINITY, INFINITY); cpShape* testShape = cpSegmentShapeNew(testBody, cpv(230, 82), cpv(193, 46), 0.0f); testShape->e = 0.0; testShape->u = 0.0; testShape-...

How do i use cocos2d with Xcode?

Hi, I downloaded the lastest version of cocos2d but I am confused as to how to use it with my current project. Can anyone show me how to use it with xcode. I'm looking to design a 2D maze. Do i have to import something ? Any sort of help would be appreciated. ...

How to draw a human character using Cocos2d?

Hi, I'm new to Cocos2d and was wondering if anyone can show me how to create a human character or any type of character using Cocos2d for my iphone app. Also show me how to get started with a maze would be helpful. THanks ...

Cocos2D iPhone Effect

Hi all, trying to play around with the Cocos2d effects and created to methods to display and stop the Liquid action. My application however drops from 60fps down to 30fps when the effect is applied but the fps doesnt increase again when the scheduled stop action is called. I originally thought that while the action has been completed ...

how we can show UIView by using cocos2d with animation?

how can i show a UIView using cocos2d with animation, i have used code like: [[[Director sharedDirector] openGLView] addSubview:myView]; but this without any animation, so how can we do it? ...

Time between touch began and touch ended

Is there any function in cocos2d or objective c to find the time between touch began and touch ended?? ...

Problem with touch in cocos2D

Hey guys, i ready many many questions about that point, but i really didn't get the right one yet. So.. this is the problem.. This is my first project with cocos2d, so sorry for that. I have one scene called Gameplay inside that i have one Layer with the name Grid and inside of this grid, have many many Block (Layer too). I need chec...

Interface Builder vs Cocos 2D - how choice the best for your app.

Hello everyone! I was a flash developer for 3 years, and in the last 5 months, i begin the iphone development, i do 2 applications with interface builder for clients, and now i really want to do a little game, is quite simple, one match 3! I made the engine in interface builder, and seens good to me! But after i read some posts, i really...

how to use cocos2d sprite collision?

how do i start to implement a class for sprite collision ...

how can i draw something on my Sprite?

i am using cocos2d to develop a game, now have a sprite loaded from image, and i would like to draw something on it like square? how can i do that? ...