Rendering your avatar elsewhere

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

Moderators: Lapo, Bax

User avatar
kevinc
Posts: 4
Joined: 22 Dec 2009, 23:48

Rendering your avatar elsewhere

Postby kevinc » 22 Dec 2009, 23:53

I'm creating a 'Customize your avatar' user interface. The users can change hair, glasses, hats, clothes etc. I'd like to show their character beside these custom options. The character will be updated as they select new clothes, hair etc. Is it possible to render the character again somehow? What would be your advice on how to do this?

Thanks
5th gear tapped wide... ya can't lose
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 24 Dec 2009, 09:11

So you have OpenSpace running, with the user avatar on the map, and you want it to change accordingly to the changes the user makes in your "Customize your avatar" interface?
Well, you simply have to call the OpenSpace.setMyAvatarSkin method passing an object describing the new avatar appearance (check the examples provided with OpenSpace, you have a button to modify the avatar appearance).
Of course the changes will be displayed on all the clients connected to the the same map.
Paolo Bax
The SmartFoxServer Team
User avatar
kevinc
Posts: 4
Joined: 22 Dec 2009, 23:48

Postby kevinc » 24 Dec 2009, 22:19

Inside my 'Customize your avatar' gui i want to show my avatar. This is NOT my avatar inside the OpenSpace map. I'd like the avatar to be a 'copy' of the ingame avatar. The user can make all the changes they want and if the choose to save then I can apply my changes with OpenSpace.setMyAvatarSkin.

Kind of like in YoVille where you have your customize options in the gui and beside the options you have a picture of your avatar and as you change the options the avatar updates.

Know what I mean?
5th gear tapped wide... ya can't lose
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 26 Dec 2009, 09:41

When you call the OpenSpace.setMyAvatarSkin method, OpenSpace internally calls the onSkinChange event listener on your avatar movieclip class.
You can do something similar: in your avatar movieclip class add your own method (for example setSkin) which handles the skin changes made during avatar customization (passing the same data you would pass to OpenSpace.setMyAvatarSkin).
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v1 discussions and help”

Who is online

Users browsing this forum: No registered users and 40 guests