Page 1 of 1
going through a list of a tile's skins
Posted: 16 Apr 2010, 14:07
by ffourcad
Hello, I would like to browse all the skins of a tile, without knowing the names of the skins (actually, they are called wall1, wall2, wall3, or/and wall4), but with only the getTopSkin() and getSkinByName(), i can't browse them, since I don't know which walls are in the tile.
Is there some way to achieve this, or could you add this method to the tile class ?
Posted: 16 Apr 2010, 15:29
by Bax
There are no other methods on the Tile (and we have closed development until the official release), but you could simply use a for-loop in this case:
Code: Select all
for (var i = 1; i <= 4; i++)
{
var skin:Sprite = tile.getSkinByName("wall" + i)
if (skin != null)
{
...
}
}
Posted: 19 Apr 2010, 07:43
by ffourcad
Yes, i thought about this solution, but was not the best way, so I hoped there was something available for that.
Posted: 19 Apr 2010, 16:53
by warhell
What about getting all the tiles/supertiles in a particular x,y coordinate? For this, you can assume that I only use supertiles in my game.
Posted: 20 Apr 2010, 08:26
by Bax
You can retrieve tiles using the getTileByCoordinate method. Not supertiles.