I'm not sure if this is a bug or a "feature".
But if you have a parent sprite with several children, the sprites width and height reflect the extent of ALL of the children, even if one or more of them has been "hidden" with Sprite:setVisible(false) - and as such can lead to confusion with positioning, touch events (especially if you use Sprite:hitTestPoint() ) etc.
I haven't tried it yet with Sprite:getBounds() so I don't know if that exhibits the same "issue"
Personally I'd say it was a bug - but there might be a good reason why they are included, anybody care to shed some light on the issue?
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 suppose if need's be I could always store a copy of the offending element somewhere else and actually remove it from the parent group.
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
I'm not meaning the invisible children of the sprite.
Maybe defined as
Sprite:hitTestPoint(x, y, bOpaque)
if bOpaque is true, make further check after the orignal hitTestPoint return true.
https://sites.google.com/site/xraystudiogame
:-))
Likes: atilim
https://sites.google.com/site/xraystudiogame
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Also, does it mean that getPixel() and setPixel() 's availability would become one step closer?
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill