GetSoundPan: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(OOP)
Line 5: Line 5:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">float getSoundPan ( element theSound )</syntaxhighlight>  
<syntaxhighlight lang="lua">float getSoundPan ( element theSound )</syntaxhighlight>  
 
{{OOP||[[sound]]:getPan|pan|setSoundPan}}
===Required Arguments===  
===Required Arguments===  
*'''theSound:''' The [[sound]] element which pan you want to get.
*'''theSound:''' the [[sound]] element which pan you want to get.


===Returns===
===Returns===

Revision as of 16:48, 17 October 2014

This function is used to get the pan level of the specified sound element.

Syntax

float getSoundPan ( element theSound )

OOP Syntax Help! I don't understand this!

Method: sound:getPan(...)
Variable: .pan
Counterpart: setSoundPan


Required Arguments

  • theSound: the sound element which pan you want to get.

Returns

Returns float value with range from -1.0 (left) to 1.0 (right), false otherwise.

Example

Click to collapse [-]
Client
function playMusic ()
        local song = playSound('song.mp3')
        setSoundPan(song, 0.3)
        outputChatBox("Current pan is "..tostring(getSoundPan(song)))
end

addCommandHandler("music", playMusic)

See Also