Unit scripting

DescriptionUsesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

Lua scripting interface

This page documents the lua scripting interface.

This unit or the classes in it doesn't exist in the source but is avaiable from lua scripts.

See also
TPHXScript
Class for implement scripting support via lua

Overview

Classes, Interfaces, Objects and Records

Name Description
Class TLuaTimer Scripting support for the timer
Class TLuaMouse Scripting support for mouse
Class TLuaKeyboard Scripting support for keyboard
Class TLuaInput Scripting support for input
Class TLuaAudio Scripting support for audio

Functions and Procedures

procedure print(values: array of variant);
procedure format(format: string; values: array of variant);

Variables

timer: TLuaTimer;
input: TLuaInput;
audio: TLuaAudio;

Description

Functions and Procedures

procedure print(values: array of variant);

Prints text for debuging

The print function prints all the texts and variables that are passed to the function

Sample

   print("hello", "world")
   print(x)
 

Parameters
values
The text or variable to print
See also
TPHXScript.OnPrint
Messages from the lua print function
procedure format(format: string; values: array of variant);

Formats a value

Parameters
format
The format string
values
The values to format

Variables

timer: TLuaTimer;

the timer namespace

input: TLuaInput;

the input namespace

Sample

   if(input.states[isButton1]) then
      fire(2)
   end

audio: TLuaAudio;

the audio namespace

Sample

   -- Load a sample from disk
   audio.load("Boom.ogg")
   -- Play the sample
   audio.play("Boom", 0.5)


Generated by PasDoc 0.13.0 on 2013-08-26 11:02:44