Global Command: setVolume

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 16:22, 23 March 2014 by AFRLme (talk) (Created page with "<div class="toccolours mw-collapsible mw-collapsed tbl-ds"> <span class="bold">Function History</span> <div class="mw-collapsible-content"> <div class="alt-bg">Available since...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Function History

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


Allows the user to set volume levels of: music, sound fx, speech, video, & 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 1: recommended method

-- 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)

Example 2: using integer values instead

setVolume(0, 50) -- is the same as...
setVolume(eMusicVolume, 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