Page 1 of 1

Avatar.init

Posted: 13 Oct 2010, 23:15
by svizzari
Hey -- Just wondering, should an avatar instance always be on the display list when it's init method is called?

Posted: 18 Oct 2010, 11:25
by Bax
Not necessarily. In fact the avatar could be out of sight when created, which means it isn't in the display list.

Posted: 18 Oct 2010, 20:32
by svizzari
hi bax -- I see...

The reason I asked was that my Avatar subclass implements the Flex ILayoutManagerClient interface to be able to be invalidated via the LayoutManager. Invalidation is core to our programmatic approach.

I was experiencing some strange behaviour from my Avatar subclasses related to when they were appearing on the display list and when they were first being invalidated.

So, would it be fair to say that, in OpenSpace, viewport management is achieved by adding and removing elements from the display list? From what I can see, the avatar.destroy method is only fired when the map is 'disposed of'.

Posted: 20 Oct 2010, 09:35
by Bax
svizzari wrote:So, would it be fair to say that, in OpenSpace, viewport management is achieved by adding and removing elements from the display list? From what I can see, the avatar.destroy method is only fired when the map is 'disposed of'.
Yes, that's exactly how OpenSpace works. To improve the scrolling performance, only visible tiles are added to the display list. As avatars are contained inside the tiles, they follow the same rule.
Also, the destroy method is called whenever an avatar leaves the map too.

Posted: 20 Oct 2010, 19:04
by svizzari
Hi bax -- so, referring back to an earlier post of mine, it sounds like the view related functionality already exists within the OpenSpace system to determine whether a particular tile is on-screen ;)