Changes between Initial Version and Version 1 of Exposed_Misc_Functions


Ignore:
Timestamp:
Feb 23, 2008, 4:19:00 AM (16 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Exposed_Misc_Functions

    v1 v1  
     1<font color="red">'''DEPRECATED; will be replaced by contents of "jan's stomping ground"'''</font>
     2
     3= Miscellaneous Methods =
     4
     5== buildTime ==
     6 * '''Overview:'''
     7  * Returns a string value of the date when the project was last built.
     8 * '''Syntax:'''
     9  * !ReturnString = buildTime (flag)
     10 * '''Parameters:'''
     11  * <font color="red">A flag set to 0 in the current example. Not sure what it does yet.</font>
     12 * '''Returns:'''
     13  * Date string in the format <Mon dd yyyy> (eg Jun 24 2005).
     14 * '''Notes:'''
     15  *
     16
     17== crash ==
     18 * '''Overview:'''
     19  * Crashes the engine.
     20  * Caution, debug only.
     21 * '''Syntax:'''
     22  * crash();
     23 * '''Parameters:'''
     24  * None.
     25 * '''Returns:'''
     26  * Nothing.
     27 * '''Notes:'''
     28  * Passes invalid data to the !SpiderMonkey engine.
     29
     30== exit ==
     31 * '''Overview:'''
     32  * Gracefully shuts down the engine, returning to the desktop.
     33 * '''Syntax:'''
     34  * exit()
     35 * '''Parameters:'''
     36  * None.
     37 * '''Returns:'''
     38  * None.
     39 * '''Notes:'''
     40  * Call this function to quit the game.
     41
     42== getFPS ==
     43 * '''Overview:'''
     44  * Return the current frames per second of the renderer.
     45 * '''Syntax:'''
     46  * FPS = getFPS()
     47 * '''Parameters:'''
     48  * None.
     49 * '''Returns:'''
     50  * FPS as a number (eg 30).
     51 * '''Notes:'''
     52  *
     53
     54== getGlobal ==
     55 * '''Overview:''' Access an object from another scope.
     56
     57== getGUIGlobal ==
     58 * '''Overview:''' Access a GUI object from another scope.
     59
     60== getLanguageID ==
     61 * '''Overview:'''
     62  * Returns a string value of the language version currently being used by the localisation system.
     63 * '''Syntax:'''
     64  * !ReturnString = getLanguageID()
     65 * '''Parameters:'''
     66  * None
     67 * '''Returns:'''
     68  * Language name (eg "English").
     69 * '''Notes:'''
     70  *
     71
     72== setInterval ==
     73 * '''Overview:'''
     74  * Schedules a function or script fragment to be called at a specified interval (the given JS function is continuously called each time a waiting period elapses).
     75 * '''Syntax:'''
     76  * setInterval( fragment, interval );
     77  * setInterval( function, interval );
     78  * setInterval( fragment, delay, interval );
     79  * setInterval( function, delay, interval );
     80  * Example: setInterval(atlasUpdateInfoWindow, 500); // Call the function atlasUpdateInfoWindow() every 500ms.
     81 * '''Parameters:'''
     82  * fragment: A text string containing executable !JavaScript.
     83  * function: An expression evaluating to a !JavaScript function.
     84  * interval: The interval between subsequent executions of the code. May not be negative.
     85  * delay: The delay, in milliseconds, before the code is first executed. (If unspecified, defaults to 'interval'). May not be negative.
     86 * '''Returns:'''
     87  * Nothing.
     88 * '''Notes:'''
     89  * Functions and script are executed first at 'delay' milliseconds after the call and then every 'interval' milliseconds thereafter. If 'delay' is not present, the first call is 'interval' milliseconds following the setInterval call.
     90  * All notes for setTimeout also apply to setInterval.
     91
     92== setTimeout ==
     93 * '''Overview:'''
     94  * Schedules a specified fragment of script or a script function to execute some time in the future.
     95 * '''Syntax:'''
     96  * setTimeout( fragment, delay );
     97  * setTimeout( function, delay );
     98 * '''Parameters:'''
     99  * delay: The desired delay, in milliseconds. May not be negative.
     100  * fragment: A text string containing executable !JavaScript.
     101  * function: An expression evaluating to a !JavaScript function.
     102 * '''Returns:'''
     103  * Nothing.
     104 * '''Notes:'''
     105  * Scripts and functions registered this way are called on the first simulation frame after the specified period has elapsed. If this causes multiple segments of code to be executed in the same frame, relative timing is maintained. Delays of 0 milliseconds cause code to be executed on the following simulation frame. If more than one script or function is scheduled to execute in the same millisecond, the order of execution is undefined. Code is scheduled in simulation time, and is therefore suspended while the game is paused or frozen. Granularity of timing is also limited to 1/(Simulation frame rate); currently 100ms. The called function or script executes in the same scope as the code that called setTimeout (amongst other things, the 'this' reference is usually maintained)
     106
     107== cancelInterval ==
     108 * '''Overview:'''
     109  * Ceases triggering the currently executing interval.
     110 * '''Syntax:'''
     111  * cancelInterval();
     112 * '''Parameters:'''
     113  * None.
     114 * '''Returns:'''
     115  * Nothing.
     116 * '''Notes:'''
     117  * Execution continues until the end of the triggered function or script fragment, but is not triggered again.
     118
     119== writeLog ==
     120 * '''Overview:'''
     121  * Writes an entry to the Prometheus log file.
     122 * '''Syntax:'''
     123  * writeLog( ... );
     124 * '''Parameters:'''
     125  * Any number of values of any type.
     126 * '''Returns:'''
     127  * Nothing.
     128 * '''Notes:'''
     129  * writeLog converts each of its arguments to a string, in turn. The message added to the logfile is all these strings concatenated together. The message is logged as 'NORMAL' style.