Home Documentation Demos Status Contact Info Project Page

Documentation

Timing

The Timing class is used to keep a consistent frame rate. It accepts a FPS and a function to be used as a "main loop". Then upon starting, this function will be called to accomplish the FPS requested. If the function takes longer to run than the calculated interval, then the function is executed straight away.

NOTE: The Timing class doesn't use anything specific to Opera/Wii. So, it's inclusion in a non-Internet Channel script won't pose a problem.

new Timing()

Returns a Timing object.

setFPS(integer)

Parameters is an integer which is the frames per second to attempt to accomplish.

Returns none.

setTimerFunction(function)

Parameters is an function name.

Returns none.

Example: timer.setTimerFunction(mainloop);

time()

Calculates the time between now and when the next iteration should be and sets a Timeout. So, to start interating, timer.time() and such should be found at the end of the mainloop function as well.

Parameters none.

Returns none.

stop()

Stops the iteration of the mainloop.

Parameters none.

Returns none.


©Copyright 2007 The JsWii Project. All Rights Reserved.
SourceForge.net Logo