Methods






Draw.captureObject(object: Object, mode: "none", : unknown)

Modes: none

  • none: Creates a canvas based on object size and draws the object at 0,0 (not transformed)

Arguments:

object: Object

The base class of all objects in Kristal.
When added to the stage, an object will be updated and rendered.

mode: "none"
: unknown

Returns:

1: love.Canvas


Draw.draw(: unknown)

Arguments:

: unknown




Draw.drawCanvasPart(canvas: love.Canvas, x: number, y: number, cx: number, cy: number, cw: number, ch: number, r: number?, sx: number?, sy: number?, ox: number?, oy: number?, kx: number?, ky: number?)

@param canvas — The canvas to cut out.

@param x — The position to draw the cut-out texture (x-axis).

@param y — The position to draw the cut-out texture (y-axis).

@param cx — X position of the cut-out rectangle.

@param cy — Y position of the cut-out rectangle.

@param cw — Width of the cut-out rectangle.

@param ch — Height of the cut-out rectangle.

@param r — Orientation (radians).

@param sx — Scale factor (x-axis).

@param sy — Scale factor (y-axis).

@param ox — Origin offset (x-axis).

@param oy — Origin offset (y-axis).

@param kx — Shearing factor (x-axis).

@param ky — Shearing factor (y-axis).

Arguments:

canvas: love.Canvas

The canvas to cut out.

x: number

The position to draw the cut-out texture (x-axis).

y: number

The position to draw the cut-out texture (y-axis).

cx: number

X position of the cut-out rectangle.

cy: number

Y position of the cut-out rectangle.

cw: number

Width of the cut-out rectangle.

ch: number

Height of the cut-out rectangle.

r: number?

Orientation (radians).

sx: number?

Scale factor (x-axis).

sy: number?

Scale factor (y-axis).

ox: number?

Origin offset (x-axis).

oy: number?

Origin offset (y-axis).

kx: number?

Shearing factor (x-axis).

ky: number?

Shearing factor (y-axis).



Draw.drawMenuRectangle(x: number, y: number, width: number, height: number)

This draws the menu rectangle.
In DELTARUNE's demo, the menu box drawing was broken, with some sizes being off by one pixel.
We intentionally recreated that, but they fixed it in DELTARUNE (2025), so we... added a config option.

@param x — The x position of the rectangle.

@param y — The y position of the rectangle.

@param width — The width of the rectangle.

@param height — The height of the rectangle.

Arguments:

x: number

The x position of the rectangle.

y: number

The y position of the rectangle.

width: number

The width of the rectangle.

height: number

The height of the rectangle.



Draw.drawPart(texture: love.Texture, x: number, y: number, cx: number, cy: number, cw: number, ch: number, r: number?, sx: number?, sy: number?, ox: number?, oy: number?, kx: number?, ky: number?)

@param texture — The texture to cut out.

@param x — The position to draw the cut-out texture (x-axis).

@param y — The position to draw the cut-out texture (y-axis).

@param cx — X position of the cut-out rectangle.

@param cy — Y position of the cut-out rectangle.

@param cw — Width of the cut-out rectangle.

@param ch — Height of the cut-out rectangle.

@param r — Orientation (radians).

@param sx — Scale factor (x-axis).

@param sy — Scale factor (y-axis).

@param ox — Origin offset (x-axis).

@param oy — Origin offset (y-axis).

@param kx — Shearing factor (x-axis).

@param ky — Shearing factor (y-axis).

Arguments:

texture: love.Texture

The texture to cut out.

x: number

The position to draw the cut-out texture (x-axis).

y: number

The position to draw the cut-out texture (y-axis).

cx: number

X position of the cut-out rectangle.

cy: number

Y position of the cut-out rectangle.

cw: number

Width of the cut-out rectangle.

ch: number

Height of the cut-out rectangle.

r: number?

Orientation (radians).

sx: number?

Scale factor (x-axis).

sy: number?

Scale factor (y-axis).

ox: number?

Origin offset (x-axis).

oy: number?

Origin offset (y-axis).

kx: number?

Shearing factor (x-axis).

ky: number?

Shearing factor (y-axis).



Draw.drawWrapped(drawable: love.Canvas|love.Texture, wrap_x: boolean?, wrap_y: boolean?, x: number?, y: number?, r: number?, sx: number?, sy: number?, ox: number?, oy: number?, kx: number?, ky: number?)

@param drawable — The texture to draw wrapped.

@param wrap_x — Whether the image will repeat along the x-axis.

@param wrap_y — Whether the image will repeat along the y-axis.

@param x — The position to draw the texture (x-axis).

@param y — The position to draw the texture (y-axis).

@param r — Orientation (radians).

@param sx — Scale factor (x-axis).

@param sy — Scale factor (y-axis).

@param ox — Origin offset (x-axis).

@param oy — Origin offset (y-axis).

@param kx — Shearing factor (x-axis).

@param ky — Shearing factor (y-axis).

Arguments:

drawable: love.Canvas|love.Texture

The texture to draw wrapped.

wrap_x: boolean?

Whether the image will repeat along the x-axis.

wrap_y: boolean?

Whether the image will repeat along the y-axis.

x: number?

The position to draw the texture (x-axis).

y: number?

The position to draw the texture (y-axis).

r: number?

Orientation (radians).

sx: number?

Scale factor (x-axis).

sy: number?

Scale factor (y-axis).

ox: number?

Origin offset (x-axis).

oy: number?

Origin offset (y-axis).

kx: number?

Shearing factor (x-axis).

ky: number?

Shearing factor (y-axis).





Draw.popCanvas(keep: boolean?)

Arguments:

keep: boolean?

Returns:

1: love.Canvas








Draw.printAlign(text: any, x: any, y: any, align: any, r: any, sx: any, sy: any, ox: any, oy: any, kx: any, ky: any)

Same as love.graphics.print(), but has the align parameter after the y param Available align options: "left", "center" and "right" If using align as a table, you can spcify the key "align" for the alignment and "line_offset" for the new line spacing.

Arguments:

text: any
x: any
y: any
align: any
r: any
sx: any
sy: any
ox: any
oy: any
kx: any
ky: any


Draw.printShadow(text: string|table, x: number?, y: number?, offset: number?, align: (love.AlignMode)?, limit: number?)

Draws text with a black drop shadow behind it.

@param text — A text string, or table of color-formatted text.

@param x — The position on the x-axis.

@param y — The position on the y-axis.

@param offset — The offset of the drop shadow. (Defaults to 2)

@param align — The alignment.

@param limit — Wrap the line after this many horizontal pixels.

Arguments:

text: string|table

A text string, or table of color-formatted text.

x: number?

The position on the x-axis.

y: number?

The position on the y-axis.

offset: number?

The offset of the drop shadow. (Defaults to 2)

align: (love.AlignMode)?

The alignment.

limit: number?

Wrap the line after this many horizontal pixels.



Draw.pushCanvas(: unknown)

Arguments:

: unknown

Returns:

1: unknown






Draw.pushShader(shader: string|love.Shader, vars: any)

Arguments:

shader: string|love.Shader
vars: any

Returns:

1: love.Shader


Draw.rectangle(type: any, x: any, y: any, width: any, height: any)

Arguments:

type: any
x: any
y: any
width: any
height: any




Draw.scissor(x: number, y: number, w: number, h: number)

Arguments:

x: number
y: number
w: number
h: number


Draw.scissorPoints(x1: number?, y1: number?, x2: number?, y2: number?)

Arguments:

x1: number?
y1: number?
x2: number?
y2: number?


Draw.setCanvas(canvas: (love.Canvas)?, options: boolean }?)

Arguments:

canvas: (love.Canvas)?
options: boolean }?


Draw.setColor(r: number?, g: number?, b: number?, a: number?)

Arguments:

r: number?
g: number?
b: number?
a: number?


Draw.unlockCanvas(canvas: love.Canvas)

Arguments:

canvas: love.Canvas



Fields










Undocumented