A rectangle of a texture placed in a CauldronGPU.SpriteLayer.
texture— the handle of a texture or canvassource—{x, y, width, height}in the texture's pixels, the part drawn;nil(the default) draws the whole textureposition—{x, y}in the layer's view, where the sprite's origin landsorigin—{x, y}in the source's pixels, the point placed atpositionand turned about; default{0, 0}scale—{x, y}; negative mirrors, zero draws nothing; default{1, 1}angle— degrees, counter-clockwise as seen; exact at whole quarter turnscolour—{r, g, b}from 0 to 1, multiplied into the texture's coloursalpha— 0 to 1, multiplied into the texture's alphamode—:over(the default),:addor:subtract
Colours are display values: they are blended as stored, with no conversion to linear light. A pixel is drawn when its centre lies inside the turned and scaled rectangle; it takes the texture's sample at that point, by the texture's own filter.
:over lays the colour over what is there by its alpha. :add adds the colour times
its alpha, each channel at most 1, and adds the alpha. :subtract multiplies each
channel by one less the colour times its alpha, keeping the alpha.
Summary
Types
@type t() :: %CauldronGPU.Sprite{ alpha: number(), angle: number(), colour: {number(), number(), number()}, mode: :over | :add | :subtract, origin: {number(), number()}, position: {number(), number()}, scale: {number(), number()}, source: {number(), number(), number(), number()} | nil, texture: CauldronGPU.Handle.t() }