How to tell if you touched a CCLabel?
The following code obviously does not work well enough because it only tests for point equality. Naturally touch point will not necessarily be equal to the position property of the CCLabel (CCNode). How to I tell if a Touch point has fallen within the "rectangle?" of the CCLabel?
- (void)ccTouches...
I am detecting touches for CCBitmapFontAtlas (just text labels) as shown in the code below. But it seems that touches are only detected slightly ABOVE the CCBitmapFontAtlases? Did something get screwed when converting between coordinate systems?
(*Note objects label1, label2, etc are CCBitmapFontAtlas)
- (void)ccTouchesEnded:(NSSet *)t...
I added a child like this inside of a CCLayer:
[self addChild:object1];
Later on I want to remove that object from the children. Ummm so how do I do that? Thanks.
...
Hey all. I just started looking into the cocos2d library. I've heard that it's an easy library to get into if you're used to programming in ActionScript and I've found that a lot of the concepts are indeed similar.
I started looking through sample projects (the sample games linked here were especially helpful) and I saw that handling of...
Hi all,
I am making a game using cocos2d. in that I want to change the background after each second of time.
I don't know how to do this in cocos2d. I am having 15 different images and one by one each image will be shown, i.e. after1 second next image will appear.
I am new to cocos2d so, If any one can help me???
thank you in advance ...
I have two logos, which I want to come in after each other.
I'd like to use CCFadeIn and CCFadeOut.
I have Logo1, and then I want it to CCFadeIn, then I want it to stay for 2 seconds, then make it fade out using CCFadeOut, and then make Logo2 CCFadeIn for 1 second, stay for 2 seconds and then go away during 1 second with CCFadeOut.
Ho...
Hi all,
I am new to cocos2d, In that I want to create a button, by touching the same some events should be generated.
But I don't know how to make a button in the same. As well as want to save username also. But I am not able to create a text box even.
If any one know, kindly help to create both of the things.
Thank you in advance.
...
Hey guys!
I am trying to run a "Walk" style animation on my main game sprite. The animations work fine, and my sprite is hooked up to my joystick all fine and dandy.
However, I think where I setup the call for my walk animations are wrong. Because everytime the sprite is moving, the animation stops.
I know putting the animation in suc...
Hi
I am a beginner in Obj C development, though quite experienced (over 10 years) with other ECMAscript based languages and OOP development.
I want to build a simple flipbook style animation, controlled through swiping motion. I'm sure extremely simple for any advanced ObjC coders.
Can anyone with extensive ObjC-CocoaTouch experience g...
I'm making an iPhone game where the main actor is a ball that rolls depending on the device's accelerometer rotation.
I haven't started on this part of the coding yet, but I was wondering if you guys had a nice way of solving this:
I tried looking a little into chipmunk, and I noticed that bodies have the property v, which is a point c...
I want to add an animation in starting screen of my game. I did that animation in flash. how to load it in cocos2d
...
I tried storing some CCSprites in a NSMutableArray, but the game crashed immediately, I'm guessing it's a memory problem, and I'm also guessing that CCSprites are autorelease objects?
So, how would I store multiple CCSprites in a NSMutableArray?
The purpose I wanna do this is store for example all enemies in an array, and then loop thr...
I tried to build my (cocos2d 0.99.0-based) project with iPhone SDK 4 GM which was just released today. The reason is because I want to incorporate iAds in my apps. However I got 20 error messages which looks like errors in library calling. Can anyone tell me whether we can actually use cocos2d 0.99.0? I'm aware that 99.3 was released but...
I'm making a particle system for my game, which basically is smoke coming out from rockets in my game. All particles are in a ccArray called smoke.
ccArray *smoke = ccArrayNew(0);
I have a class called Smoke, which is a subclass of CCSprite, with the addition of an ivar called __opacity.
When I add a new smoke to the ccArray I do lik...
hi all friends,
I am new to cocos2d animations and I want to learn it , as always I stops at the point of animation while making iPhone games in cocos2d.
Can any one suggest me the way to learn such animations, so that games animation creating will become easy to make.
Thanks.
...
hi,
i've got a 2 frame sprite animation running along a bezier path using ccbezierto. this works perfectly fine on the simulator, no warning no errors. but strange thing is on my iphone 3GS device, the animation and the ccbezierto action does not show up on screen, the sprite disappears for the duration of the supposed animation and pop...
Hello!
I'm trying to integrate the new object ADBannerView in my Cocos2d game but the banner apears in vertical on the left of the screen when my game is in landscape. This is my code:
UIViewController *controller = [[UIViewController alloc] init];
controller.view.frame = CGRectMake(0,0,480,32);
//From the official iAd programming guid...
Hi,
I am writing a game in cocos2d. In the iPad Simulator the application is running good.
While I am running the application in the iPad.
But it was crashing by giving the following message in terminal. I am using 2048x2048 CCSpriteSheets in my code.
I used instruments tool there is sudden increase in memory to 32MB before crashing. I...
Hi,
I need some information about using cocos2d in iPad.
Can we use 2048x2048 sprite sheets ? I read in this form that we can use but with limitation not more than 3 or 4 sprite sheets.
But, I have 10 animations in my game. maximum of 4 animations run at a time.
Can we use the CCDirectors in AppDelegate in the same way as we use i...
Hello,
I just finish my iPhone game using cocos2d. But before I put it on the AppStore, I'd like to make it work on iPad (which have a bigger screen) and iPhone 4 (which have a bigger resolution).
So, how can I determine programmatically that my app is running on an iPhone, iPad or iPhone 4, to be able to use the correct coordinates / im...