CCSprite class reference

I need an object in which I can draw and it also has fixed rect size with position. It seems CCSprite has everything I need but it can be initialized with picture only.

CCLayer can be initialized without picture but it hasn't rect. I have found content size only.

So what to do if I need an object similar to CCSprite, but I don't wan't to use pictures?

EDITED

I mean I need a Rect to detect touches. And CCSprite can be defined with a static method spriteWithTexture:rect:, where I can manually set its rect. But what to do if I don't want to set texture, but rect only?

有帮助吗?

解决方案

You can create a sub class of CCNode and override its draw method.

You can look here for more detail

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top