All Questions

Tagged with
Filter by
Sorted by
Tagged with
39 votes
4 answers
25k views

how to get Distance of Object from iPhone camera using image Exif meta data?

Edit: Sorry for late Edit, Without two parameter you cannot calculate it, So first need to fill user Camera height from ground. I have check a number of solutions but none of them helpful! I know ...
9to5ios's user avatar
  • 5,437
36 votes
7 answers
26k views

Cocos2d for iPhone vs. Cocos2d-x [closed]

I have worked some with Cocos2d for iPhone and find it delightful. I am starting another project, and have stumbled across Cocos2d-x, a C++ port. I'm tempted by the notion of being able to (with ...
WiseOldDuck's user avatar
  • 3,216
27 votes
7 answers
41k views

Detect when UIGestureRecognizer is up, down, left and right Cocos2d

I have a CCSprite that I want to move around using gestures. Problem is I'm completely new to Cocos2D. I want my sprite to perform one action when the gesture is up, another one when gesture is down, ...
Magnus's user avatar
  • 1,442
26 votes
0 answers
2k views

Texture coordinate Cocos3d [closed]

Here is how I put my texture on my object : _obj = (CC3MeshNode *)[_world getNodeNamed:@"s0"]; _obj.material.texture = [CC3Texture textureFromFile:@"objTextureLayout.png"]; My object is loaded from ...
klefevre's user avatar
  • 8,685
25 votes
4 answers
30k views

Cocos2d adding a background image to a layer?

I just finished reading some of the cocos2d documentation, and as far as I understand to add a background image to a layer you have to do something like: Sprite * bg = [Sprite spriteWithFile:@"...
Oscar Gomez's user avatar
  • 18.5k
20 votes
8 answers
27k views

How can I disable the touch detection?

How can I disable the touch detection within the action that running, because I don't want the character flying in the sky like a superman if the player clicking and clicking within the action, the ...
user avatar
20 votes
3 answers
22k views

Using custom fonts in Cocos2d

How do I use custom TTF fonts in my Cocos2d iPhone apps?
Hanaan Rosenthal's user avatar
20 votes
3 answers
11k views

Objective C - get the following day from today (tomorrow)

How can I check to see if a date is inherently TOMORROW? I don't want to add hours or anything to a date like today, because if today is already 22:59, adding too much would go over to the day after, ...
waylonion's user avatar
  • 6,896
20 votes
6 answers
29k views

How can I create a count down timer for cocos2d?

I am developing a 2D iPhone game by using cocos2d. I need a countdown timer. How can I create a count down timer in cocos2d?
Md Nasir Uddin's user avatar
20 votes
4 answers
11k views

Applying Zoom Effect In cocos2D gaming environment?

I'm working on a game with cocos2D game engine and make load all the sprites while it load the level, now as because some of sprites (obstacles) are taller than 320 pixel, thus it seems difficult to ...
rptwsthi's user avatar
  • 10.1k
19 votes
3 answers
45k views

How to draw a line with Cocos2d-iPhone

I'm trying to get to grips with Cocos2d by trying to accomplish simple things. At this point, I have a scene, that scene has a background sprite, and a Layer. I'm trying to draw onto the Layer using ...
gargantuan's user avatar
  • 8,908
19 votes
1 answer
6k views

How do you supress OpenGL messages in Xcode for iOS 12.0

I'm using an old version of Cocos2d-iphone and need to come up with one last release before I completely reconfigure my app for Metal support. Until then, I'm trying to work through all the ...
PWiggin's user avatar
  • 956
19 votes
1 answer
5k views

Is it possible to achieve MAX(As,Ad) openGL blending?

I am working on a game where I want to create shadows under a series of sprites on a grid. The shadows are larger than the sprites themselves and the sprites are animated (i.e. move and rotate). I ...
Jeff B's user avatar
  • 30.1k
17 votes
1 answer
11k views

cocos2d: playing a video in the background of a menu

I have a a CCLayer with the start menu of my app and I would like to have a short movie playing in the background. I have succeded in playing a movie in the glView but when it plays the menu is not ...
Andrea Sindico's user avatar
16 votes
4 answers
26k views

how can I use animation in cocos2d?

I am trying to develop a Roulette game for iPhone. How can I animation (spin) the Roulette board?
Md Nasir Uddin's user avatar
16 votes
1 answer
5k views

where to start for game development? UIKit vs Core Animation vs QuartzCore vs OpenGL vs cocos2D

If I was interested in getting across game development on the iPhone/iPAD any suggestions on which technology(s) to start looking into? In fact just a simple bullet on each of these technologies ...
Greg's user avatar
  • 34.4k
16 votes
2 answers
5k views

Building a simple bridge between objc and lua?

I have integrated Lua with my ObjC code (iphone game). The setup was pretty easy, but now, I have a little problem with the bridging. I have googled for results, etc... and it seems there isn't ...
Notbad's user avatar
  • 6,146
16 votes
1 answer
13k views

Create layer mask with custom-shaped hole

I've spent too much time trying to figure this out and simply cannot find a workable solution. Situation: 1. A picture of 'something' is displayed on the phone. 2. A semi-transparent (e.g. blue) ...
GtotheB's user avatar
  • 2,727
15 votes
6 answers
20k views

How to draw a solid circle with cocos2d for iPhone

Is it possible to draw a filled circle with cocos2d ? An outlined circle can be done using the drawCircle() function, but is there a way to fill it in a certain color? Perhaps by using pure OpenGL?
user avatar
14 votes
5 answers
13k views

Command /usr/sbin/chown failed with exit code 1?

Each time I try to archive my application to submit it to apple Xcode keeps giving me this error! I'v Triple checked that in the Cocos2d libraries Target i made that my Install Group & Install ...
Alex Crawford's user avatar
13 votes
1 answer
8k views

How to subscribe self on the event of Device Orientation(not interface orientation)?

in my app i want to call some method in CCScene myscene in the case of device rotation(orientation change).I disabled the autorotation(because i want it not to happen). The issue is: i want to change ...
Alexander Tkachenko's user avatar
13 votes
2 answers
13k views

How to implement HD "Retina Display" graphics in Cocos2D

I am not quite sure how use HD images for sprites in cocos2d. I looked through the documentation, and downloaded the newest beta which supports points instead of pixels, but I don't understand the ...
tallen11's user avatar
  • 1,387
13 votes
1 answer
3k views

Point in Tilt Direction - iPhone

In my cocos2d game, I have my player sprite and I want to have him move in the direction I tilt my iPhone. I can deal with that, the hardest bit which I can't work out is: How do I make my sprite ...
Josh Kahane's user avatar
12 votes
7 answers
9k views

How to hide FPS numbers in bottom left of screen in Cocos2d

How do I get rid of the numbers in the bottom left of the screen when I am making a cocos2d game? This is probably a newb question, but still.
skippy_winks's user avatar
12 votes
7 answers
20k views

Problem with cocos2D for iPhone and touch detection

I just don't get it. I use cocos2d for development of a small game on the iPhone/Pod. The framework is just great, but I fail at touch detection. I read that you just need to overwrite the proper ...
user avatar
12 votes
6 answers
4k views

What mathematics is needed for a lunar lander game?

I'd like to build a game to learn cocos2d. Lunar lander is the first exercise coming in my mind. Any pointer/source code/tutorial of the physics calculations required will be appreciated. Thanks!
ohho's user avatar
  • 51.4k
12 votes
1 answer
13k views

Change the background image in cocos2d

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 ...
V.V's user avatar
  • 3,092
12 votes
2 answers
775 views

Multitouch not working in cocos2D for iPhone

I am quite familiar with cocos2D (been working with it for over 1 year) and I encountered a problem with my multitouch game - the multitouch. What I have: [glView setMultipleTouchEnabled:YES] in my ...
George's user avatar
  • 4,029
11 votes
7 answers
43k views

How can I detect touch in cocos2d?

I am developing a 2d game for iPhone by using cocos2d. I use many small sprite (image) in my game. I want to touch two similar types of sprite(image) and then both sprite(image) will be hidden. ...
Md Nasir Uddin's user avatar
11 votes
1 answer
3k views

Moving a Stick figure, anchorpoints, animation, or something else...?

Ok so I am making a game with stick figures with cocos2d in objective c... Different things need to be animated so please, give me a suggestion of what would be the best way to go about accomplishing ...
Gabriel's user avatar
  • 3,035
11 votes
1 answer
12k views

How to stop the forces acting on a body in box2d

I am using box2d on the iphone to create a game. I have a body that is effected by gravity to move down and not right or left. It will get hit by another body and will then be moving right or left. I ...
user891123's user avatar
11 votes
2 answers
6k views

How to disable iPhone 6 native resolution?

I have several games made with Cocos2d-iphone. All of them are old projects created with Xcode 4 or 5. All games scale fine on the new iPhone 6 and 6 Plus except one that seems to avoid the scaling ...
Dunbar's user avatar
  • 421
11 votes
4 answers
4k views

How to know when an user rates an iOS app/game

I am developing a game for iOS. I would like to implement a feature that allow the user rate my app and, if he does it, he will get points for my game. I know how to display an screen, menu, whatever ...
Juanjo's user avatar
  • 949
11 votes
3 answers
10k views

Best practices for handling touches to a CCSprite with cocos2d

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 ...
donkim's user avatar
  • 13.1k
10 votes
4 answers
21k views

Xcode : How To Set App To Be iPhone Only?

We have set the following app settings to be iPhone only, but in the App Store the app is listed as iPhone/iPad compatible. As you can see in the following image, the device family is set to be just ...
Guru's user avatar
  • 21.8k
10 votes
3 answers
6k views

How to draw a background fast in cocos2d?

I'm toying with a small game on my iPad using cocos2d and I've run into some performance worries. I have a 512x512 image tiled as my background. That gives me around 40fps with 20 sprites (in a ...
grapefrukt's user avatar
  • 27.1k
10 votes
2 answers
3k views

collision detection in cocos2d

i want to detect collision detection two times in same row. for example:-(see the below image) the ellipse and rectangle or detcted. after that my ellipse will travelling in the straight line path ...
Sri's user avatar
  • 827
9 votes
2 answers
1k views

What are the "gotchas" when developing an iPhone Game? [closed]

Am used to developing business and reference apps. Now I have to do an iPhone game. What tips can you share to help me with: understanding the scope of the project defining the deliverables ...
Piedad's user avatar
  • 93
9 votes
2 answers
15k views

cocos2d-iOS - Gesture recognisers

Has anyone managed to get the gesture recognition working in cocos-2d? I have read a post here that claimed to have achieved it, here: http://www.cocos2d-iphone.org/forum/topic/8929 I patched from ...
Robert's user avatar
  • 38k
9 votes
4 answers
5k views

Cocos2d Resources [closed]

Any recommendations on good sites/resources on programming with the Cocos2d-iPhone game engine? What worked for you? What is the canonical place for all things Cocos2d? Any sites you recommend? Best ...
Brian Liang's user avatar
  • 7,754
9 votes
2 answers
6k views

Objective-C Category and new iVar

I try to extend the functionality of SimpleAudioEngine of cocos2d with the ability to play several sound effect one after another as some kind of chain. I tried to do this with an extension. However I ...
gebirgsbärbel's user avatar
9 votes
2 answers
7k views

Convert multiple .wav to .caf

I'm making an iPhone app and I have a ton of .wav files I need to convert to .caf I can use this for each file: afconvert -f caff -d LEI8@22050 walking.wav walking.caf But that would take ages, so ...
FBryant87's user avatar
  • 4,423
9 votes
4 answers
8k views

Cocos2D Rotation and Anchor point

The problem that I have is that when ever I change the anchor point sprite automatically rotates with respect to the current anchor point. And I don't want that to happen. The steps that I followed ...
Jose Antony's user avatar
9 votes
2 answers
12k views

Best way to display a game score on iPhone with cocos2d?

I am looking to persistently display a game score in an iPhone app using cocos2d. Going off the code that cocos2d shows the FPS the app is running at: -(void) showFPS { frames++; accumDt += ...
user21293's user avatar
  • 6,479
9 votes
1 answer
2k views

How to check whether there is internet connection with the device: cocos-2d

In one of my iPhone app, I need to find out whether there is internet connection with the device or not. Anyone pls help?
Krishna Raj Salim's user avatar
9 votes
4 answers
8k views

Multi-threaded OpenGL Programming in Cocos2D-iPhone

In an attempt to create a loading bar for an iPhone game I'm developing (using Cocos2D), I wanted to use a multithreaded approach. One thread shows a loading screen and runs the main application ...
Asad R.'s user avatar
  • 1,051
9 votes
1 answer
2k views

RunWebThread taking up 33% of CPU time on iPhone App

I'm making a game for the iPhone using Cocos2D. At the beginning of the game, when there are few sprites, the game runs fine, but when there are many sprites on the screen, the game gets choppy. I'...
Jessica's user avatar
  • 393
8 votes
5 answers
10k views

iOS app missing screenshot

Since iOS 6 came out and Apple is requiring screenshots for any apps you update, I'm having problems with app submission! What if I DO NOT want to have my app support the iPhone 5's big screen yet? ...
waylonion's user avatar
  • 6,896
8 votes
4 answers
6k views

Cocos2d - animationwithframes:delay: deprecated

I would like to know what I should use in place of animationWithFrames:delay: and actionWithAnimation:restoreOriginalFrame: since they give a warning that they've been deprecated.
wilM's user avatar
  • 157
8 votes
4 answers
4k views

iPhone:Learning Cocos2D project

I want to develop a game in a month by using the Cocos2D Open Source game engine. Learning Cocos2D is a bit hard and I don't know how to create my initial project by using the files provided by ...
Getsy's user avatar
  • 4,905

1
2 3 4 5
59