Cauldron2D.GameMaker.Object (Cauldron2D.GameMaker v0.2.1)

Copy Markdown View Source

An object (an OBJT entry): the definition rooms place instances of.

  • sprite and mask are sprite indices, -1 for none; with no mask the sprite's own masks collide
  • parent is the object it inherits events from, nil for none
  • depth orders drawing: greater depth is drawn first, further back
  • physics holds the Box2D settings, nil when the object does not use physics
  • events lists {type, subtype, code}: type is a name from Cauldron2D.GameMaker.Event.types/0, subtype the alarm, key, object, step or other number the type takes, and code the index of the event's code entry, nil for none. A game compiled to native code carries no code entries in its data file; its event's code is the executable's function named by Cauldron2D.GameMaker.Event.handler_name/3

Summary

Functions

The object at at.

Types

event()

t()

@type t() :: %Cauldron2D.GameMaker.Object{
  depth: integer(),
  events: [event()],
  mask: integer(),
  name: String.t(),
  parent: non_neg_integer() | nil,
  persistent: boolean(),
  physics: map() | nil,
  solid: boolean(),
  sprite: integer(),
  visible: boolean()
}

Functions

read(data, at)

@spec read(binary(), non_neg_integer()) :: t()

The object at at.