Cocos2d: Making a CocosNode subclass

Posts: 22
Joined: 2008.10
Post: #1

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!
Quote this message in a reply
Posts: 509
Joined: 2002.09
Post: #2
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..."
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  UIView Subclass not displaying controls... flipflop 7 10,027 May 13, 2010 01:16 PM
Last Post: flipflop