A picture's place on a texture page (a TPAG item).
source is the rectangle {x, y, width, height} cut from texture page page.
target is where that rectangle lands, {x, y, width, height}, inside a picture of
bounds {width, height}: GameMaker trims see-through margins off a picture before
packing it, and target puts them back. A target narrower or shorter than the source
means the page holds the picture scaled down.
Summary
Types
@type rectangle() :: {non_neg_integer(), non_neg_integer(), non_neg_integer(), non_neg_integer()}
@type t() :: %Cauldron2D.GameMaker.Region{ bounds: {non_neg_integer(), non_neg_integer()}, page: non_neg_integer(), source: rectangle(), target: rectangle() }
Functions
@spec read(binary(), non_neg_integer()) :: t()
The region at at.
@spec read_all(binary(), non_neg_integer()) :: %{required(non_neg_integer()) => t()}
Every region in the TPAG chunk at at, by its offset in the file.