Hello to all, we need to change some properties of all the visible avatars in the map, the idea is to get all the visible avatars in the map, you have some idea of how to do that??
thank you in advance..
how to get a list of all the visible avatars in the map
-
josuedavid
- Posts: 7
- Joined: 24 Sep 2008, 11:58
hrm, I can only think of one approach at the moment, and it'd be an experiment.
As I understand it, only the tiles visible (plus a small buffer) are ever displayed... thus, it is possible that listening to the ENTER_TILE and EXIT_TILE events may provide you with enough information to determine if the specific avatar is visible, and track that information in a custom object.
Could be a simpler solution I am missing, and this could easily not work... this is just a guess atm.
As I understand it, only the tiles visible (plus a small buffer) are ever displayed... thus, it is possible that listening to the ENTER_TILE and EXIT_TILE events may provide you with enough information to determine if the specific avatar is visible, and track that information in a custom object.
Could be a simpler solution I am missing, and this could easily not work... this is just a guess atm.
There isn't an easy way to do this, also it really depends on how and when you need to do this. The sstark approach is valid if you need to monitor avatars continuously. Otherwise you may get a reference to each avatar by means of the (undocumented, sorry) OpenSpace.getAvatarMovieClipById(userId) method. In both cases you then need to evaluate if the avatar is visible or not. You may check if its parent tile is in the displaylist for example, or something like that.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team