Acces tile's skin references after map is generated.

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

Moderators: Lapo, Bax

radiateur
Posts: 62
Joined: 15 Aug 2011, 08:14

Acces tile's skin references after map is generated.

Postby radiateur » 14 Oct 2013, 09:06

Helllo,

I already know how to catch a mouse-event to a skin, and then fire a function to manipulate this skin : mySkin.gotoAndPlay("action");
It's easy because the Mouse-event send the Skin references, like this i can access position of the skin on the screen and else.

But what i don't know is the way to manipulate a tile's skin after the map is loaded and builded (to play automatic dialogues on pnjs) and get all its references (position x/y in for example) WITHOUT a mouse event or a player interaction on it.

So what would be the way to achieve this ?
User avatar
Bax
Site Admin
Posts: 4332
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Acces tile's skin references after map is generated.

Postby Bax » 15 Oct 2013, 13:39

Give the tile containing a relevant skin an instance name in the Editor, then use the IOpenSpaceAPI.getSkinByName method.
Paolo Bax
The SmartFoxServer Team
radiateur
Posts: 62
Joined: 15 Aug 2011, 08:14

Re: Acces tile's skin references after map is generated.

Postby radiateur » 22 Oct 2013, 08:13

Thank you Bax :)
radiateur
Posts: 62
Joined: 15 Aug 2011, 08:14

Re: Acces tile's skin references after map is generated.

Postby radiateur » 06 Dec 2013, 16:22

Hello,

I did like you said and it works very nice (thank you), but i have an extension of my question :
How could i access tiles located INSIDE a supertile ? By using a named supertile like this : "supertile.skin1" "supertile.skin2" ?
User avatar
Bax
Site Admin
Posts: 4332
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Acces tile's skin references after map is generated.

Postby Bax » 06 Dec 2013, 16:59

A supertile is nothing more than a group of tiles.
Using the IOpenSpaceAPI.getGroup() method you can retrieve all the tiles of the supertile. Now you have to look for the exact tile you need and proceed like explained before.
Paolo Bax
The SmartFoxServer Team
radiateur
Posts: 62
Joined: 15 Aug 2011, 08:14

Re: Acces tile's skin references after map is generated.

Postby radiateur » 09 Dec 2013, 14:16

Great, thank you bax ^^

PS : I'm so happy i almost finished the development x)
User avatar
Bax
Site Admin
Posts: 4332
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Acces tile's skin references after map is generated.

Postby Bax » 09 Dec 2013, 15:04

Great! We will be happy to see the final result of your work.
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 3 guests