Page 1 of 1

Acces tile's skin references after map is generated.

Posted: 14 Oct 2013, 09:06
by radiateur
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 ?

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

Posted: 15 Oct 2013, 13:39
by Bax
Give the tile containing a relevant skin an instance name in the Editor, then use the IOpenSpaceAPI.getSkinByName method.

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

Posted: 22 Oct 2013, 08:13
by radiateur
Thank you Bax :)

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

Posted: 06 Dec 2013, 16:22
by radiateur
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" ?

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

Posted: 06 Dec 2013, 16:59
by Bax
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.

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

Posted: 09 Dec 2013, 14:16
by radiateur
Great, thank you bax ^^

PS : I'm so happy i almost finished the development x)

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

Posted: 09 Dec 2013, 15:04
by Bax
Great! We will be happy to see the final result of your work.