CauldronGPU.Canvas (CauldronGPU v0.3.3)

Copy Markdown View Source

A picture the renderer draws into: width × height RGBA pixels kept on the card. A canvas is a texture, so its handle can be drawn by sprites, warped by a column layer, shown as the overlay or used by a material. It starts transparent.

filter is how it is sampled where it is drawn: :nearest (the default) or :linear.

canvas = CauldronGPU.canvas(gpu, %CauldronGPU.Canvas{width: 320, height: 200})

Summary

Types

t()

@type t() :: %CauldronGPU.Canvas{
  filter: :nearest | :linear,
  height: pos_integer(),
  width: pos_integer()
}