Difference between revisions of "SetVolume"

From The Official Visionaire Studio: Adventure Game Engine Wiki
Line 1: Line 1:
==setVolume==
+
<div class="toccolours mw-collapsible mw-collapsed tbl-ds">
 +
<span class="bold">Command History</span>
 +
<div class="mw-collapsible-content">
 +
<div class="alt-bg">Available since v3.7</div>
 +
<div>MovieVolume & GlobalVolume added to v3.8</div>
 +
</div></div>
  
<div class="command-min-version-info">Available since: <span class="command-min-version">v3.0</span></div>
 
  
<div class="command-doc">Sets the general volume for background music, sound or speech output.</div>
+
Allows the user to set volume levels of: music, sound fx, speech, movies & global(master)
 +
<div class="toccolours mw-collapsible mw-collapsed tbl-ds">
 +
<span class="bold">Additional Info</span>
 +
<div class="mw-collapsible-content">
 +
<div>These are the numbers used inside of the setVolume(brackets) to set specific volume types! <br/>
 +
<pre>eMusicVolume (0), eSoundVolume (1), eSpeechVolume (2), eMovieVolume (3) or eGlobalVolume (4)</pre></div>
 +
</div></div>
  
Lua Syntax:
+
 
<pre class="command-syntax">setVolume(type, volume)</pre>
+
Syntax:
===Arguments===
+
<syntaxhighlight>
====type====
+
setVolume(type, volume)
:'''int''' - The type of volume to set: eMusicVolume (0), eSoundVolume (1), eSpeechVolume (2), eMovieVolume (3) or eGlobalVolume (4).
+
</syntaxhighlight>
====volume====
+
 
:'''int''' - New value for volume. Must be between 0 and 100.
+
 
===Flags===
+
Example:
===Return Values===
 
None.
 
===Examples===
 
Example 1: set speech volume to 50%
 
 
<syntaxhighlight>
 
<syntaxhighlight>
 +
-- set music volume to 50%!
 +
setVolume(eMusicVolume, 50)
 +
 +
-- set sound fx volume to 50%!
 +
setVolume(eSoundVolume, 50)
 +
 +
-- set speech volume to 50%!
 
setVolume(eSpeechVolume, 50)
 
setVolume(eSpeechVolume, 50)
 +
 +
-- set movie volume to 50%!
 +
setVolume(eMovieVolume, 50)
 +
 +
-- set global (master) volume to 50%!
 +
setVolume(eGlobalVolume, 50)
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
 +
 +
<span class="bold underline">Arguments</span>
 +
 +
<span class="bold">type</span>: integer (number) <br/>
 +
The type of volume to set: eMusicVolume (0), eSoundVolume (1), eSpeechVolume (2), eMovieVolume (3) or eGlobalVolume (4)
 +
 +
<span class="bold">volume</span>: integer (number) <br/>
 +
New value for volume. Must be a value between 0 and 100
 +
 +
 +
<span class="bold underline">Flags</span>
 +
 +
none
 +
 +
 +
<span class="bold underline">Return</span>
 +
 +
none
 +
{{i18n|setVolume}} <br/>
 +
{| class="tbl-ds"
 +
|-
 +
|<span class="bold">Relevant Pages</span>: [[GetVolume|getVolume]]
 +
|}

Revision as of 18:00, 3 April 2013

Command History

Available since v3.7
MovieVolume & GlobalVolume added to v3.8


Allows the user to set volume levels of: music, sound fx, speech, movies & global(master)

Additional Info

These are the numbers used inside of the setVolume(brackets) to set specific volume types!
eMusicVolume (0), eSoundVolume (1), eSpeechVolume (2), eMovieVolume (3) or eGlobalVolume (4)


Syntax:

setVolume(type, volume)


Example:

-- set music volume to 50%!
setVolume(eMusicVolume, 50)

-- set sound fx volume to 50%!
setVolume(eSoundVolume, 50)

-- set speech volume to 50%!
setVolume(eSpeechVolume, 50)

-- set movie volume to 50%!
setVolume(eMovieVolume, 50)

-- set global (master) volume to 50%!
setVolume(eGlobalVolume, 50)


Arguments

type: integer (number)
The type of volume to set: eMusicVolume (0), eSoundVolume (1), eSpeechVolume (2), eMovieVolume (3) or eGlobalVolume (4)

volume: integer (number)
New value for volume. Must be a value between 0 and 100


Flags

none


Return

none


Relevant Pages: getVolume