Tagged Questions
0
votes
0answers
14 views
NSColorWell and Cocos2D Layer issue
I am tying to dynamically change my background color on the fly using an NSColorWell. I am using cocos2d framework for desktop.
I have a GLView that shows the cocos2d window and I have a NSColorwell ...
0
votes
4answers
824 views
cocos2d enable touch in second scene
i have menu with buttons
when touch the Play button
game go to another scene
but Touch don't work there
i'm write
self.isToucheEnabled=YES;
in init method
and add in onEnter method
...
1
vote
1answer
61 views
How to add a background image that moves independent to main layer in Cocos and box2d
I want to add a background to a side scroll game that moves at a different rate to the main game layer. What would be the best way to do this? I may want 2 background layers, each scrolling slower ...
1
vote
1answer
93 views
side scrollling boundaries in cocos2d with levelhelper
I am making a side scrolling game with levelhelper and sneakyinput.
i have couple questions.
i have sneakyinput on a different layer and i am facing a problem on scrolling with the parallax at ...
0
votes
1answer
72 views
Cocos2D: Get layer's position in scene from another class
I'm trying to retrieve the current position of the layer added as a child in a scene while a scene transition is occurring. The transition is an edited Cocos2D transition that slides the layer off ...
0
votes
1answer
49 views
Linking HUDLayer to GameplayLayer properly
I'm trying to pass the touch location from GameplayLayer to HUDLayer to see if user presses control buttons.
HudLayer.mm
-(void) handleTouchAtLocation:(CGPoint) location {
NSLog(@"Touch passed to ...
1
vote
3answers
1k views
cocos2d subclassing sprite to handle touch?
I'm new to the cocos2d(-x) world.
I'd like to detect a touch to a sprite, and tutorials/examples seem to suggest using layer to detect touch and find the approapriate sprite with bounding box.
...
0
votes
1answer
117 views
Cocos2D - remove layer opacity on region
I got a Scene with a layer with the top z-index wich one adds a dark effect to the whole scene setting its opacity. What i am trying to do now is to remove the shadow/dark effect in a concrete region ...
0
votes
2answers
113 views
Adding a Layer to a Scene does not work
I have been trying to get a layer into my scene. My scene is called "Survival". My layer is called "SSpriteLayer". The scene initializes, but the layer doesn't.
SURVIVAL.H:
#import ...
1
vote
3answers
544 views
problem: menu does not show in cocos2d layer
I am trying to add menu to a layer in cocos2d but it just does not appear. Here's the code which is written in init method of a layer
CCMenuItem *aButton = [CCMenuItemImage ...
0
votes
2answers
889 views
Cocos2d v2.0 - Set Up Scenes, Layers, Sprites, etc
With Cocos2d v2.0.0, a lot of changes were made and a lot of people are experiencing some scaling problems and other conflicts ...
This is even more true if they read and test out Ray Wenderlich's ...
0
votes
1answer
439 views
cocos2d add layers on scene
I know that my question might be stupid but I searched and I can't find why it's not working.
I create a CCLayer class BackgroundLayer with implementation below:
#import "BackgroundLayer.h"
...
1
vote
0answers
254 views
moving layer doesn't seem smooth in cocos2d
I have a code like below
if(condition)
sprite->setPosition(newPosition)
else
layer->moveBy(diff)
it works ok, but movement is not smooth..
(the code tries to keep the sprite in center ...
0
votes
0answers
160 views
adding UIView to cocos2d-x layer?
Question says it all.
Can I add a UIView to a cocos2d-x layer?
How about adding it to a cocos2d(not x) layer?
0
votes
2answers
1k views
Add child to layer from different class Cocos2d?
I am making a game. I have been successful with more than one layer on the same scene, but I want there to be collision detection. And the simplest way to do this is to have ONE layer. I don't know ...