Questions tagged [ccsprite]

CCSprite is a 2D image that is integrated into a larger scene in cocos2d, which normally represents a character or object in a cocos2d game.

CCSprite is a class inheriting from CCNode, which normally represents characters or objects displayed in the cocos2d games.

In computer graphics, a sprite is a two-dimensional image or animation that is integrated into a larger scene. A cocos2d' CCSprite is like any other computer sprite. It is a 2D image that can be moved, rotated, scaled, animated, etc.

  • CCSprite can be created with an image, or with a sub-rectangle of an image.

  • CCSprites can have other sprites as children. When a parent is transformed, all its children are transformed as well.

  • Since CCSprite is subclass of CCNode, they can be transformed manually or by using CCActions.

You can find the details about sprites on Wikipedia.

The CCSprite class reference is given at: http://www.cocos2d-iphone.org/api-ref/latest-stable/interface_c_c_sprite.html

424 questions
0
votes
1 answer

Superclasses for a CCSprite

After some research, I can't find anything on super classes, so I decided to ask here. Example @interface superClass : CCSprite @end @interface subClass : superClass @end How do the two above examples relate to each other? Also, I was shown that…
akuritsu
  • 440
  • 1
  • 4
  • 18
0
votes
1 answer

cocos 2d inherit CCSprite, can't acces method

It might be that I am missing something fundamental. I have made a class that inherits CCSprite, called Dude. In my layer I add the object dude, which works correctly: it shows on the screen. Everything goes well, until I touch the screen. Somehow…
Buleria
  • 3
  • 1
0
votes
1 answer

CCSprite + NSCoding

I have subclassed NSCoding and added my game specific stuff to it such as health etc. I have serialised the object I have subclassed however upon decoding and then adding the sprite to the screen via [self addChild:sprite], it fails to draw the…
godzilla
  • 3,005
  • 7
  • 44
  • 60
0
votes
1 answer

Animating Cartoon Sprite using CDAudioManager in Cocos2D

In my application I have a cartoon animation, with two characters that speak with each other. I need to animate their mouth, to give the impression of synchronism between the speech and the opening/closing of their mouth. I know that CDAudioManager…
neowinston
  • 7,584
  • 10
  • 52
  • 83
0
votes
2 answers

Creating a scrollview

Here's my current situation: I created a CCScene named StoreScene. Within that scene, I've initialized a CCLayer and just named it Store layer. Now, I want a scrollable layer that contains content which the user can touch. To do this, I created…
waylonion
  • 6,866
  • 8
  • 51
  • 92
0
votes
1 answer

why CCAnimation does not use CCSpriteBatchNode to print its images?

why CCSpriteBatchNode is not explicitly used with CCAnimation ? instead we use the following : (instead of adding each image to the batchNode and let the batchNode print those images, the code only uses spriteFrameByName) : CCSpriteBatchNode…
Paul
  • 6,108
  • 14
  • 72
  • 128
0
votes
3 answers

cocos2d CCSprite + animation repeat?

I'm developing a game and I give the user the oportunity to fire cannons. the fire animation is cached, but it has 25px width and the fire sometimes gets to 150px. so, if I fire 4 cannons, with 150px width (sth like level 6) I'm currently creating…
Agustin
  • 163
  • 2
  • 9
-1
votes
1 answer

How can CCSprite load ImageURL

UIImageView *imageView = [[UIImageView alloc] init]; [ImageViewHelper setImageURL:productInfo.ImageUrl forImageView:imageView]; CCSprite *imageSprite = [CCSprite spriteWithCGImage:imageView.image.CGImage key:productInfo.ImageUrl]; setImageURL:…
Pis.Y.Chen
  • 13
  • 7
-1
votes
1 answer

How to get unique letter from CCLabelTTF sprite when touch moved in cocos2d

I have a 8x8 matrix of alphabet letters game,when I move touch into label,label value repeated,how to overcome this problem,letters are in random position in 8x8 matrix. -(void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch…
-1
votes
2 answers

From Spritebuilder to Xcode CCSprite

I have a Question, I added an CCSprite with Image, now I want to work on this CCSprite in XCode, but I don't know how can I link it? Yeah I know thats, a easy question, but not for me, Can you help me? Have I used a Custom Class name?
J0k3R
  • 303
  • 1
  • 14
-1
votes
2 answers

For the return value of the CCSprite

I do not know the return value of cocos2d::sprite of Cocos2dx. Any errors that would not occur What if I return. Version of Cocos2dx is 3.2 cocos2d::Sprite makeSprite::make(){ cocos2d::Sprite *testSprite = cocos2d::Sprite::create("test.png"); …
user3985053
-1
votes
1 answer

Issue with Repeated Vertical Scrolling Image

I am trying to create a repeating background from top to bottom. I have got the background to actually scroll however there's a black area that appears with each repetition. I'm not entirely sure why this is happening... Below is my code: -…
-1
votes
1 answer

Cocos2d fix sprite on screen?

example fix sprite on top_right ShowLabelScore = [CCSprite spriteWithFile:@"showscore.png"]; ShowLabelScore.position = ccp(515,300); < top right [self addChild:ShowLabelScore]; but move tiles game self.position =…
-1
votes
1 answer

CGRectIntersectsRect condition is true calls multiple times

I'm new to cocos2D , I have problem in detect collision method , the CGRectIntersectsRect is true even the object is removed, after the collision and need to show 100+ texted CCLabelTTF once , but it is add multiple times. below the…
-1
votes
1 answer

Trying to add an array of sprites to the screen in cocos2d?

I'm trying to add an array of berries to the screen and have them move across to the left. It references a plist which includes the levels. I adapted this from the Ray Winderlich Space Game tutorial. No sprites are showing up on the screen.…
Surz
  • 984
  • 3
  • 11
  • 36
1 2 3
28
29