The pictures of a game, cut from its decoded texture pages as FrenchCurve.Rasters.
{:ok, data} = Cauldron2D.GameMaker.Data.read("data.win")
{:ok, pictures} = Cauldron2D.GameMaker.Pictures.new(data)
frames = Cauldron2D.GameMaker.Pictures.sprite(pictures, Enum.at(data.sprites, 3))
tile = Cauldron2D.GameMaker.Pictures.tile(pictures, Enum.at(data.backgrounds, 0), 17)new/1 decodes every page once; a Pictures holds them as RGBA and every cut after
that is binary slicing. A region is returned at its full bounds, its trimmed margins
put back as see-through pixels, so a sprite frame is always the sprite's size and
its origin applies unchanged.
Summary
Functions
The whole picture of background, nil for a background with none.
The picture of font's glyph for the code point character, nil when it has none.
Every texture page of data, decoded.
The picture region describes, at its full bounds.
Every frame of sprite, in order.
The rectangle {x, y, width, height} of sprite's first frame that a tile on a
GameMaker Studio 2 asset layer names, see-through outside the frame.
Every picture Cauldron2D.GameMaker.Draw names, cut once, keyed as it names them:
each sprite frame, each background, each tile of each tileset, each rectangle a
room's placed tiles cut from a background or a sprite (rectangles with no area are
left out), each glyph of each font as {:glyph, font, character}, and :pixel. Pass &Map.get(table, &1) to Cauldron2D.DrawList.render/4.
Tile id of the tileset background, or the rectangle {x, y, width, height} of its
picture that a GameMaker Studio 1 room's tile names. The tile is always its full size:
the part of the rectangle outside the picture is see-through.
Types
@type page() :: {pos_integer(), pos_integer(), binary()}
@type t() :: %Cauldron2D.GameMaker.Pictures{pages: tuple()}
Functions
@spec background(t(), Cauldron2D.GameMaker.Background.t()) :: FrenchCurve.Raster.t() | nil
The whole picture of background, nil for a background with none.
@spec glyph(t(), Cauldron2D.GameMaker.Font.t(), non_neg_integer()) :: FrenchCurve.Raster.t() | nil
The picture of font's glyph for the code point character, nil when it has none.
@spec new(Cauldron2D.GameMaker.Data.t()) :: {:ok, t()} | {:error, term()}
Every texture page of data, decoded.
@spec region(t(), Cauldron2D.GameMaker.Region.t()) :: FrenchCurve.Raster.t()
The picture region describes, at its full bounds.
@spec sprite(t(), Cauldron2D.GameMaker.Sprite.t()) :: [FrenchCurve.Raster.t()]
Every frame of sprite, in order.
@spec sprite_part( t(), Cauldron2D.GameMaker.Sprite.t(), Cauldron2D.GameMaker.Region.rectangle() ) :: FrenchCurve.Raster.t()
The rectangle {x, y, width, height} of sprite's first frame that a tile on a
GameMaker Studio 2 asset layer names, see-through outside the frame.
@spec table(t(), Cauldron2D.GameMaker.Data.t()) :: %{ required(term()) => FrenchCurve.Raster.t() }
Every picture Cauldron2D.GameMaker.Draw names, cut once, keyed as it names them:
each sprite frame, each background, each tile of each tileset, each rectangle a
room's placed tiles cut from a background or a sprite (rectangles with no area are
left out), each glyph of each font as {:glyph, font, character}, and :pixel. Pass &Map.get(table, &1) to Cauldron2D.DrawList.render/4.
@spec tile( t(), Cauldron2D.GameMaker.Background.t(), non_neg_integer() | Cauldron2D.GameMaker.Region.rectangle() ) :: FrenchCurve.Raster.t()
Tile id of the tileset background, or the rectangle {x, y, width, height} of its
picture that a GameMaker Studio 1 room's tile names. The tile is always its full size:
the part of the rectangle outside the picture is see-through.