I've been writing a game using cocos2d-x and ran into an issue with changing the background color. I found an example in cocos2d, but apparently this only applies to cocos2d which is written in Obj-c. Basically the idea is to use a CCLayerColor…
I'm having some troubles adding an UIView to cocos2d v2.0 since the openGlView is deprecated I can't add the view to it. I was looking around to find another way to do this but I couldn't find anything.
Can anyone tell me the new way to add an…
How do I make a infinite/repeating world that handles rotation, just like in this game:
http://bloodfromastone.co.uk/retaliation.html
I have coded my rotating moving world by having a hierarchy like this:
Scene
- mainLayer (CCLayer)
-…
I am playing a short video with CCVideoPlayer in cocos2d and at the end of it I am capturing the very last frame of the video and I am showing it on the screen using a UIView because trying to draw it on a CCLayer makes the image show up with…
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.
I'm using a GameManager singleton to handle some of the shared tasks required by my game. One of those tasks is loading individual game scenes. When the game starts up, whichever scene/layer combo I have displayed appears incorrectly; it looks…
I have a CCSprite called sprite that is a child of a CCLayer called movingLayer that is itself a child of the current CCLayer running my game logic, so it is self in this case. movingLayer is moving back and forth across the screen in a repeat…
i want know if there is a way to push a scene in cocos2d 2.0 and pass some parameter to this pushed scene, for example, i know that to push a scene i use this:
[[CCDirector sharedDirector] pushScene:[HelloWorldLayer scene]];
and this push the…
I have a menu scene hierarchy like so:
Scene
|
Background Layer
| |
Main Menu Settings Menu
I want to transition from the Main Menu to the Settings Menu without moving the Background Layer. There is plenty of documentation on how…
Is there any way to create the subclass of CCLayer class with rounded corners in cocos2d iPhone library?
Maybe some solutions already exists?
Any ideas?
Thank you.
Sorry if this sounds quite trivial. I am just not getting it. How can one determine if a particular sprite is already in a layer? Basically, I need to check this before determining whether to add it to the layer or not.
Is there any way to "make" a rectangular section of a CCLayer blurred?
Either by making a masking layer over the game layer, or by actually blurring part of the game layer?
I have a class that extends CCLayer. I have to get a text file from assets folder. But i couldn't use getAssets() in this class. How can i use getAssets() in a class that extends CCLayer???
I'm trying to make a menu in Cocos 2D that will automatically relayout if it's size changes. With UIKit you can set autoresizing options (either programmatically or through Interface Builder), and I like to do something similar. Does an option…
iPad App setup: SceneA contains layerA - 1024x768. Push a button in layerA, layerB drops down over top using a CCMoveTo action. LayerB is only 800x600 so you can see layerA behind it (think of an overlayed pause screen type effect). LayerB contains…