Skip to content
Hugo Delaunay edited this page Apr 9, 2022 · 5 revisions

How to use ?

Create a new Room instance and pass your interactables. You also have to give it an identifier. Be careful, this identifier should be unique across your rooms !

How to render ?

You can change a room render settings (asset, width, height, ...) by passing a custom RenderSettings object. By default, the room background should be assets/backgrounds/id.png (where id is your room identifier). Therefore, don't forget to add the directory assets/backgrounds/ in your pubspec.yaml (see example).

Rooms are rendered by default using the RoomWidget widget. You can change this behavior by passing a custom roomWidgetBuilder to your EscapeGameWidget.

Example

Room myRoom = Room(
  id: 'room-1',
  interactables: [
    myFirstInteractable,
    mySecondInteractable,
    // ...
  ],
);

EscapeGame escapeGame = EscapeGame(
  rooms: [
    myRoom,
    // ...
  ],
);