I noticed another issue (not sure if this introduced with 2012.8.1 or if it was already present).
The documentation for Sprite:addChildAt(child,index) says that indices start at 1, so in theory :addChildAt(child,1) should add a sprite as the first child of the parent, in fact it adds it AFTER the first child making it the second child in the chain.
However :addChild(child,0) works and add's the child correctly at the start of the chain.
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
What scares me is that fixing this bug will change the behaviour of addChildAt. I hope fixing will effect your games only a little.
Thank you @techdojo.
Obviously making sure all the edge cases are checked so you can't add at position 6 if there are only 4 entries in the list.
Failing that (assuming you do fix the bug) can you leave in a check so that inserting at position 0 has the same effect as inserting at position 1 please ???
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
I have not checked all of my code whether I have write something like addChildAt(0).
I think to keep consistent, it would be better to subtract 1 from the index in addChildAt, but if the index is already 0, just keep it untouched,is that OK?
And addChildAt(1) will add the child as the first child and the original child at index 1 will move index 2 just the same as the insert for table.(Currently addChildAt(1) will add child at index 2 and it's a little confused)
https://sites.google.com/site/xraystudiogame
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
IMHO, If we don't change this function now, it'll cause more trouble in the future. What do you think?
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
Would actually be really useful as I want to experiment with caching a sprite group as a single bitmap to see if I can improve performance with my table view control.
*squeak squeak*
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
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
sorry for being one-liner, cant resist the urge
http://www.nightspade.com
Besides @Atilim know's we love him and we'll just wait patiently, but a gentle reminder from time to time can't hurt much, can it ???
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
Squeak, squeak
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
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
Likes: OZApps
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
Likes: techdojo, atilim
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