< Tools and actions Index Shapes >

Scenes and Regions

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.

Scene

Item typeScene
DescriptionThe scene is the main place for the player to interact with the game.
ActionMakes 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.
ConditionTrue, 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.)

KeyTypeDefaultDescription
descriptionstring""A short description of the scene.
imageImages""The background image of the scene.
initActions<>The action to execute each time the scene is entered.
exitActions<>The action to execute each time the scene is left.
regions[Regions][]The initial list of regions of the scene.
backgroundcolour(-)The background colour of the scene.
sizepoint(0,0)The Size of the scene; (0,0) means size of game.
offsetpoint(0,0)The offset (position) of the scene.
boundaryShapes<>The boundary restricts the area to move for the character.
frontScaleint100Scaling factor (in percent) for character when positioned at the front (bottom) of the scene.
backScaleint100Scaling factor (in percent) for character when positioned at the back (top) of the scene.
perspectiveint60Camera perspective (angle in degrees of field of view).

Region

Item typeRegion
DescriptionA region is a part of a scene.
ActionRedraws the region, if it is part of the current scene.
Condition-

KeyTypeDefaultDescription
descriptionstring""A short description of the region.
positionpoint(0,0)The position of the region relativ to the upper left corner of the scene.
shapeShapes<>The shape of the region.
imageImages<>The image of the region.
actions[Action][]The actions executed on a mouse click in the region.
initActions<>The action to execute when the cursor enters the region.
exitActions<>The action to execute when the cursor leaves the region.
pressActions<>The action to execute when the mouse is pressed in the region or moved in again while pressed.
releaseActions<>The action to execute when the mouse is released in the region or moved out while pressed.
inActions<>The action to execute when the character enters the region.
outActions<>The action to execute when the character leaves the region.
distanceint0Distance of the shape/image to the ground.
boundaryShapes<>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.

Character

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 typeCharacter
DescriptionThe region in a scene that represents the player.
Action-
Condition-

KeyTypeDefaultDescription
descriptionstringA short description of the region.
positionpoint(0,0)Initial position of character (center of bottom line).
angleint0Initial orientation of character (angle).
orientationint0Orientation 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.
timevalue0Time in ms for one time frame to walk.
distancevalueDistance to walk for each time frame. (1/10 pixel on x-axisfor scaling 100)
mousebool0If true, the character is moved controlled by tools.
actions[Action][]The actions executed on a mouse click in the character region.
initActions<>The action to execute when the cursor enters the character region.
exitActions<>The action to execute when the cursor leaves the character region.
startActions<>The action to execute when the character starts to move.
stopActions<>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.