开发者

Extending BitMap class. will addChild() accept subClasses?

I want to create a class that is interactive and can hold an image. I want it to be lighter then the Sprite class, so I was thinking about extending the bitMap class. If I extend the BitMap class. put a bitMap data in that class and at开发者_运维百科 it to the stage. would it appear ???


I greatly doubt that it will be much lighter than a Sprite, because if you are experiencing performance troubles, it probably has more to do with having a lot of display objects in your display list, rather than the type of those display objects.

But to answer your question, yes. Any object extending DisplayObject can be added to the display list. Bitmap inherits from DisplayObject, so if you extend Bitmap, so will your class.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜