Cauldron2D.GameMaker.Room (Cauldron2D.GameMaker v0.2.1)

Copy Markdown View Source

A room (a ROOM entry): a level or screen of the game, size {width, height} pixels, stepped speed times a second (GameMaker Studio 2 files set the game's speed instead and leave this 0).

Summary

Functions

The byte length of a placed instance in a file, measured from the gaps between consecutive instances in its rooms' instance lists at rooms; fallback when no room places two.

The room at at. instance_size is the byte length of one placed instance in this file (see Cauldron2D.GameMaker.Room.Instance.read/3); format is the file's.

Types

t()

@type t() :: %Cauldron2D.GameMaker.Room{
  backdrops: [Cauldron2D.GameMaker.Room.Backdrop.t()],
  caption: String.t() | nil,
  colour: {byte(), byte(), byte(), byte()},
  creation_code: non_neg_integer() | nil,
  fill: boolean(),
  gravity: {number(), number()},
  instances: [Cauldron2D.GameMaker.Room.Instance.t()],
  layers: [Cauldron2D.GameMaker.Room.Layer.t()],
  name: String.t(),
  persistent: boolean(),
  physics?: boolean(),
  pixels_per_metre: number(),
  size: {non_neg_integer(), non_neg_integer()},
  speed: non_neg_integer(),
  tiles: [Cauldron2D.GameMaker.Room.Tile.t()],
  views: [Cauldron2D.GameMaker.Room.View.t()],
  views?: boolean()
}

Functions

instance_size(data, rooms, fallback)

@spec instance_size(binary(), [non_neg_integer()], 36 | 40 | 44 | 48) ::
  36 | 40 | 44 | 48

The byte length of a placed instance in a file, measured from the gaps between consecutive instances in its rooms' instance lists at rooms; fallback when no room places two.

read(data, at, format, instance_size)

@spec read(binary(), non_neg_integer(), atom(), 36 | 40 | 44 | 48) :: t()

The room at at. instance_size is the byte length of one placed instance in this file (see Cauldron2D.GameMaker.Room.Instance.read/3); format is the file's.