A sprite (a SPRT entry): frames of a picture, the point it is drawn from, and the
masks it collides with.
sizeis{width, height}; every frame is aCauldron2D.GameMaker.Regionwhoseboundsare that sizeoriginis{x, y}, the pixel placed at an instance's positionboxis the collision box{left, top, right, bottom}, inclusive, in the picture's pixels;box_modesays how it was chosen (0automatic,1the whole picture,2set by hand)masksholds oneCauldron2D.Maskper frame whenseparate_masksis set, otherwise one for every frame;mask/2gives a frame'sspeedis{rate, :per_second | :per_frame}, the animation's playback; GameMaker Studio 1 files carry none and are{1.0, :per_frame}kindis:bitmap,:vectoror:spine; only a bitmap sprite has frames
Summary
Functions
The mask frame frame collides with, nil for a sprite with no masks.
The sprite at at, its frames looked up in regions by offset.
Types
@type t() :: %Cauldron2D.GameMaker.Sprite{ box: {integer(), integer(), integer(), integer()}, box_mode: non_neg_integer(), frames: [Cauldron2D.GameMaker.Region.t()], kind: :bitmap | :vector | :spine, masks: [Cauldron2D.Mask.t()], name: String.t(), origin: {integer(), integer()}, separate_masks: boolean(), size: {non_neg_integer(), non_neg_integer()}, smooth: boolean(), speed: {float(), :per_second | :per_frame} }
Functions
@spec mask(t(), integer()) :: Cauldron2D.Mask.t() | nil
The mask frame frame collides with, nil for a sprite with no masks.
@spec read(binary(), non_neg_integer(), %{ required(non_neg_integer()) => Cauldron2D.GameMaker.Region.t() }) :: t()
The sprite at at, its frames looked up in regions by offset.