OpenSpace Editor » Tile editor
The Tile editor allows map designers to create the tiles required to build supertiles, maps and inventory items using the Supertile editor, the Map editor and the Inventory editor respectively.
Tiles are described in depth in the The map structure tutorial.
A tile is defined by the following properties.
|id||The tile’s unique id, automatically generated by the Editor.
The t prefix stands for tile.
|topElevation||The elevation of the upper side of the tile; it must be greater than or equal to bottomElevation. Default value is 0.|
|bottomElevation||The elevation of the lower side of the tile; it must be greater than or equal to 0. If the bottomElevation is greater than 0, underpasses can be created (if its stature defined in the <AvatarTypes> section of the OpenSpace server-side configuration is lower than bottomElevation, an avatar will be able to walk below the tile). Default value is 0.|
|slopeDir||The tile's slope direction. The slope goes from bottomElevation to topElevation. The available values are:
By default a tile is not a slope.
|walkable||If true, avatars are allowed to step on the tile's top side (or inclined side, if the tile is a slope). Tile walkability can be affected by the terrain property too.
The default value is false.
|skinsOnTop||If true, when an avatar enters the tile, it will be placed behind the tile's skins (by default the avatar is always in front of the skins of the tile it is currently walking on). The default value is false.|
|terrain||A name identifying a terrain among those defined in the <Terrains> section of the OpenSpace server-side configuration.
A terrain can alter the speed of the avatar walking on the tile, or even prevent the avatar from stepping on it (depending on the avatar type configuration set in the <AvatarTypes> section of the server-side settings).
By default a tile has no terrain assigned.
|allowDrop||If true, during the runtime map editing users are allowed to drop items on the tile. Setting this property to false can be useful to prevent users from placing items in wrong or illogic locations (for example a piece of furniture right in front of a door, or a chair above a plant, etc.).
The default value is false.
|title||The tile’s name displayed in the tiles library.|
|keywords||The keywords that describe the tile, useful to filter the tiles library. All the keywords must be separated by a comma.|
Adding skins to a tile
A tile can be empty, or contain one or more skins. The so called empty tiles are useful to define basic walkable areas over the map background when building a map.
A skin instance can be added to the currently edited tile by double clicking it the skins library on the right, or by selecting it and then pressing the Add skin to tile button.
When clicking on a skin instance in the preview area, a selection highlighter appears. This shows the skin's id and title in its bottom-left corner. Clicking on the background or pressing the ESC key on the keyboard deselects the skin.
To remove the skin instance click the X icon in the top-right corner of the selection highlighter, or press the CANC key on the keyboard.
Skin instance properties
When a skin instance is selected in the preview area, it is possible to edit some properties by opening the Instance properties panel (click on the button in the bottom-left corner of the main viewport area).
The following properties are available.
|Name||A unique name to be assigned to the skin instance within the tile. The OpenSpace component passes this value to the name property of the skin's flash.display.DisplayObject upon creation at runtime.
The instance name can be useful to access the skin’s sprite/movieclip from the main application by means of the IOpenSpace.getSkinByName and IOpenSpace.getAllSkinsByName methods of the OpenSpace client-side API, for example to show an animation when a specific event occurs.
|Custom params||A string containing a list of custom parameters to be passed to the skin’s sprite/movieclip upon creation at runtime. The parameters must be divided using the separator declared in the project’s creation panel (see the Create a new project paragraph in the Editor's Main menu description).
In order to be able to handle the custom parameters, the skin class must contain the following method:
public function setCustomParams(params:Array):voidWhen the skin instance is created by the OpenSpace Editor itself, or by the OpenSpace component at runtime, if the setCustomParams method exists, it is called and the custom parameters are passed as an array.
These parameters can be useful to setup skins at runtime: for example the skins library could contain a “Chair” class and a custom parameter could be used to set its color (instead of having multiple classes, one per available color).
Skin instance triggers
The Instance properties panel also shows a specific section containing the fields to setup one or more skin triggers and a table to review/remove the existing triggers. Triggers are useful to make the OpenSpace component fire specific events at runtime, when the user interacts with the skin by clicking it or by rolling the mouse pointer over or out of it.
More informations on events that can be triggered by a skin are available in the Trigger class description in the OpenSpace client-side API reference documentation.
Each trigger is defined by the following properties:
|Type||The trigger type, used by OpenSpace to determine which event should be fired at runtime. Available values are click, rollOver and rollOut.|
|Target||An all-purpose field to store additional trigger data.
This property can be used to store custom informations that will be passed to the event listener when the event is triggered.
For example this property could contain the instance name of another skin (even belonging to another tile) on the map, to create a logical connection between the skin triggering the event and a different skin that should animate. This is useful to create an hot spot (like a button on a console in the virtual world) which causes an animation to be played inside another skin (like a door opening when the button is clicked).
|Params||An all-purpose field to store additional trigger data.
This property can be used to store custom informations that will be passed to the event listener once the event is triggered.
For example this property could contain several comma-separated parameters. These parameters can be useful to take specific actions on the trigger's target (in the above button-door example, the door opening animation could be followed by the loading of a new map, with its id being declared in this Params field).
|All avatars||This property is ignored because it has no meaning on skin instances.|
To remove a trigger, click on the X icon in the triggers' table.
Using the Show tile wireframe and Solid wireframe checkboxes it is possible to show/hide the tile’s reference frame.
The Show avatar checkbox is not yet supported.
Next: Supertile editor