Differences

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

Link to this comparison view

Both sides previous revision Previous revision
gdevelop:tutorials:howtoplaysoundsonbuttons [2015/07/08 07:46]
ricotrooper Written the entire process
gdevelop:tutorials:howtoplaysoundsonbuttons [2015/07/08 07:49]
ricotrooper
Line 2: Line 2:
  
 This is a tutorial on 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. 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. 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. 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. 2. Add the condition "​if(and)"​ below the cursor/​touch and trigger once on the if condition.
  
Line 16: Line 21:
  
 {{ :​gdevelop:​tutorials:​screen_shot_2015-07-08_at_1.04.00_pm.png?​direct |}} {{ :​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>​ <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. 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. 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.
Line 26: Line 34:
  
 {{ :​gdevelop:​tutorials:​screen_shot_2015-07-08_at_1.04.38_pm.png?​direct |}} {{ :​gdevelop:​tutorials:​screen_shot_2015-07-08_at_1.04.38_pm.png?​direct |}}
 +
 +
  
  
 ---- ----
 +
 +
  
  
 Reminders: 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.   * 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.   * 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 |}} {{ :​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.   * The actions on click may depend on your own desire but the ones shown on the screenshot above is just an example.