Avatar.init
Avatar.init
Hey -- Just wondering, should an avatar instance always be on the display list when it's init method is called?
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'.
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'.
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.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'.
Also, the destroy method is called whenever an avatar leaves the map too.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team