Sorry if this is a daft question but...
I'm planning on writing a widget ui library and I was wondering would it be better to create a button class by extending a sprite or a bitmap.
If I extend a bitmap, do I have to provide the same parameters to .new (ie the Texture or Texture region) if not how do I call the parent constructor with the appropriate texture?
Lastly - as bitmap is derived from a sprite, I'm assuming it's possible to call addChild on the bitmap, if so is the parent bitmap drawn first and then the children or is the parent bitmap drawn last?
WhiteTree Games - Home, home on the web, where the bits and bytes they do play!
#MakeABetterGame! "Never give up, Never
NEVER give up!" -
Winston Churchill
Comments
I would extend from Sprite. (and then I would create a Bitmap and add as a child at init)
> If I extend a bitmap, do I have to provide the same parameters to .new
yes. and this is the only way. currently we don't provide a method like super.
For all classes derived from Sprite (Bitmap, TileMap, TextField, Shape, etc) first the graphics item itself is drawn first and then the children are drawn last.
As for the child draw order, that probably makes more sense to do it that way
Thanks for the help
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill