|
|||
Graphic Libraries |
|||
1. TIE map objects and libraries |
|||
Theo Isometric Engine (TIE) maps can contain three types of map objects: floor tiles, furniture and characters.
Map objects are organized in libraries. You can see the libraries that come with this SDK in the "library"folder - they are called floor.xml, furniture.xml and characters.xml. A library is basically an XML file that lists the map objects of one type. This is how floor.xml looks like:
The line in bold represents one map object - in this case a floor tile. The main attribute, called "url", is the location of the SWF file that contains the image of this object. Other attributes are described below. TIE can use multiple libraries, which makes it very flexible - you can assemble map objects into different libraries, using just the ones you need. Do not mix map objects of different types inside one library. |
|||
2. Maps, libraries and maps objects |
|||
TIE maps are defined as XML files that contain the map parameters and also the list of the objects that are placed on the map. Those XML files can be generated using Map Editor or simply modified by hands in any text editor. Below is an example how maps, libraries and map objects interconnect:
|
|||
2. Floor tiles and Furniture |
|||
Each floor tile and furniture object has to be placed in a separate SWF file, which is linked from the library XML file. You can find the source FLA files for the objects that come with this SDK in "library/fla" folder. The structure of a floor tile or a furniture SWF file is the same - it's a simple movieclip with one or more frames. The guidelines intersection indicates the middle of the map tile so you can align your object properly. You can have multiple variations of the same object, mostly used for storing object images that point in different directions (up to eight). Once you created the SWF file, you have to point to it from a library. Here is an example: <i id="1" url="library/floor/g001.swf"/>
The furniture map objects share the same parameters, except objectShape, plus an extra one:
2.1 Tiles and furniture triggered actionsYou can assign a specific action to a tile or a furniture object in order to trigger it once the character steps on it. Check demo#8 for an example of tiles and map objects that trigger the character to jump over them: http://www.theoworlds.com/labs/08/. An example of a furniture/action combo is the chair - it triggers the character sitting animation when the character reaches it. We will explain it using the teleports - tiles with actions that make the character "jump" to another map. Here is an example of a teleport (a fragment from a map XML file):
There are two different places to add an action to a map object: through the library XML or through the map XML:
|
|||
3. Characters |
|||
Characters graphics are stored in separate SWF files with a strictly defined structure. This SDK comes with two characters - woman.swf and man.swf. The sources of these files are located in "/library/fla/".
The characters SWF files contain all the character animations. The ones that come with TWB contain the walking animation in all 8 directions, plus the dancing animation and the sitting pose. For all those animations the clothes/accessories animation layers are also included. The frame labels are important and are used to organize all the frames. Study the FLAs that come with this SDK in case you want to create your own characters.
3.1 Characters actions (animations)The character library file has a more complex structure, since it contains also information about character actions (animation). Here is an example (fragment):
Each <i> block represents one character. The code in bold describes the man.swf character and all the animations it contains. The first line defines the main attributes and the location of the SWF, similar to furniture library:
Here are the parameters used:
The next block <actions> lists all the animations the character contains - each action in it's <a> block. Example:
The list of allowed attributes are:
All the animation defined in the character's library XML file have to be present in the character SWF file, with the frames marked correspondingly: animation name + underscore + direction name. For example, for the default_walk animation, that has animations in all 8 directions, we will have the frames named: default_walk_down, default_walk_down_left, default_walk_left, default_walk_up_left, default_walk_up, default_walk_up_right, default_walk_right and default_walk_down_right.
3.2 Characters layers (clothes and accessories)You can add layers to the characters, if you plan to modify them in any way - like clothes and accessories (sunglasses, etc). In order to do that you need to define the actions in the character XML library and also to have to corresponding graphics layers inside the character's SWF. Here is how the actions are defined in the character's XML description: <items> You have to declare the layers in the XML only if you want to control then in any way (show and hide). Otherwise you can just skip them (like the character body, if it never changes and is never hidden). The simplest layer looks like:
Note that you can group layers in groups (like all the T-shirts) to interchange them (change character's t-shirt, while having just one on at a time). Sub-groups are also supported. Note that in the character's SWF all the clothes layers are on the same timeline, as separate layers, but without any nesting/grouping. This is why the layer name in the XML should be unique: <layer name="accessory1"/>. There is an additional parameter for groups - "required" - used like this:
When required=1, it means that this group of layers is mandatory and the character should wear one of the layers from this group. This way you can ensure that your character always has the pants on, for example. All the layers declared in the XML should have the corresponding layers in the timeline, with the movieclips on them containing that layers graphics and named (the movieclips) exactly the same (as the layer names in the XML). For the code above, there should be a movieclip called "bottom1", for example.
|
|||
4. The Catalog |
|||
The Catalog is an XML file (catalogue.xml in the main folder) that stores the references to all the libraries, all the available backgrounds and foregrounds and also the list of the available maps (in case you want to have access to them in Map Editor - for re-editing).
The catalog.xml is used by the Map Editor in order to be able to reference all this information.
When the Map Editor generates a map, it includes all the needed references to the libraries and backgrounds/foregrounds automatically.
This is how catalog.xml looks like:
|
|||
Last updated: September 16, 2009 |