Time.js (system script)
From Spheriki
Time.js is a system script which contains a function to delay the Sphere engine.
Contents |
[edit]
Usage
RequireSystemScript("time.js");
[edit]
Variables and functions of time.js
- Delay(milliseconds)
- Delay the Sphere engine for the assigned amount of milliseconds. Nothing is done in this time.
- 1 second = 1000 milliseconds.
[edit]
Example
This example requires an image file named some_image.png to be resident in the images folder of your game:
RequireSystemScript("time.js");
var SomeImage = LoadImage("some_image.png");
SomeImage.blit(0, 0);
FlipScreen();
Delay(2000); //Wait for 2 seconds
[edit]
Notes
- Map engine: Delay does nothing in the time it is pausing the engine, so nothing of the map engine will be drawn or animated within this time. Instead the game will show the last state of the map engine until the delay is over (except if you use
FlipScreen()and/or other drawing functions, then it will show that instead).
[edit]
See also
- LoadImage()
- image.blit()
- FlipScreen()

