Show / Hide Table of Contents

    Rooms

    The rooms are where the game takes place. A room can be a room in a house, or an outdoor location, or anything in between.

    The game can show only one room at a time. This would usually be the room where the player is, though you can change to a different room than the one the player is in if you want. Note: this is different than "Classic" AGS in which the room is explicitly tied to where the player is.

    Each room has:

    ID

    Each rooms should have a unique id (string) which identifies it to the engine.

    Background

    A background graphic for the room. The background is actually just a regular object so it can be animated or use any of the properties available on regular objects (refer to the Objects section for more information).

    Limits

    The room limits specify the boundaries for the camera. By default the room starts from (0,0) and ends with the background image size, but this can changed if needed (for example, if you want to have a "never-ending" room).

    Show Player?

    A flag indicating whether the player is to be shown in the room, for hiding the player from a map, for example. This is a convenience flag as this can be achieved by simply switching the room without moving the player to another room.

    Music clip to play

    An optional music clip you can play when switching to the room. If moved from another room with a music clip, there clips will be cross-faded, and you can configure the cross-fading duration and easing functions from IGame.AudioSettings.RoomMusicCrossFading.

    Viewport

    Instructs what part of the room to show on the screen. Refer to the Viewports section for more information.

    Areas

    A list of areas (or regions) that exist in the room (like areas in the room that the characters can walk in). There are several types of areas and things you can do with them, refer to the Areas section.

    Objects

    A list of objects that are placed in the room (note that unlike "Classic" AGS, objects can be moved between rooms). Refer to the Objects section for more information.

    Edges

    Room edges are a convenient way for scripting a room change once a player walks beyond an edge. You can set the 'X' for the left and right edge, and the 'Y' for the top and bottom edge and subscribe to events when the player crosses the edge to change the room.

    Events

    Each room has specific events which you can subscribe to and code stuff to happen on those events. The available events:

    Before fade in

    After leaving the previous room, before the current room is visible.

    After fade in

    After leaving the previous room, after the current room is visible.

    Before fade out

    Before leaving the current room when it is still visible.

    After fade out

    Before leaving the current room when it is no longer visible.

    Custom Properties

    Those are special properties which you can attach to a room which might be useful for special coding tasks.

    Room Transitions

    When switching between rooms, you can have an optional room transition effect to switch the room. The transition can be set from IGame.State.RoomTransitions, so for example you can set game.State.RoomTransitions.Transition = AGSRoomTransitions.CrossFade() where the built in transitions are:

    • Instant (no transition)
    • Fade (fade out old room, then fade in new room)
    • Cross-Fade (fade out old room and fade in new room at the same time)
    • Box Out (a black box scales up from the center, then scales down to reveal the new room)
    • Dissolve (the old room dissolved into the new room)
    • Slide (the old room slides as in a slide-show)

    All of those transitions can be configured with things like the duration and the easing function(s). Also, you can code your custom room transition if you want by implementing the IRoomTransition interface.

    • Improve this Doc
    Back to top Generated by DocFX