A Cauldron2D.Atlas as one PNG sprite sheet and an index a browser draws from,
packed by Cauldron2D.Sheet.
sheet = Cauldron2D.Net.Sheet.build(atlas)
Cauldron2D.Net.Sheet.index(sheet, "/atlas.png")cached/1 keeps the sheet of an installed atlas and rebuilds it when a different
atlas is installed under the name.
Summary
Functions
Lay every art of atlas out on one sheet.
The sheet for the installed atlas name, built on first use and again when the atlas changes.
The sheet's pixel size.
What a client needs to draw from the sheet at url, as Cauldron2D.Sheet.index/2 gives it.
Types
@type t() :: %{ tile: pos_integer(), arts: %{required(term()) => pos_integer()}, frames: [[non_neg_integer()]], anim: %{ required(pos_integer()) => %{indices: [pos_integer()], fps: pos_integer()} }, png: binary(), columns: pos_integer(), rows: pos_integer(), void: String.t() }
Functions
@spec build(Cauldron2D.Atlas.t() | Cauldron2D.Atlas.name()) :: t()
Lay every art of atlas out on one sheet.
@spec cached(Cauldron2D.Atlas.name()) :: t()
The sheet for the installed atlas name, built on first use and again when the atlas changes.
@spec dimensions(t()) :: {pos_integer(), pos_integer()}
The sheet's pixel size.
What a client needs to draw from the sheet at url, as Cauldron2D.Sheet.index/2 gives it.