GlyEngine 0.0.17
Create games and apps with lua
Loading...
Searching...
No Matches
Text

Functions

local function font_size (size)
 std.text.font_size
 
local function font_name (name)
 std.text.font_name
 
local function font_default (id)
 std.text.font_default
 
local function mensure (text)
 std.text.mensure
 
local function print (pos_x, pos_y, text)
 std.text.print
 
local function put (pos_x, pos_y, text, size)
 std.text.put
 

Detailed Description

Align text
std.text.print_ex(240, 80, 'center', 0)
std.text.print_ex(240, 80, 'right', -1)
std.text.print_ex(240, 80, 'left', 1)
Print and Mensure
local w = std.text.print_ex(240, 80, 'foo')
std.text.print(240, 80 + w, 'bar')

Function Documentation

◆ font_default()

local function font_default ( id )
List
Example
std.text.font_default(1)

◆ font_name()

local function font_name ( name )
Example
std.text.font_name('Comic Sans')

◆ font_size()

local function font_size ( size )
Example
std.text.font_size(8)

◆ mensure()

local function mensure ( text )

◆ print()

local function print ( pos_x ,
pos_y ,
text  )
Alternatives
  • std.text.print_ex returning mensure and can align -1, 0 or 1
Example
std.text.put((std.app.width/4) * 3, 8, '1/4 text')

◆ put()

local function put ( pos_x ,
pos_y ,
text ,
size  )

print text grid in based 80x24

Example
std.text.put(20, 1, '1/4 text')