Wallpaper Engine Wiki
Advertisement

You can use JavaScript[1] in Wallpaper Engine's Scene type wallpapers to manipulate properties, create/destroy layers and access the cursor or the audio response from the program. ECMAScript 2018 is supported and you can edit your scripts through the built-in Monaco editor from Microsoft.

Editor run script.jpg

After adding any kind of script to your wallpaper, a new button Run Scripts will pop up in the center of the toolbar that will reload the wallpaper and start the scripts. After you're done, you can stop scripts with the same button.

You cannot edit the wallpaper while scripts are running.

💡 Pro tip: If your script runs too slowly and the program would become unresponsive, it will be aborted and all scripts of your wallpaper will become disabled. Make sure your script keeps the program responsive to avoid being disabled.


⚠️ Warning: Unlike other scene features of Wallpaper Engine, the scripting system is not backwards compatible.

That means if you notice anything not working right or not making sense, please post on the Steam forums instead of finding a workaround yourself. Otherwise chances are that your workaround will stop working when the issue gets fixed and your whole script may just break.

A few generic things to illustrate what could lead to problems if ignored:

  • Don't assume the execution order of scripts or events. (I.e. don't expect a script on one layer to execute always right after another layer.)
  • Don't access any internal objects not documented here. (Any global JavaScript objects should not be modified.)
  • Don't try calling or manipulating anything from Wallpaper Engine from the 'global' script scope except for the few functions that specifically mention this as a valid use case. (We might new globals in the future and those could interfere with yours!)
  • Don't call functions with wrong or undefined parameters. We might add parameters to functions or add support for variable types so calling functions wrongly could break your scripts in the future.
  • Don't ignore script warnings or errors. (Check the log at the bottom for issues.)
  • If you want to share data between scripts, use the global shared object. Otherwise you risk that the program will get extended with new features that use the same name as your script and so your script will break.

There is access to JavaScript's native functions and features, like the Math [2] object, and scene wallpapers come with a set of custom interfaces and events that provide control and access to Wallpaper Engine. You can learn about these custom extensions in the lists below.

But scene wallpapers are not websites like web wallpapers are, so you will not have access to any DOM specific objects. If you really wanted to work with DOM, then you should create a web wallpaper instead of a scene.


Globals

Modules

Event Functions

Classes

All items (45)

Advertisement