Wallpaper Engine Wiki
Advertisement

This tutorial will show you how to play a sound when clicking on an object.. Make sure you checked out the basic guides for the Editor and Scene Wallpaper!

Preparation[]

  • Open the Editor.
  • Get a background image for the wallpaper which you will import first.
  • Get a second image you want to click, for example this:
    Coin 0


Import the Image[]

Tutorial image import drag

Drag and drop the image into the editor.


Editor scene initial import options

The project name and scheme color will be automatically set, you can change them if you like. Press OK to import the image and create the wallpaper.


Tutorial image in editor

A new wallpaper will be created and the image should become visible.


Import Second Image[]

Tutorial script sound import second image

First, import the second image that you want to click for the sound effect. You can drag & drop the image into the editor as well.


Import Sound[]

Tutorial script sound import sound

Drag and drop the sound file into the editor.


Tutorial script sound sound settings

With the sound selected, set it to a name that is easy to remember and unique. Also set the sound mode to Single and activate the Start silent option at the bottom. This will keep the sound quiet and only play it once when activated.


Add Click to Play Sound Snippet[]

Tutorial script sound bind script

Select the image you want to be clickable again and choose to bind a script to it on the right.


Tutorial script sound choose snippet

Replace the entire script with the Click to Play Sound example snippet.


Tutorial script sound configure snippet

Now make sure to replace the name of the sound that the script refers to. In the example above, the name of the sound layer was coin.


Editor run script

Click OK and start the script preview at the top. Now you will be able to click the image you bound the script to and hear the sound effect.


Result[]

Video with sound: https://streamable.com/98igh

Advertisement