going through a list of a tile's skins

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

Moderators: Lapo, Bax

ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

going through a list of a tile's skins

Postby ffourcad » 16 Apr 2010, 14:07

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 ?
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 16 Apr 2010, 15:29

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)
   {
      ...
   }
}
Paolo Bax
The SmartFoxServer Team
ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Postby ffourcad » 19 Apr 2010, 07:43

Yes, i thought about this solution, but was not the best way, so I hoped there was something available for that.
warhell
Posts: 199
Joined: 18 Aug 2007, 16:49
Location: Silicon Valley, CA
Contact:

Postby warhell » 19 Apr 2010, 16:53

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.
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 20 Apr 2010, 08:26

You can retrieve tiles using the getTileByCoordinate method. Not supertiles.
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 57 guests