GlyEngine 0.1.3
Create games and apps with lua
Loading...
Searching...
No Matches
Draw

Functions

local function clear (color)
 std.draw.clear
 
local function rect (mode, pos_x, pos_y, width, height)
 std.draw.rect
 
local function line (x1, y1, y2, y1, y2)
 std.draw.line
 
local function poly (mode, verts, pos_x, pos_y, scale, angle, origin_x, origin_y)
 std.draw.poly
 

Detailed Description

Design Decision

There is no std.draw.pixel or std.draw.circle, nor plans to add them, due to frontend design decisions. The engine is designed to be multiplatform, ensuring code runs on all devices while respecting their processing and memory limits.

Tool IMG Gen

It is possible to create logos or any images using the engine's real-time drawing API while writing the rendering code and clicking download.

Function Documentation

◆ clear()

local function clear ( color )

◆ line()

local function line ( x1 ,
y1 ,
y2 ,
y1 ,
y2  )

◆ poly()

local function poly ( mode ,
verts ,
pos_x ,
pos_y ,
scale ,
angle ,
origin_x ,
origin_y  )
Example
local spaceship = {-2,3, 0,-2, 2,3}
std.draw.poly(0, spaceship, game.player_x, game.player_y, 1, player_angle)
Parameters
mode
  • 0 fill-closed
  • 1 frame-closed
  • 2 frame-opened
vertsarray of x and y
pos_x(optional)
pos_y(optional)
scale(optional)
angle(optional)
origin_x(optional)
origin_y(optional)

◆ rect()

local function rect ( mode ,
pos_x ,
pos_y ,
width ,
height  )