Unique Supertile Instance Mouse Events

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

Moderators: Lapo, Bax

Post Reply
ohanyan
Posts: 8
Joined: 10 Nov 2009, 23:13

Unique Supertile Instance Mouse Events

Post by ohanyan »

All of my InventoryItems are composed of SuperTiles. I would like to associate a unique event (or associate a unique identifier) to each instance of that InventoryItem when a user clicks on it.

How can I go about doing this?

Thank You.
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

Among the clicked tile properties you have the groupId. You can then call the IOpenSpaceAPI.getGroup(groupId:String) method to retrieve all the tiles belonging to that group.
Paolo Bax
The SmartFoxServer Team
ohanyan
Posts: 8
Joined: 10 Nov 2009, 23:13

Post by ohanyan »

How do I assign names to the tiles of a supertile when dragging the inventoryItem into the map in editMode. Currently I am able to assign tileInstName when dragging an inventory item Only if it is a Tile. The names of all the tiles for a groupId are "" when I use getGroup(groupId).
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

You can't, just like you can't do it in the Editor.
Tile names during the editing can be assigned only to single tiles, not to tiles belonging to groups.
Paolo Bax
The SmartFoxServer Team
Post Reply