LifeLua 21-08-2025
Documentation for LifeLua, a Lua interpreter for the PS Vita
Loading...
Searching...
No Matches
draw

Drawing library. More...

Functions

nil draw.swapbuffers (color color)
 
nil draw.text (number x, number y, string text, color color, number size, font font)
 
number draw.textwidth (string text, number size, font font)
 
number draw.textheight (string text, number size, font font)
 
nil draw.rect (number x, number y, number width, number height, color color, color outline)
 
nil draw.circle (number x, number y, number radius, color color)
 
nil draw.line (number start_x, number start_y, number endx, number endy, color color)
 
nil draw.pixel (number x, number y, color color)
 
nil draw.gradientrect (number x, number y, number width, number height, color top_left, color top_right, color bottom_left, color bottom_right)
 
nil draw.vdoublegradientrect (number x, number y, number width, number height, color top, color center, color bottom)
 
nil draw.hdoublegradientrect (number x, number y, number width, number height, color top, color center, color bottom)
 
nil draw.enableclip (boolean enable)
 
nil draw.cliprect (number x, number y, number width, number height)
 
nil draw.clipcircle (number x, number y, number radius)
 
nil draw.triangle (number x, number y, number x2, number y2, number x3, number y3, color c1, color c2, color c3)
 

Detailed Description

Uses vita2d

Function Documentation

◆ draw.circle()

nil draw.circle ( number x,
number y,
number radius,
color color )

Draws a circle on the screen

◆ draw.clipcircle()

nil draw.clipcircle ( number x,
number y,
number radius )

Circle scrissor

◆ draw.cliprect()

nil draw.cliprect ( number x,
number y,
number width,
number height )

Rectangle scrissor, useful for clipping text

Example:
draw.enableclip(true)
draw.clip(0, 0, 25, 10)
draw.text(0, 0 "This is some text", ...)
draw.enableclip(false)

◆ draw.enableclip()

nil draw.enableclip ( boolean enable)

Enables or disables clipping

◆ draw.gradientrect()

nil draw.gradientrect ( number x,
number y,
number width,
number height,
color top_left,
color top_right,
color bottom_left,
color bottom_right )

Draws a gradient rectangle on the screen

◆ draw.hdoublegradientrect()

nil draw.hdoublegradientrect ( number x,
number y,
number width,
number height,
color top,
color center,
color bottom )

Draws a double horizontal gradient rectangle on the screen

◆ draw.line()

nil draw.line ( number start_x,
number start_y,
number endx,
number endy,
color color )

Draws a line on the screen

◆ draw.pixel()

nil draw.pixel ( number x,
number y,
color color )

Draws a pixel on the screen

◆ draw.rect()

nil draw.rect ( number x,
number y,
number width,
number height,
color color,
color outline )

Draws a rectangle on the screen

◆ draw.swapbuffers()

nil draw.swapbuffers ( color color)

Swaps the buffers. Needed for the drawing functions above it to show.

Parameters
colorOptional color, default will be black

◆ draw.text()

nil draw.text ( number x,
number y,
string text,
color color,
number size,
font font )

Draws text on the screen

Parameters
sizeThe size argument can be also a font, if so, then the size will be the next argument

◆ draw.textheight()

number draw.textheight ( string text,
number size,
font font )

Gets the text height as displayed on the screen

Parameters
sizeThe size argument can be also a font, if so, then the size will be the next argument

◆ draw.textwidth()

number draw.textwidth ( string text,
number size,
font font )

Gets the text width as displayed on the screen

Parameters
sizeThe size argument can be also a font, if so, then the size will be the next argument

◆ draw.triangle()

nil draw.triangle ( number x,
number y,
number x2,
number y2,
number x3,
number y3,
color c1,
color c2,
color c3 )

Draws a triangle.

Parameters
c2optional
c3optional

◆ draw.vdoublegradientrect()

nil draw.vdoublegradientrect ( number x,
number y,
number width,
number height,
color top,
color center,
color bottom )

Draws a double vertical gradient rectangle on the screen