Lutro - Documentation

The primary responsibility for the module is the drawing of lines, shapes, text, Images and other Drawable objects onto the screen. Its secondary responsibilities include loading external files (including Images and Fonts) into memory and managing screen geometry.

Lutro's coordinate system is rooted in the upper-left corner of the screen, which is at location (0, 0). The x axis is horizontal: larger values are further to the right. The y axis is vertical: larger values are further towards the bottom. It is worth noting that the location (0, 0) aligns with the upper-left corner of the pixel as well, meaning that for some functions you may encounter off-by-one problems in the render output when drawing 1 pixel wide lines.

In many cases, you draw images or shapes in terms of their upper-left corner (See the picture above).

Clears the screen to the background color.

Draws objects on screen. In Lutro, a Drawable is typically an Image., x, y, r, sx, sy, ox, oy, kx, ky)

You can also draw a specified Quad from the texture:, quad, x, y, r, sx, sy, ox, oy, kx, ky)

Creates a new Image.

From an image file:

img ="star.png")

From an ImageData:

img =

Creates a new Font by loading a specifically formatted image.

From an image file:


You can add an extra parameter to set the letter spacing:


Note: Lutro defaults to 1 while LÖVE defaults to 0.

From an ImageData:


Draws text on screen. A Font need to be set with setFont prior to use., x, y)

Draws formatted text, with word wrap and alignment. align can be "left", "center" or "right"., x, y, limit, align)

Draws a point., y)

Draws one or more points., y, ...)

Draws lines between points., y1, x2, y2, ...)

Draws a rectangle. mode can be "fill" or "line"., x, y, width, height)

Draws a polygon. mode can be "fill" or "line"., x1, y1, x2, y2, ...)

Sets the color used for drawing.

Returns the current Font.

Set an already-loaded Font as the current font.

Returns the height of the libretro viewport.

Returns the width of the libretro viewport.