HU/getSoundPan: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(3 intermediate revisions by one other user not shown)
Line 17: Line 17:
function playMusic ()
function playMusic ()
         local song = playSound('song.mp3')
         local song = playSound('song.mp3')
         setSoundPan(song, 0.3)
         setSoundPan(song, -1)
         outputChatBox("Current pan is "..tostring(getSoundPan(song)))
         outputChatBox("Current pan is "..tostring(getSoundPan(song)))
end
end
Line 29: Line 29:


[[en:getSoundPan]]
[[en:getSoundPan]]
[[pt-br:getSoundPan]]


==Fordította==
==Fordította==
Surge
* '''''[https://wiki.multitheftauto.com/wiki/User:Surge Surge]'''''

Latest revision as of 22:23, 17 August 2021

Ez a funkció a meghatározott hangelem panszintjének eléréséhez használható.

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, -1)
        outputChatBox("Current pan is "..tostring(getSoundPan(song)))
end

addCommandHandler("music", playMusic)

Lásd még

Fordította