Log into the console
function engine.log(message = string) endLog a warning into the console
function engine.warn(message = string) endLog an error into the console
function engine.error(message = string) endTransform any data type into a string and return it
function engine.to_string(object = any) endGet the current script data (like 'this' when using a class)
function engine.current() endGet data from other go and respective script
If not finded return nil
function engine.data(goId = string, scriptName = string) endReturn the engine running mode in enums.ProjectModeEnum format
function engine.get_mode() endReturn a number with current fps
function engine.get_fps() endReturn a number with current frametime
function engine.get_frametime() endStop engine and exit application
function engine.stop() endRestart application
function engine.restart() endReturn a boolean indicating if editor is focused
function engine.is_editor_focused() endReturn a number with the timestamp in seconds since application started
function engine.time.get_timestamp() endReturn a table with current date
function engine.time.get_datetime() endThe returned table format is
{
minute = number,
hour = number,
second = number,
day = number,
month = number,
year = number,
}Return a number with current game object been executed
function engine.go.current() endCreate a gameobject
Returns the id in case of success else return nil
function engine.go.create(arg = table) endArgument table format
{
name = string, -- optional
active = boolean, -- optional
father_id = number, -- the id of the father go, also optional
}Create a copy from gameobject
If you don't need to assign a father just leave empty
Returns the id of new go in case of success
function engine.go.create_copy(goId = string, newFatherId = string) endDestroy a gameobject, pass the id by argument
Returns a boolean indicating success
function engine.go.destroy(id = number) endGet a gameobject, pass the id by argument
Return a table with the go information if find it, else return nil
function engine.go.get(id = number) endReturned table format
{
id = number,
name = string,
active = boolean,
father_id = number,
is_to_destroy = boolean, -- if the go is destroyed (eg = is going to)
scripts =
{ -- array of scripts names
{ -- array item format
[key = number] = [value = string]
}
},
childrens =
{ -- id array of the go childrens
{ -- array item format
[key = number] = [value = string]
}
}
}Find a list of game objects that match a name
Return a list of go ids
function engine.go.find_all(goName) endUpdate a gameobject, active property
Return a boolean indicating success
function engine.go.set_active(goId = string, active = bool) endUpdate a gameobject, name property
Return a boolean indicating success
function engine.go.set_name(goId = string, name = string) endChange the gameobject father
The second argument is optional, is not informed the go is set to the root
Return a boolean indicating success
function engine.go.change_father(goId = string, fatherId = string) endChange the gameobject index in relation to his brothers
The displacement argument changes the index based on the current index
function engine.go.change_index(goId = string, displacement = number) endLoad scripts into memory in case you need to access it immediately
Normally the script of a go is loaded in the next frame and then started only in the next frame, if needed this behavior can be changed with this. With this the script will be loaded now and started in the next frame.
If fail this will trigger an internal error
function engine.go.load_scripts(goId = string) endSet the current go to persist not (will not be saved)
function engine.go.set_persist_go(val = bool) endSet any go to persist or not (will not be saved)
function engine.go.set_persist_external_go(goId = string, val = bool) endForce the editor to inspect a go
function engine.go.inspect_go(goId = string) endGet the inspected go by the editor, else nil
function engine.go.get_inspected_go() endGet the script information from a gameobject
If not find it then return nil
function engine.script.get(goId = number, scriptName = string) endThe returned table format
{
name = string, -- script name
path = string, -- loaded path
state = string, -- state of the script, in enums.ScriptStateEnum format
is_started = boolean, -- if the Start() function of the script was called
is_loaded = boolean, -- if the script has been loaded, including script data
}Add the script into a gameobject
Return a boolean indicating success
function engine.script.add(goId = number, scriptName = string) endDestroy the script of a gameobject
The remove argument indicates if the script should be also removed when destroyed, its an optional argument
Return a boolean indicating success
function engine.script.destroy(goId = number, scriptName = string, remove = bool) endReturn the gos id that contains the script given by name
function engine.script.find_all(scriptName = string) endChange the script index
function engine.script.change_index(goId = string, scriptName = string, index = number) endChange the script index in relation to his brothers
The displacement argument changes the index based on the current index
function engine.script.displace_index(goId = string, scriptName = string, displacement = number) endSet current script to persist or not (will not be saved)
function engine.script.set_persist_script(val = bool) endSet any script to persist or not (will not be saved)
function engine.script.set_persist_ext_script(goId = string, scriptName = string, val = bool) endSet data from current script to persist or not (will not be saved)
function engine.script.set_persist_script_data(dataName = string, val = bool) endSet any script data to persist or not (will not be saved)
function engine.script.set_persist_ext_script_data(goId = string, scriptName = string, val = bool) endSet data from current script to show or not in the editor
function engine.script.set_show_script_data(dataName = string, val = bool) endSet any script data to show or not in the editor
function engine.script.set_persist_ext_show_data(goId = string, scriptName = string, val = bool) endCreate a 2D camera and return an id
function engine.cam2d.create(object = table) endThe argument table format
{
left = number,
right = number,
top = number,
bottom = number,
}Destroy a 2D camera
Recieve the camera id and return bool indicating success
function engine.cam2d.destroy(id = number) endGet a 2D camera
Recieve the camera id and return a table or nil if not find it
function engine.cam2d.get(id = number) endThe returned table format
{
left = number,
right = number,
top = number,
bottom = number,
}Get a 2D camera ortho matrix
Recieve the camera id and return a table or nil if not find it
function engine.cam2d.get_matrix(id = number) endThe returned table format is a mat4
{
1 = {{x = number, y = number, z = number, w = number}},
2 = {{x = number, y = number, z = number, w = number}},
3 = {{x = number, y = number, z = number, w = number}},
4 = {{x = number, y = number, z = number, w = number}}
}Update a 2D camera
Recieve the camera id and a table with update info
Return a bool indicating success
function engine.cam2d.update(id = number, info = table) endThe argument table format
{
left = number, -- optional
right = number, -- optional
top = number, -- optional
bottom = number, -- optional
}Set the current 2D camera
Recieve the camera id
Return a bool indicating success
function engine.cam2d.set_current(id = number) endGet the current 2D camera id
Return the camera id or nil
function engine.cam2d.get_current() endCreate a 3D camera and return an id
function engine.cam3d.create(object = table) endThe argument table format
{
position = {x = number, y = number, z = number}, -- camera pos in vec3 format, optional
yaw = number, -- yaw in degress, optional
pitch = number, -- pitch in degress, optional
fov = number, -- fov, optional
aspect_ratio = number, -- aspect ratio, optional
zfar = number, -- zfar, optional
znear = number, -- znear, optional
}Destroy a 3D camera and return an bool indicating success
function engine.cam3d.destroy(id = number) endUpdate a 3D camera and return an bool indicating sucess
Recieve the camera id and a table with update info
function engine.cam3d.update(id = number, object = table) endThe argument table format
{
position = {x = number, y = number, z = number}, -- camera pos in vec3 format, optional
rotation = {x = number, y = number, z = number}, -- set rotation from a normalized front vector, optional
yaw = number, -- yaw in degress, optional
pitch = number, -- pitch in degress, optional
fov = number, -- fov, optional
aspect_ratio = number, -- aspect ratio, optional
zfar = number, -- zfar, optional
znear = number, -- znear, optional
}Get a 3D camera and return a table, if not find it return nil
function engine.cam3d.get(id = number) endThe returned table format
{
position = {x = number, y = number, z = number}, -- camera position, vec3
right = {x = number, y = number, z = number}, -- camera right vector, vec3
front = {x = number, y = number, z = number}, -- camera front vector, vec3
up = {x = number, y = number, z = number},-- camera up vector, vec3
yaw = number, -- yaw in degrees
pitch = number, -- pitch in degrees
fov = number, -- camera fov
aspect_ratio = number, -- camera aspect ratio
zfar = number, -- camera zfar
znear = number, -- camera znear
}Translate a 3D camera relation to its basis vectors and return an bool indicating success
Recieve the camera id and a table with translation info
function engine.cam3d.translate(id = number, object = table) endThe argument table format
{
direction = string, -- direction in the format enums.CameraMovementEnum
velocity = number, -- the velocity of translation
}Translate a 3D camera relation to the axis and return an bool indicating success
Recieve the camera id and a table with translation info
function engine.cam3d.translate_abs(id = number, object = table) endThe argument table format
{
direction = string, -- direction in the format enums.CameraMovementEnum
velocity = number, -- the velocity of translation
}Rotate a 3D camera and return an bool indicating success
Recieve the camera id and a table with rotation info
function engine.cam3d.rotate(id = number, object = table) endThe argument table format
{
yaw = number, -- yaw in degrees
pitch = number, -- pitch in degrees
}Recieve the camera id and return the view matrix in mat4 format
Return nil if not find it
function engine.cam3d.get_view_matrix(id = number) endThe returned table format
{
1 = {{x = number, y = number, z = number, w =n umber}},
2 = {{x = number, y = number, z = number, w = number}},
3 = {{x = number, y = number, z = number, w = number}},
4 = {{x = number, y = number, z = number, w = number}}
}Recieve the camera id and return the projection matrix in mat4 format
Return nil if not find it
function engine.cam3d.get_projection_matrix(id = number) endThe returned table format
{
1 = {{x = number, y = number, z = number, w = number}},
2 = {{x = number, y = number, z = number, w = number}},
3 = {{x = number, y = number, z = number, w = number}},
4 = {{x = number, y = number, z = number, w = number}}
}Recieve the camera id and set as current camera
Return a bool indicating success
function engine.cam3d.set_current(id = number) endReturn the current camera or nil if not finded
function engine.cam3d.get_current() endTo draw primitives
Draw a 2D rectangle
function engine.draw2d.rect(object = table) endThe argument table format
{
position = {x = number, y = number}, -- position, vec2 format
size = {x = number, y = number}, -- size, vec2 format
color = {x = number, y = number, z = number, w = number}, -- color, vec4 format, optional
rotation = number, -- rotation in degrees, optional
filled = boolean, -- fill or not the shape, optional
}Draw a 2D circle
function engine.draw2d.circle(object = table) endThe argument table format
{
position = {x = number, y = number}, -- position, vec2 format
size = {x = number, y = number}, -- size, vec2 format
color = {x = number, y = number, z = number, w = number}, -- color, vec4 format, optional
filled = boolean, -- fill or not the shape, optional
}Draw a 2D triangle
function engine.draw2d.triangle(object = table) endThe argument table format
{
position1 = {x = number, y = number}, -- position1, vec2 format
position2 = {x = number, y = number}, -- position2, vec2 format
position3 = {x = number, y = number}, -- position3, vec2 format
color = {x = number, y = number, z = number, w = number}, -- color, vec4 format, optional
rotation = number, -- rotation in degrees, optional
}Draw a 2D line
function engine.draw2d.line(object = table) endThe argument table format
{
position_start = {x = number, y = number}, -- start position, vec2 format
position_end = {x = number, y = number}, -- end position, vec2 format
color = {x = number, y = number, z = number, w = number}, -- color, vec4 format, optional
}Draw a 2D point
function engine.draw2d.point(object = table) endThe argument table format
{
position = {x = number, y = number}, -- position, vec2 format
color = {x = number, y = number, z = number, w = number}, -- color, vec4 format, optional
}Draw a 2d texture
function engine.draw2d.texture(object = table) endThe argument table format
{
position = {x = number, y = number}, -- position, vec2 format
size = {x = number, y = number}, -- size, vec2 format
texture_id = number, the texture id
rotation = number, -- rotation in degrees, optional
color = {x = number, y = number, z = number }, -- color, vec3 format, optional
color_weight = number, -- color weight in relation to texture, should vary between 0.0 and 1.0, optional
transparency = number, -- transparency multiplier, should vary between 0.0 and 1.0, optional
}Draw a 2d texture in Editor Frame
function engine.draw2d.frame(textureId = number) endDraw a 3D cube
function engine.draw3d.cube(object = table) endThe argument table format
{
position = {x = number, y = number = z = number}, -- position, vec3 format
size = {x = number, y = number = z = number}, -- size, vec3 format
color = {x = number, y = number, z = number, w = number}, -- color, vec4 format, optional
rotation = {x = number, y = number, z = number}, -- rotation in degrees in vec3 format, optional
filled = boolean, -- fill or not the shape, optional
}Draw a 3D sphere
function engine.draw3d.sphere(object = table) endThe argument table format
{
position = {x = number, y = number = z = number}, -- position, vec3 format
size = {x = number, y = number = z = number, w = number}, -- size, vec3 format
color = {x = number, y = number, z = number}, -- color, vec4 format, optional
rotation = {x = number, y = number, z = number}, -- rotation in degrees in vec3 format, optional
filled = boolean, -- fill or not the shape, optional
}Draw a 3D point
function engine.draw3d.point(object = table) endThe argument table format
{
position = {x = number, y = number = z = number}, -- position, vec3 format
color = {x = number, y = number, z = number, w = number}, -- color, vec4 format, optional
}Draw a 3D line
function engine.draw3d.line(object = table) endThe argument table format
{
position_start = {x = number, y = number = z = number}, -- position start, vec3 format
position_end = {x = number, y = number = z = number}, -- position end, vec3 format
color = {x = number, y = number, z = number, w = number}, -- color, vec4 format, optional
}Draw a 3D rect
function engine.draw3d.rect(object = table) endThe argument table format
{
position = {x = number, y = number = z = number}, -- position, vec3 format
size = {x = number, y = number = z = number}, -- size, vec3 format
color = {x = number, y = number, z = number, w = number}, -- color, vec4 format, optional
rotation = {x = number, y = number, z = number}, -- rotation in degrees in vec3 format, optional
filled = boolean, -- fill or not the shape, optional
}Draw a 3D triangle
function engine.draw3d.triangle(object = table) endThe argument table format
{
position1 = {x = number, y = number = z = number}, -- position, vec3 format
position2 = {x = number, y = number = z = number}, -- position, vec3 format
position3 = {x = number, y = number = z = number}, -- position, vec3 format
color = {x = number, y = number, z = number, w = number}, -- color, vec4 format, optional
filled = boolean, -- fill or not the shape, optional
}Draw a 3D circle
function engine.draw3d.circle(object = table) endThe argument table format
{
position = {x = number, y = number = z = number}, -- position, vec3 format
size = {x = number, y = number = z = number}, -- size, vec3 format
color = {x = number, y = number, z = number, w = number}, -- color, vec4 format, optional
rotation = {x = number, y = number, z = number}, -- rotation in degrees in vec3 format, optional
filled = boolean, -- fill or not the shape, optional
}Return a table with current window size
function engine.window.get_window_size() endThe returned table format
{ -- vec2 format
x = number,
y = number
}Return a table with current editor window size
function engine.window.get_editor_window_size() endThe returned table format
{ -- vec2 format
x = number,
y = number
}Return a table with the window limits
function engine.window.get_window_limits() endThe returned table format
{ -- vec2 format
max_x = number,
max_y = number,
min_x = number,
min_y = number
}Open a file and return its contents
function engine.dir.read_file(file_name = string) endThe returned table format
{
open = bool,
content = string
}Create a file with optional content and return a bool indicating success
function engine.dir.create_file(file_name = string, content = string) endCreate a folder and return a bool indicating success
function engine.dir.create_folder(folder_name = string) endMove a folder or file and return a bool indicating success
function engine.dir.move(from = string, to = string) endCopy a folder or file and return a bool indicating success
function engine.dir.copy(from = string, to = string) endDelete a folder or file and return a bool indicating success
function engine.dir.delete(path = string) endReturn a bool indicating if the provided path is a file
function engine.dir.is_file(path = string) endReturn a bool indicating if the provided path is a directory
function engine.dir.is_dir(path = string) endReturn a bool indicating if the provided path/file exists
function engine.dir.exists(path = string) endReturn the executable path
function engine.dir.get_current_path() endReturn the base project path
function engine.dir.get_base_path() endReturn the assets path
function engine.dir.get_assets_path() endReturn the logs path
function engine.dir.get_logs_path() endReturn the an table with the content of a directory, if not exists return nil
function engine.dir.list_dir(path = string) endReduce a path n times and return it
function engine.dir.reduce_path_by(path = string, n = number) endRecieve a file path and return the extension
function engine.dir.get_file_name_ext(path = string) endRecieve a file or dir path and return only its name
function engine.dir.get_path_or_file_name(path = string) endRecieve a file path and return only its name without extension
function engine.dir.get_file_name_no_ext(path = string) endRecieve a string command
function engine.dir.exec(command = string) endGet the key status
Argument is a string in enums.KeyboardKeyEnum format
Return the result as a string in enums.InputActionEnum format
function engine.input.get_key(key = string) endGet the modifier key status
Argument is a string in enums.KeyModifierEnum format
Return the result as a string in enuns.InputActionEnum format
function engine.input.get_mod(key = string) endReturn a vec2 with mouse coordinates
function engine.input.get_mouse_pos() endReturn a vec2 with mouse coordinates based on current camera
function engine.input.get_cam_mouse_pos() endReturn a vec2 with mouse variations
function engine.input.get_mouse_variation() endGet the mouse button status
Argument is a string in enums.MouseButtonEnum format
Return the result as a string in enums.InputActionEnum format
function engine.input.get_mouse_button(key = string) endOpen a image and return its info
Argument is a string with path
Return the result as a table or nil if failed
function engine.img.open(path = string) endThe returned table format
{
size = {x = number, y = number} -- the image size, vec2 format
path = string, -- the path that the image was loaded
format = string -- the image format see Texture Format below
data = { -- a table of numbers with raw data information of the image
1 = number,
...,
size.x*size.y = number
} --
}Enables the vsync
function engine.command.enable_vsync() endDisables the vsync
function engine.command.disable_vsync() endEnables the depth testing
function engine.command.enable_depth_testing() endDisables the depth testing
function engine.command.disable_depth_testing() endSet the depth testing mode, receive a string in enums.DepthTestingModeEnum
function engine.command.set_depth_testing_mode(mode = string) endEnable the face culling
function engine.command.enable_culling_face() endDisable the face culling
function engine.command.disable_culling_face() endSet the face culling mode with enums.CullingFaceModeEnum format
function engine.command.set_culling_face_mode(mode = string) endSet the primitive Line size, recieve as argument with number type
function engine.command.set_primitive_line_size(size = number) endSet the primitive point size, recieve as argument with number type
function engine.command.set_primitive_point_size(size = number) endSet the polygons draw mode in enums.PolygonModeEnum format
function engine.command.set_polygon_draw_mode(mode = string) endEnables the blending
function engine.command.enable_blending() endDisables the blending
function engine.command.disable_blending() endCreate a shader, receive a table with creation information
Return id if success else return nil
function engine.shader.create(arg = table) endThe argument table format
{
vertex_path = string -- path to vertex shader file
fragment_path = string, -- path to the fragment shader file (optional)
geometry_path = string -- path to the geometry shader file (optional)
}Create a shader, receive a table with data information
Return id if success else return nil
function engine.shader.create_raw(arg = table) endThe argument table format
{
vertex_content = string -- content of vertex shader
fragment_content = string, -- content of fragment shader (optional)
geometry_content = string -- content of geometry shader (optional)
}Delete a shader, receive the id
Return bool indicating success
function engine.shader.destroy(id = number) endActivate a shader, receive the id
Return bool indicating success
function engine.shader.activate(id = number) endDisable the current active shader
function engine.shader.unactive_all() endSet bool variable into shader, receive the id and data information
Return bool indicating success
function engine.shader.set_bool(id = number, name = string, value = bool) endSet integer variable into shader, receive the id and data information
Return bool indicating success
function engine.shader.set_int(id = number, name = string, value = number) endSet float variable into shader, receive the id and data information
Return bool indicating success
function engine.shader.set_float(id = number, name = string, value = number) endSet XY (separated vec2) variable into shader, receive the id and data information
Return bool indicating success
function engine.shader.set_xy(id = number, name = string, x = number, y = number) endSet XYZ (separated vec3) variable into shader, receive the id and data information
Return bool indicating success
function engine.shader.set_xyz(id = number, name = string, x = number, y = number, z = number) endSet XYZW (separated vec4) variable into shader, receive the id and data information
Return bool indicating success
function engine.shader.set_xyzw(id = number, name = string, x = number, y = number, z = number, w = number) endSet a vec2 variable into shader, receive the id and data information
Return bool indicating success
function engine.shader.set_vec2(id = number, name = string, {x = number, y = number}) endSet vec3 variable into shader, receive the id and data information
Return bool indicating success
function engine.shader.set_vec3(id = number, name = string, {x = number, y = number, z = number}) endSet vec4 variable into shader, receive the id and data information
Return bool indicating success
function engine.shader.set_vec4(id = number, name = string, { x = number, y = number, z = number, w = number}) endSet mat2 variable into shader, receive the id and data information
Return bool indicating success
function engine.shader.set_mat2(id = number, name = string, mat2 = table) endThe argument table format
{
{x = number, y = number },
{x = number, y = number },
}Set mat3 variable into shader, receive the id and data information
Return bool indicating success
function engine.shader.set_mat3(id = number, name = string, mat3 = table) endThe argument table format
{
{x = number, y = number, z = number},
{x = number, y = number, z = number},
{x = number, y = number, z = number},
}Set mat4 variable into shader, receive the id and data information
Return bool indicating success
function engine.shader.set_mat4(id = number, name = string, mat4 = table) endThe argument table format
{
{x = number, y = number, z = number, w = number},
{x = number, y = number, z = number, w = number},
{x = number, y = number, z = number, w = number},
{x = number, y = number, z = number, w = number},
}Create a empty texture, receive a table with creation information
Return id if success else return nil
function engine.texture.create_empty(arg = table) endThe argument table format
{
texture_size = {x = number, y = number}, -- texture size, vec2 format
minifying_filter = string, -- in enums.MinifyingFilterEnum format, optional
magnification_filter = string, -- in enums.MagnificationFilterEnum format, optional
texture_wrap_t = string, -- in enums.TextureWrapEnum format, optional
texture_wrap_s = string, -- in enums.TextureWrapEnum format, optional
texture_pixel_format = string, -- in enums.TexturePixelEnum format, optional
texture_internal_format = string, -- in enums.TextureInternalFormatEnum format, optional
texture_format = string, -- in enums.TextureFormatEnum format, optional
ansiotropic_filter = number, -- a number for ansiotropic filter, optional
border_color = {x = number, y = number, z = number} -- texture border_color in vec3 format, optional
}Create a empty multisampled texture, receive a table with creation information
Return id if success else return nil
function engine.texture.create_multi_sampled(arg = table) endThe argument table format
{
texture_samples = number -- number of samples
texture_size = {x = number, y = number}, -- texture size, vec2 format
texture_internal_format = string, -- in enums.TextureInternalEnum format
}Create a texture, receive a table with creation information
Return id if success else return nil
function engine.texture.create(arg = table) endThe argument table format
{
image_path = string, -- image path
minifying_filter = string, -- in enums.MinifyingFilterEnum format, optional
magnification_filter = string, -- in enums.MagnificationFilterEnum format, optional
texture_wrap_t = string, -- in enums.TextureWrapEnum format, optional
texture_wrap_s = string, -- in enums.TextureWrapEnum format, optional
ansiotropic_filter = number, -- a number for ansiotropic filter, optional
border_color = {x = number, y = number, z = number} -- texture border_color in vec3 format, optional
}Receive the id and return info or nil if not finded
function engine.texture.get_info(id = number) endThe returned table format
{
multisampled = bool, -- if the texture is multisampled
samples = number, -- number of samples if texture is multisampled
size = vec2, -- texture size in pixels
}Destroy a texture, receive the id
Return bool indicating success
function engine.texture.destroy(id = number) endActive a texture, receive the id and the texture unit slot as a number
Return bool indicating success
function engine.texture.active(id = number, slot = number) endRemove any texture at a texture unit slot
function engine.texture.disabletextureunit(slot = number) endCreate a framebuffer, receive a table with creation information
Return id if success else return nil
function engine.framebuffer.create(arg = table) endThe argument table format
{
texture_attachments_count = number, -- number of texture attachments,
texture_attachments = = {1 = number, ..., texture_count = number} -- table with the ids of the texture attachments,
depth_attachment = number, -- texture id for depth attachment, optional
renderbuffer_attachment = { -- optional
type = string -- in enums.RenderBufferAttachmentType format,
format = string -- in enums.RenderBufferFormat format,
size = {x = number, y = number} -- render buffer size
aliasing = number -- multisample in render buffer
}
}Destroy a framebuffer, receive the id
Return bool indicating success
function engine.framebuffer.destroy(id = number) endActive a framebuffer, receive the id
Return bool indicating success
function engine.framebuffer.active(id = number) endActive the default screen buffer of the window, witch can't be used
function engine.framebuffer.active_none() endReceive the framebuffer id and return a framebuffer number of texture attachments, else nil if not finded
function engine.framebuffer.get_attachments_size(id = number) endReceive the framebuffer id and the texture attachment position
Return the id of the texture attachment, else nil if not finded
function engine.framebuffer.get_attachment(id = number, index = number) endClear the current framebuffer
function engine.framebuffer.clear(color = vec4) endSet the framebuffer clear modes
function engine.framebuffer.set_clear_modes(modes = table) endThe argument table format
{
color = boolean, -- bool if you and this clear mode
depth = boolean, -- bool if you and this clear mode
stencil = boolean, -- bool if you and this clear mode
}Set current view port, recieve a vec4 format table
function engine.framebuffer.set_viewport(viewport = table) endThe argument table format
{
x = number, -- start viewport x
y = number, -- start viewport y
z = number, -- size viewport x
w = number -- size viewport y
}Create a vertex data, receive a table with creation information, and an optional table with index data
Return id if success else return nil
function engine.vertex.create(vertexData = table, indexData = table) endThe first argument table format
{
vertices_count = number, -- the total number of vertices, considering the attributes of each vertex
buffers_count = number, -- the number of buffers that will be used to separate the vertices attributes
buffers = { -- the buffers that holds the vertices data
1 = { -- buffer item format
use = string, -- (optional) use internally by opengl in enums.DataUseEnum format
type = string, -- type of the data, use enums.VertexBufferTypeEnum format
data = { -- data, array of number
1 = number,
...
vertices_count*layout_count = number
},
layouts_count = number, -- number of division in attributes of buffer
layout = { -- layou description
1 = { -- layout item format
count = number, -- number of elements in layout
normalized = bool, -- if data is normalized (optional)
},
... -- until layouts_count
}
},
... -- until buffers_count
}
}The second argument table format (optional)
{
use = string, -- (optional) use internally by opengl in Data Use format (see enums below)
count = number, -- number of indices used
data = { -- data, array of number for indices
1 = number,
...
count = number
}
}Destroy a vertex data, receive the id
Return bool indicating success
function engine.vertex.destroy(id = number) endReceive the id and return info or nil if not finded
function engine.vertex.get_info(id = number) endThe returned table format
{
gl_id = number, -- open gl id (vao)
}Activate a vertex data, receive the id
Return bool indicating success
function engine.vertex.activate(id = number) endDraw a vertex data, receive the id and draw mode
drawMode is in enums.DrawingTypeEnum format
Return bool indicating success
function engine.vertex.draw(id = number, drawMode = string) endModify a vertex data, receive the id and modification data as a table
Return bool indicating success
function engine.vertex.modify(id = number, modifyData = table) endThe argument table format
{
start = number, -- the start position to be modified
size = number, -- the size of modification
buffer = number, -- with buffer to modified
type = string, -- type of the data, format enums.VertexBufferTypeEnum format
data = { -- data to replace the buffer
1 = number,
...,
size = number
}
}Return id of vertex data
dataUse argument is in Data Use format (see enums below)
function engine.generator.gen_2d_point(dataUse = string) end
function engine.generator.gen_2d_line(dataUse = string, filled = bool) end
function engine.generator.gen_2d_circle(dataUse = string, filled = bool, segments = number) end
function engine.generator.gen_2d_triangle(dataUse = string, filled = bool) endReturn id of vertex data
dataUse argument is in Data Use format (see enums below)
function engine.generator.gen_3d_circle(dataUse = string, filled = bool, segments = number) end
function engine.generator.gen_3d_cube(dataUse = string, filled = bool) end
function engine.generator.gen_3d_line(dataUse = string) end
function engine.generator.gen_3d_point(dataUse = string) end
function engine.generator.gen_3d_rect(dataUse = string, filled = bool) end
function engine.generator.gen_3d_sphere(dataUse = string, filled = bool, segments = number) end
function engine.generator.gen_3d_triangle(dataUse = string, filled = bool) endReturns id if success, else return nil
function engine.audio.create_2d(path = string) end
function engine.audio.create_3d(path = string) endfunction engine.audio.destroy(id = number) endfunction engine.audio.pause(id = number) end
function engine.audio.resume(id = number) endfunction engine.audio.restart(id = number) endfunction engine.audio.stop(id = number) endfunction engine.audio.is_finished(id = number) endReturns vec3
function engine.audio.get_position(id = number) end
function engine.audio.set_position(id = number, vec3) endfunction engine.audio.set_velocity(id = number, vec3) end
function engine.audio.get_velocity(id = number) endfunction engine.audio.set_loop(id = number, bool) end
function engine.audio.get_loop(id = number) endChanges the distance at which the 3D sound stops getting louder
function engine.audio.set_min_distance(id, number) end
function engine.audio.get_min_distance(id) endThis value causes the sound to stop attenuating after it reaches the max distance
function engine.audio.set_max_distance(id, number) end
function engine.audio.get_max_distance(id) endThe balance of the sound, value between -1 and 1
function engine.audio.set_pan(id, number) end
function engine.audio.get_pan(id) endPlays the sound at a higher or lower speed, increasing or decreasing its frequency which makes it sound lower or higher
function engine.audio.set_speed(id, number) end
function engine.audio.get_speed(id) endReturns the play lenght of the audio (number)
function engine.audio.get_length(id) endfunction engine.audio.set_play_position(id, number) end
function engine.audio.get_play_position(id) endfunction engine.audio.set_volume(id, number) end
function engine.audio.get_volume(id) endStop all audios
function engine.audio.stop_all_audios() endfunction engine.audio.set_listener_position(vec3) endReturns id if success, else return nil
Width and height in pixels, use 0 to one of it to adapt based on the another
function engine.font.create(path = string, width = number, height = number) endfunction engine.font.destroy(id = number) endfunction engine.font.get_position(id = number) end
function engine.font.set_position(id = number, pos = vec2) end
function engine.font.get_scale(id = number) end
function engine.font.set_scale(id = number, scale = vec2) endfunction engine.font.get_color(id = number) end
function engine.font.set_color(id = number, color = vec3) endReturns a Vec2 with the current text size in pixels
function engine.font.get_text_size_(id = number) endfunction engine.font.get_text(id = number) end
function engine.font.set_text(id = number, text = string) endfunction engine.font.draw(id = number) endReturn a random number between 0.0 and 1.0
function engine.math.random() Return a vec2
function engine.math.make_vec2() Return a vec3
function engine.math.make_vec3()
eturn a vec2
```lua
function engine.math.make_vec2() Return a mat2 matrix
function engine.math.make_mat2() Return a mat3
function engine.math.make_mat3() Return a mat4 matrix
function engine.math.make_mat4() Return a mat2 identity matrix
function engine.math.make_identity_mat2() Return a mat3 identity matrix
function engine.math.make_identity_mat3() Return a mat4 identity matrix
function engine.math.make_identity_mat4() Return a traslated mat4 matrix
function engine.math.translate(mat4, vec3) Return a rotated mat4 matrix
function engine.math.rotate(mat4, vec3, angle) Return a scaled mat4 matrix
function engine.math.scale(mat4, vec3) Return a vec4 that is the multiplication between a mat4 and vec4
function engine.math.multiply(mat4, vec4) Return the magnitude of a vec2
function engine.math.mag_vec2(vec2) Return the magnitude of a vec3
function engine.math.mag_vec3(vec3) Return the normalized vec2
function engine.math.normalize_vec2(vec2) Return the normalized vec3
function engine.math.normalize_vec3(vec3)Open any 3d model and return the id
function engine.object.open(path = string) Destroy 3d model by recieving it's id
function engine.object.destroy(id = number) Return a tabe with 3d model information
function engine.object.get(id = number) Return a tabe with the information about the meshes of the model
function engine.object.get_meshes(id = number) Return a tabe with the information about the materials of the model
function engine.object.get_materials(id = number)