I'm having trouble understanding what is going on here. I currently have a "Header" class that inherits from CCNode. This CCNode class has multiple properties including CCSprite's and CCLabelTTF's. In the init, I create these objects and set their…
I have a view with many rotating and moving columns. To column i add UIView named element with image and title. For full understanding this image
My problem strange for me. I add to element tap gesture
gestureTap = [[UITapGestureRecognizer alloc]…
I'm building a game that has dozens of dynamically generated mini-levels. To simplify, let's say I've got three types of levels, A, B, and C, and each one can take an integer difficulty. LevelA, LevelB, and LevelC are subclasses of CCLayer, and I've…
At the end of the game, I want to zoom out my CCLayer to show all the sprites. When I reduce the scale, the CCLayer become smaller and centered, what I want to know is how to scale the CCLayer and keep its y=0 (Origin at the bottom of the screen).…
I have two layer called alayer and blayer, alayer is parent
there is a function in alayer.h
- (void)playGame;
in alayer.m, add blayer
- (id)init
{
if ([super init] == self) {
Blayer *bLayer = [[bLayer alloc] initWithParent:self];
[self…
How can one limit the CCScrolLayer/CCLayer to a rect smaller than the screen size ? means:
CCLayer *page1;
When putting many pages in scroller, need all the items in the page to "disappear" when they reached some rect ( the scroller is above a…
Hello I am making a pause screen for my cocos2d game. I have 3 buttons: the resume button, the retry button, and the options button. None of them are responding to touch and doing what they are supposed to do. When the pause screen is pulled up, all…
I have a main CCLayer which is covering the start up screen, and then I added one more CCLayer and set it's width and height to my requirement. Target class of added layer is another class different from main CCLayer. So I want when user clicks on…
i am trying to achieve something like this . I get points from the web which i store in an array , using those points i am trying to draw a line . now , the situation is due to fast iteration of my array my line visible once & instance. Is…
I found this code:
link
It shows a label about a class of current UIViewController.
How to realize the similar thing for cocos2d? It is enough easy with subclassing but is enough hard with a category. And if I use subclassing for an existing project…
Globally my game supports two orientations: landscape right and landscape left
In one subscreen (inheriting CCLayer) I need to lock the current orientation so that ... the current orientation is locked...
When the user pops back to another screen…
From a UIKit ViewController I do this to start a game:
if (director.runningScene == nil)
{
[director runWithScene:[MyGameLayer scene]];
}
[director startAnimation];
MyGameLayer looks like this:
+(id) scene {
CCScene *scene =…
I'm using the basic Xcode template project. In the HelloWorldLayer I'm adding a square CCSprite as a child node with position CGPointZero. I'm also adding a CCLayerColor subclass with position CGPointZero as a child node. When drawn the sprite has…
I have a problem with touch handling in cocos2d-x. i have two layers. one of them is a kind of workspace and another one is a toolbox that is on top of the workspace layer. both of them have special touch handling. when i click on the upper…