Cauldron2D.GameMaker.Options (Cauldron2D.GameMaker v0.2.1)

Copy Markdown View Source

The game's options (the OPTN chunk): window and display settings and the constants the game was built with.

flags is GameMaker's bit set of options (full screen, interpolate pixels, borderless window, show cursor, sizeable, …); scale is -1 to keep the aspect ratio and 0 to stretch to the window. constants maps each constant's name to its text.

read/2 takes the layout whose first word is 0x80000000, which both GameMaker Studio 1 and 2 write, and returns {:error, :old_layout} for the older layout.

Summary

Functions

The options at at.

Types

t()

@type t() :: %Cauldron2D.GameMaker.Options{
  constants: %{required(String.t()) => String.t()},
  flags: non_neg_integer(),
  scale: integer(),
  window_colour: {byte(), byte(), byte(), byte()}
}

Functions

read(data, at)

@spec read(binary(), non_neg_integer()) :: {:ok, t()} | {:error, :old_layout}

The options at at.