cocos2d-iphone

problem about cocos2d CCMenuItemImage overlap

free4machine Member PM this user Hi, I want to make a sample animation: there is a button at the bottom of the screen, a small menu will appear when this button is pressed. And there is an icon at the bottom of the small menu, the small menu will disappear when this icon is pressed. The button, small menu, icon, all are instance of C...

How can I return from one scene to another on Cocos2D

Hello everyone, I'm trying to play a "cut scene" with cocos2d. I use: [[CCDirector sharedDirector] replaceScene:[CCCrossFadeTransition transitionWithDuration:0.2 scene:[s node]]]; to play the new scene. However, i want to return to the previous screen when i'm done playing this cut scene. Can anyone help me? ...

How can i detect whether a touch action touches on a sprite or not at zoom state?

First i have scaled the layer larger which contains the sprites. Now I need to sense touch on a sprite. I have tried as follows, but cant reach to goal- CGRect tRect= [[aSprite displayedFrame] rect]; if(CGRectContainsPoint(tRect, touchedPosition)) { NSLog(@"touched:>> touch at (%f,%f)",touchedPosition.x,touchedPosition.y); /...

Cocos2d iPhone - Sprite cliping/mask/frame

how can i clip/crop/mask or just set the frame of a CCSprite in Cocos2D? Something similar to: setting the frame for UIView, with clipping subviews = TRUE My CCSprite Main Sprite have multiple Child Sprite added to it. I only want Mask part of that Main Sprite Sprite visible. Is there a way to clip or use a mask for CCSprite? I could...

Subclass Cocos2D MenuItem with Objective-C

Hello. I'm using a CCMenu in my small project, it has three buttons in it. I need these buttons to keep triggering if they detect a touch, and as this isn't normal behaviour I decided to subclass the CCMenuItem and override a couple of methods. The two methods I wish to override are: -(void) selected { // subclass to change the de...

[iPhone] How load image in sample GLImageProcessing with UIImagePickerControllerDelegate

How to load photo in apple official sample GLImageProcessing ? I have succeed to load photo via UIImagePickerControllerDelegate, but in this sample, all image processing is based on OpenGL, which has its routine. My purpose is to find out one solution to change the photo source, then I can use this sample to process different photos. ...

Animating large sprites with cocos2d (ccspritesheet)

I'm working on an iPhone game using Cocos2d where the main character is approximately 194x114. the animation consists of 100+ frames making my spritesheets larger than the 1024x1024 limit. The obvious solution would be to separate the animation to several files and swapping spritesheets when necessary. while doable (i guess) i'm not qui...

iPhone Game Center iOS4 support my game? How?

I'm currently building a multiplayer game for the iOS4 and I am trying to understand how I can make it support Game Center when it is released? Is there ANY documentation on it? I can't find it anywhere I'm using cocos2d to build my game and am currently not finished, but would like to be able to code directly in hopes of the game bein...

cocos2d scene question - where does init() get called within an app?

Hi, I am totally new to cocos2d and Objective C. I just started studying the HelloWorld example that came with cocos2d package, and just couldn't figure out where in the application the -init() function within HelloWorldScene.m is getting called. Here is the tutorial that I was following: http://www.bit-101.com/blog/?p=2123 Thanks in ...

can i make the searchbar static in iphone application

Hi all I want that searchbar should also scroll with scrolling mean when i scroll down searchbar should be visible. as there anyway to do so... thanks. and sorry for my bad english.. ...

Changing the font size of a menu item in cocos2d

Hii, How to change the font size and font style as Bold of a menu item at different situations in a game ...

Move my body to a point

I am using box 2d. I just want to move my body to the point. What is the best way to do this? ...

Move a box2d body via cocos2d actions

Anyone know of a good tutorial for this? I am new to box 2d and don't really understand it much. ...

How to resume my game after call ended

I have developed a game. When i checked in iphone, i found that my game pause when an incoming call comes and restarts after attending and ending the call. How to make it resume instead of restart ...

Changing a CCSprite anchor point when attached to a static body

I'm creating a static shape in chipmunk (using SpaceManager) and attaching a cpCCSprite to it. However, I need the anchor point of the sprite to be off center, but when I change the anchor point of the sprite, the shape & sprite no longer align. So if I change the anchor point like this [sprite setAnchorPoint:ccp(0.5, 0.3)]; The spr...

Translating my cocos2d game into other languages

I have done a game in cocos2d. I used English. How do I translate that game to other languages like French, Japanese, etc.? ...

How can we run CCAction of classA in classB ? What method can we use for it ?

Hi, I have CCAction *action1; in classA. I need to use that action in classB. I need to run action1 along with other actions in classB. How can I do that ? I did in the following way but not working. warning: 'CCAction' may not respond to '+actionWithAction:' Here are my classA and classB. @interface classA : CCLayer { CCAction...

How to run .gif file in cocos2d

Is it possible to run .gif file in cocos2d for iphone ...

Shadow and CCSprite

Hi! Is there way to do the shadow for CCSprite? Thanks, Yakov ...

Cocos2d - Changing animations after one is over

Hey, I've got a CCSprite with three animations: idle, walk and attack. I want to switch between idle and walk depending on whether or not the sprite is moving (if the joystick is beeing used). All of this works great. For the attacking animation, I want it to run once, and then return to the previous animation when done (ex.: idle) how ...