| < Tools and actions | Index | Shapes > |
The Scene item describes a scene, which consists of several regions for mouse interactions. A character is a special kind of region that represents the player and is moved by the mouse.
For more information on how to build a scene with regions and a character and to get the correct 3D-feeling from 2D images and regions see scene layout.
| Item type | Scene |
|---|---|
| Description | The scene is the main place for the player to interact with the game. |
| Action | Makes this scene the current scene. If the scene is displayed from the inventory and it is already the current scene, the scene is closed and it is returned to the inventory. If the scene is the menu scene of the Game item, the menu scene is opened or closed again. |
| Condition | True, if the scene was already visited before. (The condition is set to true after the init action, so you can use it to test in the init action whether it is the first visit.) |
| Key | Type | Default | Description |
|---|---|---|---|
| description | string | "" | A short description of the scene. |
| image | Images | "" | The background image of the scene. |
| init | Actions | <> | The action to execute each time the scene is entered. |
| exit | Actions | <> | The action to execute each time the scene is left. |
| regions | [Regions] | [] | The initial list of regions of the scene. |
| background | colour | (-) | The background colour of the scene. |
| size | point | (0,0) | The Size of the scene; (0,0) means size of game. |
| offset | point | (0,0) | The offset (position) of the scene. |
| boundary | Shapes | <> | The boundary restricts the area to move for the character. |
| frontScale | int | 100 | Scaling factor (in percent) for character when positioned at the front (bottom) of the scene. |
| backScale | int | 100 | Scaling factor (in percent) for character when positioned at the back (top) of the scene. |
| perspective | int | 60 | Camera perspective (angle in degrees of field of view). |
| Item type | Region |
|---|---|
| Description | A region is a part of a scene. |
| Action | Redraws the region, if it is part of the current scene. |
| Condition | - |
| Key | Type | Default | Description |
|---|---|---|---|
| description | string | "" | A short description of the region. |
| position | point | (0,0) | The position of the region relativ to the upper left corner of the scene. |
| shape | Shapes | <> | The shape of the region. |
| image | Images | <> | The image of the region. |
| actions | [Action] | [] | The actions executed on a mouse click in the region. |
| init | Actions | <> | The action to execute when the cursor enters the region. |
| exit | Actions | <> | The action to execute when the cursor leaves the region. |
| press | Actions | <> | The action to execute when the mouse is pressed in the region or moved in again while pressed. |
| release | Actions | <> | The action to execute when the mouse is released in the region or moved out while pressed. |
| in | Actions | <> | The action to execute when the character enters the region. |
| out | Actions | <> | The action to execute when the character leaves the region. |
| distance | int | 0 | Distance of the shape/image to the ground. |
| boundary | Shapes | <> | Area excluded for character. (If none, shape/image is used.) |
| goto | [point] | [] | List of "attractors" for the character to approach (relative to center of boundary). |
Note: A region should have at least one shape or image to determine whether the mouse is over the region or not. If both are given, the image is only displayed but does not influence the form of the region. If the image is a transparent image, the transparency of the image determines the form of the region, otherwise the form is a rectangle with the size of the image.
Note: The boundary is the projection of a region to the ground. Therefore, it excludes this area of the scene from the player character to walk. If there is a boundary and the player clicks on the region, the character will not walk to the point clicked in the scene. Instead, it will approach the projection on the ground, i.e. the center of the boundary. To direct the character to another point, the goto-points give explicit attractors to walk to. The character then approaches the nearest goto-point.
Note: The in/out-keys are relative to the shape of the region, not the boundary. This is simply because the character never may walk into the boundary. Usually a region will either use a boundary, or in/out-keys, but not both together.
The character is a region, that represents the player and that is moved through the scene with the mouse. A scene usually contains not more than one character in its region list.
| Item type | Character |
|---|---|
| Description | The region in a scene that represents the player. |
| Action | - |
| Condition | - |
| Key | Type | Default | Description |
|---|---|---|---|
| description | string | A short description of the region. | |
| position | point | (0,0) | Initial position of character (center of bottom line). |
| angle | int | 0 | Initial orientation of character (angle). |
| orientation | int | 0 | Orientation of character images (angle). |
| imageStand | [Images] | List of images to use when character stands. | |
| imageWalk | [Images] | List of images to use when character walks. | |
| boundary | [Shapes] | List of boundaries of character. | |
| time | value | 0 | Time in ms for one time frame to walk. |
| distance | value | Distance to walk for each time frame. (1/10 pixel on x-axisfor scaling 100) | |
| mouse | bool | 0 | If true, the character is moved controlled by tools. |
| actions | [Action] | [] | The actions executed on a mouse click in the character region. |
| init | Actions | <> | The action to execute when the cursor enters the character region. |
| exit | Actions | <> | The action to execute when the cursor leaves the character region. |
| start | Actions | <> | The action to execute when the character starts to move. |
| stop | Actions | <> | The action to execute when the character stops to move. |
The lists imageStand, imageWalk and boundary determine the appearence and room of the character depending on its orientation. Each element is for one orientation, thus all lists usually have the same length. In any case, the orientation is represented with 360 degrees and then mapped onto that image/boundary that lies in the according sector, when all images are distributed equally around 360 degrees. The first image has the angle of the orientation key, where 0 degrees means to look straight out of the screen.
Espescially for the walking images, but also for the standing images, animated images may be used. In that case, the animation frames are synchronized, i.e. when changing orientation, the according frame of the new animation is used. Thus, all animations should have the same number of frames and the same timing. Also, the timing of the animations and the timing of the movement of the character must be synchronized by using appropriate values.
Note: If the mouse flag is true for more than one character in the region list of a scene, only the first one is controlled by the mouse. This gives you a simple way of changing the mouse control between characters by changing their order in the regions list.