Naev

Module canvas

Lua bindings to interact with canvass.

Note The API here is designed to be compatible with that of LÖVE.

Functions

__gc (canvas) Frees a canvas.
__eq (f1, f2) Compares two canvass to see if they are the same.
new (width, height) Opens a new canvas.
set (arg) Sets the active canvas.
getTex (canvas) Gets the texture associated with the canvas.
clear (canvas, col) Clears a canvas.


Functions

__gc (canvas)
Frees a canvas.

Parameters:

  • canvas Canvas Canvas to free.
__eq (f1, f2)
Compares two canvass to see if they are the same.

Parameters:

  • f1 Canvas Canvas 1 to compare.
  • f2 Canvas Canvas 2 to compare.

Returns:

    boolean true if both canvass are the same.
new (width, height)
Opens a new canvas.

Parameters:

  • width number Width of the new canvas.
  • height number Height of the new canvas.

Returns:

    Canvas New canvas object.
set (arg)
Sets the active canvas. TODO Add actual graphics state maintenance! For now, just disable the scissor region.

Parameters:

  • arg Canvas or nil Either a canvas object or nil to disable.
getTex (canvas)
Gets the texture associated with the canvas.

Parameters:

  • canvas Canvas Canvas to get the texture from.

Returns:

    Tex Texture associated with the canvas.
clear (canvas, col)
Clears a canvas.

Parameters:

  • canvas Canvas Canvas to clear.
  • col Colour Colour to clear to.
generated by LDoc 1.4.6 Last updated 2021-10-20 12:25:39