When I use CCUIViewWrapper, I notice that my touch dispatcher doesn't catch any touches, even when the layers that need to have touches are added after the wrappers. Any idea how to remedy this?
...
How can I rotate sprite around his center in cocos2d in ccTouchesMoved. I found some code, but this not what I need. I need to rotate sprite like photo in Photo gallery app.
- (void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
NSArray *allTouch = [touches allObjects];
if([allTouch count] > 1){
UITouch *t...
Hey...
I'm trying to add animations to my game (iPhone app, using cocos2d).
The game was written in C++, and now I want to run it on iPhone, so most of the classes are in c++.
The thing looks like that.
I'm creating CCSprite,CCAction in obj-c class in init function, and then run CCAction on sprite.
And animation is working.
But I wan...
1、top
http:// i.imgur.com/LszAu.png
2、middle
http:// i.imgur.com/j82Dr.png
3、bottom
http:// i.imgur.com/OP9hu.png
dialog http:// i.imgur.com/ed3W2.png
How do i do with 1,2,3 to a dialog? And dialog can stretch with content? I hope you can write a simple example for me~~thanks!
...
What's the best way to implement a pan-able zoomable game map with Cocos2d for iPhone. It would be like Mobile Safari except with a game map that doesn't fit completely on screen. Or like how it's done with Angry Birds, Cut the rope, etc.
This would not be a side scrolling game, just a fixed game area that you can zoom in/out of.
I'm n...
I've been using an older version of cocos2d for iPhone for an existing project - never change a running system. Now I'd like to upgrade to a more recent version and don't know how I should proceed about this.
Just install a newer version? Will the install script overwrite all of the old files and take care of the old templates too? Or d...
Hi all!
We're in the process of creating an iPhone game using cocos2d. We're trying to layer several sprites on top of each other and have them cast shadows.
Right now the shadows are rendered as sprites which works fine for the most part. But we only want the shadows to hit the closest layer.
I've made an image that hopefully explain...
When I type "ADBannerView" it throws an exception that the ADBannerView is not declared. I am referencing to the following inside my Cocos2d delegate header and implementation file:
#import <UIKit/UIKit.h>
...
Hello there..
I have taken a view and inserted scrollview on it using nib. Then I've added an image using imageview dynamically..Now what should I do to fill color on that image.
...
in case displayFPS = NO doesn't work rotation:
- (void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
id rotationAction = [CCRotateTo actionWithDuration:duration angle:angle];
[_firstSprite runAction:rotationAction];
}
but it works, when displayFPS = YES.
seems fantastic, but..
...
I am dynamically creating a UIViewController called "MainController" in a Cocos2d application. My nib file contains nothing and I am adding the ADBannerView dynamically as shown in the code below:
MainViewController *controller = [[MainViewController alloc] init];
controller.view.frame = CGRectMake(0,winSize.height-50 , 320, 50);
...
I created an iPhone app "App1" and installed on my device and everything worked fine. Now, I copied all the code from App1 and made App2. But now when I run the App2 is replaced the icon of App1 and completely replaces the App1 with App2 on the iPhone device. What can I do to resolve this issue?
...
I have top-down game for iPhone (no gravity) and I'm using Cocos2d and Box2d.
I try to move a bullet by this code:
// 'targetPosition' is a point of touch
b2Vec2 touchInWorld = b2Vec2(targetPosition.x/PTM_RATIO, targetPosition.y/PTM_RATIO);
b2Vec2 direction = b2Vec2(touchInWorld.x - ballBodyDef.position.x, touchInWorld.y - ballBody...
I am working on a Cocos2d iPhone application and trying to display the ads. At this point the ads are displayed when there is no error. When there is an error then didFailToReceiveAdWithError is fired. After that the iAd framework tries to get the ads by constantly trying. At some point bannerViewDidLoadAd is triggered but now it display...
I am not sure why this error is being thrown when my application is validated for submission. My application is marked as iPhone application with icon.png as 57 X 57. The error says: iPad:icon.png icon dimensions (57X57) don't meet the size requirements. The icon must be 72X72 pixels, in .png format.
...
Hi
I have just completed my game with cocos2d, however I go and build for release now (have always been building for debug) and now when I launch the game the accelerometer is screwed up.
It worked wonderfully in debug mode, with no issues at all.
What its meant to do:
Tilt left and right to move player left and right on screen.
What...
I am trying to integrate iPhone ads in my application. I run the app on my device and sometimes the ads are displayed in the form of "Text Ads here" which means the ads are rendered properly. But sometimes all I see is a white rectangle and no ads or anything. Anyone experience the same issues?
Another problem is that when I click on th...
I am using cocos2d and box2d in my iPhone game.
When two balls hit each other, I get a notification though the ContactListener and I have a reference to both bodies.
I can destroy both of them, but I would like to do it with a delay.
So, two balls hit each other, they bounce off and then after a second disappear.
...
I am trying to let the finger drag CCSprite with the following code:
-(BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event {
CGPoint location = [touch locationInView: [touch view]];
CGPoint convertedCoordinate = [[CCDirector sharedDirector] convertToGL:location];
CGRect redCircleRect = CGRectMake(redCircle.positio...
I am writing an application where you push different buttons and a character gets animated. The thing is that I have many images, so I need to use one texture for each animation. Therefore I need to release sprite sheet and frame cash, but it does not seem to be working. Memory gets allocated more and more until the app crashes. Here is ...