Hi friends,
(I write my questions in a FAQ style so that it's better indexed for people that might search for it later)
If I have a Sprite A that belongs to a SpriteSubgroup, that belongs to a SpriteGroup :
So we have SpriteGroup > SpriteSubGroup > SpriteA
SpriteGroup is moving and scaled (ex : *.5).
SpriteSubGroup is moving also, has its own scale (ex : *2), inside SpriteGroup, with its own speed.
SpriteA is moving also, has its own scale (ex : *.3) inside SpriteSubGroup, with its own speed.
How would you detect if SpriteA is visible on screen, whatever scale and local position it is?
I believe it has to deal with localToGloba() or globalToLocal() but I couldn't understand how to use it.
How do you deal with it?
thank you!
Comments
For those who might be looking for the answer later :
1. A working sample by @atilim :
Source 2. A discussion on the topic :
How does globalToLocal and localToGlobal really work?