Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revision Both sides next revision
gdevelop:tutorials:howtoplaysoundsonbuttons [2015/07/08 06:11]
ricotrooper Just starting the article... awaiting screenshots.
gdevelop:tutorials:howtoplaysoundsonbuttons [2015/07/08 07:46]
ricotrooper Written the entire process
Line 1: Line 1:
 ====== How to play sounds on buttons? ====== ====== How to play sounds on buttons? ======
 +
 +This is a tutorial on how to play sounds on buttons.
 +
 +You should first know [[gdevelop:​tutorials:​creatingbuttons|how to make/create a button]] before doing this tutorial.
 +
 +If you know how to make buttons, follow the following steps in order for your buttons to play sounds.
 +
 +1. Create an event with a condition that the //​cursor/​touch is on an object// where the object being referred is the button.
 +2. Add the condition "​if(and)"​ below the cursor/​touch and trigger once on the if condition.
 +
 +{{ :​gdevelop:​tutorials:​screen_shot_2015-07-08_at_1.09.42_pm.png?​direct&​ |}}
 +
 +
 +3. Add action next to that condition which plays a particular sound.
 +
 +{{ :​gdevelop:​tutorials:​screen_shot_2015-07-08_at_1.04.00_pm.png?​direct |}}
 +
 +<note important>​ Take note: The sounds must be an .ogg or .wav file and the repeat is not active.</​note>​
 +
 +4. Create a new event with cursor/​touch on an object condition to the button with the animation of the button as the action of the event.
 +
 +5. Create a sub-event that contains the touch of Left Button of Mouse condition, and the animation action of the button and the action that contains the sound being played when the button is being clicked.
 +
 +In a nutshell, the entire process of event must be organized like this in order to achieve desired effects.
 +
 +{{ :​gdevelop:​tutorials:​screen_shot_2015-07-08_at_1.04.38_pm.png?​direct |}}
 +
 +
 +----
 +
 +
 +Reminders:
 +  * The Number 1 and Number 3 in the screenshot above can be interchanged in their position but it's best if you leave things that way.
 +  * Group the events with the same condition/​actions like the ones shown on the screenshot below.
 +  ​
 +{{ :​gdevelop:​tutorials:​screen_shot_2015-07-08_at_1.41.13_pm.png?​direct |}}
 +
 +  * The actions on click may depend on your own desire but the ones shown on the screenshot above is just an example.