Where everything goes on a canvas: the map's tiles around the focus and the movers, as
sheet indices at pixel positions, for a frame and map in the shapes Cauldron2D.Net.Wire
gives.
Cauldron2D.Wx.Painter.blits(frame, map, {width, height}, scale)The focus sits at the centre of the canvas, at a map's edge and past it alike; a map
that wraps repeats around it. scale is the pixel size of a tile.
Summary
Functions
Every tile and mover in view, bottom to top, as {index, x, y} in pixels.
The tiles in view whose index is one of indices, as {index, x, y} in pixels: the cells a layer left out.
Where a label at world position at lands on the canvas, in pixels: once, or on every copy in view of a wrapping map.
Every tile of the map once, as {index, x, y} in pixels from the map's top-left
corner: what a layer of the whole map is drawn from. except: is a set of indices to
leave out, for cells drawn every frame instead.
Where a layer of the whole map goes on the canvas for frame: one pixel offset, or every copy in view of a wrapping map.
The movers in view, as {index, x, y} in pixels.
The world position at the canvas's top-left corner.
The world position under a canvas point.
The focus that keeps the world under canvas point {cx, cy} there when the tile goes from from to to pixels.
Types
@type blit() :: {non_neg_integer(), integer(), integer()}
@type frame() :: %{ focus: {number(), number()}, movers: [{non_neg_integer(), number(), number()}] }
@type map_layer() :: %{ width: pos_integer(), height: pos_integer(), wrap: boolean(), rows: [[non_neg_integer()]] }
Functions
@spec blits(frame(), map_layer(), {pos_integer(), pos_integer()}, pos_integer()) :: [ blit() ]
Every tile and mover in view, bottom to top, as {index, x, y} in pixels.
@spec cell_blits( frame(), map_layer(), {pos_integer(), pos_integer()}, pos_integer(), MapSet.t() ) :: [ blit() ]
The tiles in view whose index is one of indices, as {index, x, y} in pixels: the cells a layer left out.
@spec label_blits( frame(), map_layer(), {pos_integer(), pos_integer()}, pos_integer(), {number(), number()} ) :: [{integer(), integer()}]
Where a label at world position at lands on the canvas, in pixels: once, or on every copy in view of a wrapping map.
@spec layer_blits(map_layer(), pos_integer(), keyword()) :: [blit()]
Every tile of the map once, as {index, x, y} in pixels from the map's top-left
corner: what a layer of the whole map is drawn from. except: is a set of indices to
leave out, for cells drawn every frame instead.
@spec layer_offsets( frame(), map_layer(), {pos_integer(), pos_integer()}, pos_integer() ) :: [ {integer(), integer()} ]
Where a layer of the whole map goes on the canvas for frame: one pixel offset, or every copy in view of a wrapping map.
@spec mover_blits(frame(), map_layer(), {pos_integer(), pos_integer()}, pos_integer()) :: [blit()]
The movers in view, as {index, x, y} in pixels.
@spec origin(frame(), map_layer(), {pos_integer(), pos_integer()}, pos_integer()) :: {float(), float()}
The world position at the canvas's top-left corner.
@spec world_at( frame(), map_layer(), {pos_integer(), pos_integer()}, pos_integer(), {number(), number()} ) :: {float(), float()}
The world position under a canvas point.
@spec zoom_about( frame(), map_layer(), {pos_integer(), pos_integer()}, pos_integer(), pos_integer(), {number(), number()} ) :: {float(), float()}
The focus that keeps the world under canvas point {cx, cy} there when the tile goes from from to to pixels.