Skin Transparency

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

Moderators: Lapo, Bax

User avatar
foxboy
Posts: 110
Joined: 12 May 2011, 02:47
Location: Optimal Solution Pte. Ltd.

Skin Transparency

Postby foxboy » 25 Jul 2011, 12:43

I have just started learning OpenSpace and playing around the Flex demo version on SFS2X.

I tried extending the Furnitures.swf library by modifying the Furnitures.fla file on Flash CS5 and add my own graphics which are in PNG format. I converted them to a sprite by clicking Create Symbol and then Export to ActionScript. Then I put a class name for AS Linkage and then the Base Class is: flash.display.Sprite as recommended by the OpenSpace Map tutorial.

I was able to add my own graphics on the sample maps using the OS Editor and it rendered well when I executed the demo app. However, I noticed something. When I clicked an open tile beside the tranparent part of my graphic, the avatar doesn't respond to move there. But if I click on the tranparent side of another graphic that is supplied by the demo (e.g. Tree) the avatar responds and moves towards it.

Therefore, OpenSpace is not able to detect the transparency of my graphic images, because if I click on the area within the bounding box of my graphics, OpenSpace is still thinking that it is still part of the image that is why no avatar movement is done. How can I fix this problem? Is there any documentation on how to import PNG files to the library properly?
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 25 Jul 2011, 13:04

Please read the grey box at the bottom of the "Skin separation approach" paragraph in this tutorial: http://openspace-engine.com/support/tutorials/mapStructure
Paolo Bax
The SmartFoxServer Team
User avatar
foxboy
Posts: 110
Joined: 12 May 2011, 02:47
Location: Optimal Solution Pte. Ltd.

Postby foxboy » 25 Jul 2011, 13:19

bax wrote:Please read the grey box at the bottom of the "Skin separation approach" paragraph in this tutorial: http://openspace-engine.com/support/tutorials/mapStructure


Thanks for the prompt response Bax :)

So where do I define these?

private var _os_id:String;
public function get os_id():String { return _os_id; }
public function set os_id(value:String):void { _os_id = value; }

I actually added my assets on the furniture.fla file from the demo and then publish it and reimport to the SWF Manager of the OS Editor so I can create a tile out them. Do I need to define the above code for each graphic asset that I will add to the library so the transparency can be detected by OpenSpace at runtime?
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 25 Jul 2011, 13:23

You are reading the wrong gray box. Check at the end of the "Skin separation approach" paragraph.
Paolo Bax
The SmartFoxServer Team
User avatar
foxboy
Posts: 110
Joined: 12 May 2011, 02:47
Location: Optimal Solution Pte. Ltd.

Postby foxboy » 25 Jul 2011, 13:42

bax wrote:You are reading the wrong gray box. Check at the end of the "Skin separation approach" paragraph.


Oh I see, how could I ignored that part when I'm reading the tutorial :) Thanks bax, I will give it a try.

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 32 guests