I have a class which mimics a button. It contains one label, which I'm trying to align centrally (horizontally). No matter what I try, the label stays on the left hand side, leading me to think this is more complicated than it seems. Here's the only…
I am coding a modal layer in cocos2d and I would like to use the OpenGL glScissor API call to crop the inside of a CCScrollLayer that I am using,
Basically,
Present some kind of Modal sprite
Put CCScrollLayer with assets on the modal sprite
I want…
I have a CCScene which already holds my gameLayer and I am trying to add HUD layer on that.But the HUD layer is not getting added in my scene, I can say that because I have set up a CCLabel on HUD layer and when I run my project, I cannot see that…
I have a CCLayer containing a number of other CCLayers (like items of text etc). I have another CCLayer to the left hand side with which I want to display thumbnails of a number of these 'scenes'.
The left hand CCScrollLayer should respond to…
I'm using Cocos2d to drag sprite around, and trying to add a border if a sprite is selected. I can get my white background to display, but my border is proving particularly difficult. I have this code:
if(self.selectedSprite)
self.selectedSprite…
I have a CCLayer subclass MyLayer in which I handle touch events:
(BOOL) ccTouchBegan:(UITouch *) touch withEvent:(UIEvent *) event
I set the content size of MyLayer instances like this:
`myLayer.contentSize = CGSizeMake(30.0, 30.0);`
I then add…
I want to create a cclayer with 4-5 flying objects, flying in random directions on screen. I also want those flying objects transparent to each other, which means they can fly through each other.
What I can think of Ways to do:
With Box2D
Create a…
I’m starting my development in Cocos2D and I wish to make this card effect you can see on the 0:26 second in this movie:
http://www.youtube.com/watch?v=7gn7Obeykm8
Is there any special Cocos2D Transition for this effect?
In my I've defined a CCLayer like this:
@interface MyLayer : CCLayer {
CCLayer * referenceLayer;
}
How should I declare it to use it in +(CCScene *) scene ?
Like this ?
@property (nonatomic, retain) CCLayer *referenceLayer;
I am working with Cocos2d. I am trying to make a "trail" using a CGPath. The CGPath is on screen I have NSLogged it. The "trail" or CGPath isn't visible.
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
…
I want to set the contentsize of scrollayer.
I have a scrollayer, it's CCLayer type and moving is set by ccTouchMove. I have one schedule for smoothing. BUT.
Problem is that scrolling layer is big like the whole display. I want to set the…
In my application I am noticing that there are may things that don't seem right in my CCScene.
Ill just explain 3 things:
1. My FPS does not show anywhere in the view even though I do this from my UIViewController (My CCLayer is its own class)
The…
*Working Code Now*
OK, I thought that this would be easy to get working but it turns out to not work like I expected.
I am trying to get the Touch location from a CCLayer that can be moved or zoomed, not the location on the screen itself? here is…