HU/setSoundPanningEnabled: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(One intermediate revision by the same user not shown) | |||
Line 39: | Line 39: | ||
==Fordította== | ==Fordította== | ||
* Surge | * '''''[https://wiki.multitheftauto.com/wiki/User:Surge Surge]''''' |
Latest revision as of 20:41, 16 August 2018
This function toggles the panning of a sound (hearing it closer to the left or right side of the speakers due to the camera position). By default a sound has its panning enabled.
Syntax
bool setSoundPanningEnabled ( element sound, bool enable )
OOP Syntax Help! I don't understand this!
- Method: sound:setPanningEnabled(...)
- Variable: .panningEnabled
- Counterpart: isSoundPanningEnabled
Required arguments
- sound: a sound element to change the panning of.
- enable: true to enable the panning, false otherwise.
Returns
Returns true if the sound is valid and good arguments were passed, false if not.
If the sound is not 3D, this function will return true as well, but isSoundPanningEnabled will always return true after this (so it has no effect).
Example
This example creates a sound at the center of the map when the resource which cointains it starts and adds a command called /soundpanning, which changes the panning of the sound.
local panned = true local sound = playSFX3D("script", 7, 1, 0, 0, 20, true) function changePanning() if sound then setSoundPanningEnabled(sound, not panned) panned = not panned outputChatBox("Sound panning changed to " .. tostring(panned)) else outputDebugString("Looks that your GTA was ripped.") end end addCommandHandler("soundpanning", changePanning)
See also
- HU/getRadioChannel
- HU/getRadioChannelName
- HU/getSFXStatus
- HU/getSoundBPM
- HU/getSoundEffects
- HU/getSoundFFTData
- HU/getSoundLength
- HU/getSoundLevelData
- HU/getSoundMaxDistance
- HU/getSoundMetaTags
- HU/getSoundMinDistance
- HU/getSoundPan
- HU/getSoundPosition
- HU/getSoundProperties
- HU/getSoundSpeed
- HU/getSoundVolume
- HU/getSoundWaveData
- HU/isSoundPanningEnabled
- HU/isSoundPaused
- HU/playSFX
- HU/playSFX3D
- HU/playSound
- HU/playSound3D
- HU/playSoundFrontEnd
- HU/setRadioChannel
- HU/setSoundEffectEnabled
- HU/setSoundMaxDistance
- HU/setSoundMinDistance
- HU/setSoundPan
- HU/setSoundPanningEnabled
- HU/setSoundPaused
- HU/setSoundPosition
- HU/setSoundProperties
- HU/setSoundSpeed
- HU/setSoundVolume
- HU/stopSound