other

Methods

inner Gc(info)

Run garbage collector, print statistics to logfile if 'info==true'.
Parameters:
Name Type Description
info boolean true to print collection stats to logfile.

inner GetFramerate() → {number}

Current frame rate.
Returns:
number - current framerate.

inner List(dname) → {Array.<string>}

Get directory listing.
Parameters:
Name Type Description
dname string name of directory to list.
Returns:
Array.<string> - array of entry names.

inner MemoryInfo() → {MemInfo}

Get information system memory.
Returns:
MemInfo - an info object.

inner Print(s)

Write data to JSLOG.TXT logfile.
Parameters:
Name Type Description
s string the string to print.

inner Println(s)

Write data to JSLOG.TXT logfile with a newline.
Parameters:
Name Type Description
s string the string to print.

inner Read(filename) → {string}

Load the contents of a file into a string. Throws exception if loading fails.
Parameters:
Name Type Description
filename string name of file to read.
Returns:
string - the contents of the file.

inner SetExitKey(key)

Change the exit key from ESCAPE to any other keycode from KEY}.
Parameters:
Name Type Description
key number

inner SetFramerate(rate)

Set maximum frame rate. If Loop takes longer than '1/rate' seconds then the framerate will not be reached.
Parameters:
Name Type Description
rate number max frame rate wanted.

inner Sleep(ms)

Sleep for the given number of ms.
Parameters:
Name Type Description
ms number time to sleep.

inner Stat(name) → {StatInfo}

Get information about a file / directory.
Parameters:
Name Type Description
name string name of the file to get info for.
Returns:
StatInfo - an info object.

inner Stop()

DOjS will exit after the current call to Loop.