OpenSpace Editor » Inventory editor
The Inventory editor allows designers to create items that users will be able to drag on a map during the runtime editing process.
Inventory items are based on tiles or supertiles built in the respective editors. A single item is made of one or more assets (tiles or supertiles, but the two type can't be mixed) associated to the directions in which it can be rotated.
It is also possible to define custom properties common to the whole inventory, and assign them per-item values: in this way it is possible to categorize inventory items and filter them when the OpenSpace client requests the inventory to the server-side extension at runtime.
Using the Inventory editor
The interface of this editor sligthly differs from those of the other ones.
The left column contains the current inventory, that is the library of inventory items already created with this editor. Double click an item or select it and press the Edit item button to modify it.
Below the inventory, the Custom properties box allows defining a number of properties common to all the inventory items: enter the property name in the textbox below the list and press the Add button to create a new property; select a property name in the list and click the Delete property button to remove it. Removing an existing property will clear all its values set for the different inventory items.
The center column is the actual inventory item editor, where new items can be created and existing ones modified. Each item is defined by the following default properties.
|Id||The inventory item’s unique id.
This id can be passed to the inventory-related methods of the OpenSpace APIs at runtime.
|Assets type||The type of assets (tiles or supertiles) the inventory item is made of.
Depending on the selected type, the OpenSpace Editor populates the list in the right column of the interface, which contains all the assets of the selected type created in the Tile editor or Supertile editor.
|Assets||A list of assets (minimum 1, maximum 8) that are associated to the inventory item.
Each asset corresponds to a certain direction in which the item can be rotated at runtime, before being dragged on the map.
The Use 8 directions checkbox shows or hides the vertical and horizontal directions, which usually are not used.
In order to add an asset, select it in the list on the right and click the Add from library button of the corresponding direction. If an inventory item has just one view (in other words it can't be rotated), associating it with the first direction in the list is recommended.
In order to remove the association of an asset with the inventory item, click on the X button near that asset.
The center column also shows the textfields which can be used to set the values of the custom properties for the inventory item being edited.
Click on the Add item to inventory / Update inventory item button in the column's footer to create the inventory item or update it. Click on the Cancel button to cancel the current action.