Avatar hitArea definition

Post here your questions about the OpenSpace 1.x or notify bugs and suggestions.

Moderators: Lapo, Bax

FrankiD
Posts: 5
Joined: 26 Oct 2009, 13:03

Avatar hitArea definition

Postby FrankiD » 09 Nov 2009, 12:12

My Avatar skins consist of a sequence of png´s which are 350 x 350 pix. The actual avatar graphic is centered in these png´s and measure about 100 x 100 pix. in the ‘walk’ and the ‘stand’ action. So there is a relatively large amount of transparent area around it. The reason for this is that I need other actions as well. During these actions the avatar graphic will measure up to 350 x 350 pix. (this way the png production will be easier).

The problem:

1. I need to be able to use mouseEvents, but as it is now OS react to the whole png, which it should´nt do. I need to be able to define a hitArea that only is in the center of the avatar. So that it do not register any mouseEvents when I mouseOver the transparent piece of the png.
2. Also I can not go to (register clicks on) any of the tiles in the area around the avatar, which is a serious problem. (Especially when there a 20 users on the map).

I have tried moving all the skin MovieClips into a movieClip container which I have set mouseEnabled and mouseChildren to false on, with no result. I have tried setting mouseEnabled and mouseChildren to false at the MainAvatar class as well (no result).

I have also tried setting all the avatar Related mouse options to ‘0’ in the Open Space
Config xml (result).

Please help

Thx
FrankiD
Posts: 5
Joined: 26 Oct 2009, 13:03

Postby FrankiD » 11 Nov 2009, 09:21

I´ve masked the MovieClip that contains the avatar pngs. It helps of course, but it is just not good enough. Anyone?

How does OS handle/set/register the hitArea on the Avatar. Should the graphics be converted to vector to achive what i want?
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 12 Nov 2009, 10:06

Our suggestion is to remove the transparent pixels from the PNGs.
Check this article: http://kb2.adobe.com/cps/128/tn_12804.html
Paolo Bax
The SmartFoxServer Team
FrankiD
Posts: 5
Joined: 26 Oct 2009, 13:03

Postby FrankiD » 16 Nov 2009, 07:53

bax wrote:Our suggestion is to remove the transparent pixels from the PNGs.
Check this article: http://kb2.adobe.com/cps/128/tn_12804.html


Okay. As I understand it, it means that we need to do the ‘break apart’-sequence on every single PNG? The thing is, we have like 100.000 images in a lot of swfs, and we need to update these swfs frequently. Therefore we have not got the time to do a lot of stuff in Flash with a single image. Could there be an easier way (Using code to do the hard work or something like that, change the way the pngs are rendered)?
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 16 Nov 2009, 08:07

Unfortunately this is the only way you can do it. Not sure if the same can be done via ActionScript.
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v1 discussions and help”

Who is online

Users browsing this forum: No registered users and 42 guests