Cocos2d: Making a CocosNode subclass
Hi!
Im getting into iPhone game development with Cocos2d.
I'm trying to make a class for my character that contains various animations/sprites and some additional functionality that I want to be able to add to the Scene or Layer directly through addChild().
I figured that inheriting the CocosNode should be a good start, but what functions/properties are used to return the actually texture data that's beeing displayed on the layer? In other words, what do i need to implement for my class to show up when added to the scene?
Thanks in advance!
Im getting into iPhone game development with Cocos2d.
I'm trying to make a class for my character that contains various animations/sprites and some additional functionality that I want to be able to add to the Scene or Layer directly through addChild().
I figured that inheriting the CocosNode should be a good start, but what functions/properties are used to return the actually texture data that's beeing displayed on the layer? In other words, what do i need to implement for my class to show up when added to the scene?
Thanks in advance!
If I recall correctly Cocos2d has a Sprite class which takes a UIImage I believe. Use that in your draw function
"When you dream, there are no rules..."
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| UIView Subclass not displaying controls... | flipflop | 7 | 5,901 |
May 13, 2010 01:16 PM Last Post: flipflop |
|

