Members
-
inner DEBUG
-
Properties:
Name Type Description DEBUG
boolean enable/disable Debug() output. -
inner DOJS_VERSION
-
Properties:
Name Type Description DOJS_VERSION
number the version -
inner FILE
-
file mode definition.
Properties:
Name Type Description READ
* open file in read mode. WRITE
* open file in write mode (truncating existing contents) APPEND
* open file in append mode. -
inner IPX_AVAILABLE
-
Properties:
Name Type Description IPX_AVAILABLE
boolean true if networking is available. -
inner KEY
-
keyboard input.
Properties:
Name Type Description Code
* key definitions. -
inner MOUSE
-
event interface.
Properties:
Name Type Description Mode.NONE
* no cursor Mode.ARROW
* arrow cursor Mode.BUSY
* busy cursor Mode.QUESTION
* questionmark cursor Mode.CURSOR_EDIT
* edit cursor Buttons
* mouse button definitions Properties
Name Type Description LEFT
* RIGHT
* MIDDLE
* -
inner MOUSE_AVAILABLE
-
Properties:
Name Type Description MOUSE_AVAILABLE
boolean true if mouse is available. -
inner REMOTE_DEBUG
-
Properties:
Name Type Description REMOTE_DEBUG
boolean enable/disable Debug() sending via IPX. -
inner SOUND
-
sound input selection.
Properties:
Name Type Description Input.MIC
* use microphone input Input.LINE
* use line input Input.CD
* use CD input Bits.BITS8
* use 8 bits Bits.BITS16
* use 16 bits -
inner SOUND_AVAILABLE
-
Properties:
Name Type Description SOUND_AVAILABLE
boolean true if sound is available.
Methods
-
inner _Debug(str)
-
Internal debug which does not redirect to IPX if enabled.
Parameters:
Name Type Description str
string the message to print. -
inner CharCode(s)
-
get char code.
Parameters:
Name Type Description s
string a string Returns:
- the ASCII-code of the first character. -
inner CompareKey(k, s)
-
compare a keycode with a character.
Parameters:
Name Type Description k
number keycode from an Event s
string a string with one char -
inner Debug(str)
-
print javascript debug output if DEBUG is true.
Parameters:
Name Type Description str
string the message to print. -
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 Include(name)
-
include a module. The exported functions are copied into global scope.
Parameters:
Name Type Description name
string module file name. -
inner List(dname) → {Array.<string>}
-
Get directory listing.
Parameters:
Name Type Description dname
string name of directory to list. Throws:
Throws an error if listing fails.Returns:
Array.<string> - array of entry names. -
inner MemoryInfo() → {MemInfo}
-
Get information system memory.
Returns:
MemInfo - an info object. -
inner MouseSetCursorMode(mode)
-
Change mode of the mouse cursor.
Parameters:
Name Type Description mode
* a mode from MOUSE. -
inner MouseSetLimits(x1, y1, x2, y2)
-
Limit mouse movement.
Parameters:
Name Type Description x1
number start x coordinate. y1
number start y coordinate. x2
number end x coordinate. y2
number end y coordinate. -
inner MouseSetSpeed(x, y)
-
Set mouse speed.
Parameters:
Name Type Description x
number horizontal speed. y
number vertical speed. -
inner MouseShowCursor(b)
-
Show hide mouse cursor.
Parameters:
Name Type Description b
boolean true or false. -
inner MouseWarp(x, y)
-
Move mouse cursor.
Parameters:
Name Type Description x
number x coordinate. y
number y coordinate. -
inner MsecTime() → {number}
-
Get ms timestamp.
Returns:
number - ms time. -
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. Throws:
Throws an error if reading fails.Returns:
string - the contents of the file. -
inner Require(name)
-
import a module.
Parameters:
Name Type Description name
string module file name. Returns:
- the imported module. -
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 StartupInfo()
-
print startup info with screen details.
-
inner Stat(name) → {StatInfo}
-
Get information about a file / directory.
Parameters:
Name Type Description name
string name of the file to get info for. Throws:
Throws an error if stat fails.Returns:
StatInfo - an info object. -
inner Stop()
-
DOjS will exit after the current call to Loop.