Global interface exposed via object engine to access general features of the application.
Properties[]
- screenResolution: Vec2
The size of the screen the wallpaper is displayed on.
- canvasSize: Vec2
The size of the wallpaper project defined in the editor. Only for 2D.
- userProperties: Object
Access to the user properties currently selected by the user. Color properties are converted to Vec3 automatically.
- timeOfDay: Number
The time of day in the range [0, 1] representing the 24h clock.
- frametime: Number
Time it took to update the last frame.
- runtime: Number
Total time in seconds that the wallpaper has been running.
⚠️ Warning: The runtime has a rollover to retain floating point precision. That means you should not use this value to set up a timer or event for the future, instead you should for example use frametime to decrease your time value until it hits 0.
Functions[]
- isRunningInEditor(): Boolean
You can use this to check whether the script is currently running inside the editor or not.
- isPortrait(): Boolean
Returns true if the display of the wallpaper uses a portrait resolution.
- isLandscape(): Boolean
Returns true if the display of the wallpaper uses a landscape resolution.
- registerAudioBuffers(resolution: Number): IAudioBuffers
Call this from the global scope of a script to register your script with the audio responsive system in Wallpaper Engine and get access to the audio spectrum. The resolution is the number of samples per buffer. It must be 16, 32 or 64.
- registerAsset(file: String): IAssetHandle
Use this to mark an asset as being used by your wallpaper even when it's currently not used on any layer. This is important for releasing a wallpaper to the Workshop, only used or marked assets will be included in the scene archive that is generated.
- setTimeout(callback: Function, delay?: Number): Function
Starts a timeout callback in milliseconds. Returns a new callback that can be used to stop the timeout prematurely.
- setInterval(callback: Function, delay?: Number): Function
Starts a repeating interval callback in milliseconds. Returns a new callback that can be used to stop the interval.
- isDekstopDevice(): Boolean
- isMobileDevice(): Boolean
- isWallpaper(): Boolean
- isScreensaver(): Boolean