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.gradientline (number start_x, number start_y, number endx, number endy, color start_color, color end_color)
 
nil draw.polyline (number x1, number y1, color color1, number x2, number y2, color color2,...)
 
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_left, color top_right, color center_left, color center_right, color bottom_left, color bottom_right)
 
nil draw.hdoublegradientrect (number x, number y, number width, number height, color left_top, color center_top, color right_top, color left_bottom, color center_bottom, color right_bottom)
 
nil draw.enableclip (boolean enable)
 
nil draw.radialcircle (number x, number y, number radius, color center, color edge, number smoothness)
 
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, same behavior as cliprect, but as a circle

◆ draw.cliprect()

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

Rectangle scrissor, useful for clipping text, & masking stuff

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/masking

◆ draw.gradientline()

nil draw.gradientline ( number start_x,
number start_y,
number endx,
number endy,
color start_color,
color end_color )

Draws a gradient line on the screen

◆ 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 left_top,
color center_top,
color right_top,
color left_bottom,
color center_bottom,
color right_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.polyline()

nil draw.polyline ( number x1,
number y1,
color color1,
number x2,
number y2,
color color2,
... )

Draws a polyline on the screen Can have as many points as you want, but two points are required

Note
A point must have these parameters: x, y & color
Example:
draw.polyline(10, 10, white, 50, 10, blue, 30, 70, green)

◆ draw.radialcircle()

nil draw.radialcircle ( number x,
number y,
number radius,
color center,
color edge,
number smoothness )

Draws a radial (gradient) circle

Parameters
smoothnesssmoothness of the radial circle, higher = smoother, optional, default is 64, maximum 100

◆ 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_left,
color top_right,
color center_left,
color center_right,
color bottom_left,
color bottom_right )

Draws a double vertical gradient rectangle on the screen