Свойство | Тип | Описание | |
---|---|---|---|
amplitude | float | ||
amplitudeLeft | float | ||
amplitudeRight | float | ||
artist | string | ||
autoDestroy | bool | ||
name | string | ||
survive | bool | ||
x | float | ||
y | float |
Свойство | Тип | Описание | |
---|---|---|---|
_fadeInTimer | float | ||
_fadeInTotal | float | ||
_fadeOutTimer | float | ||
_fadeOutTotal | float | ||
_looped | bool | ||
_pan | bool | ||
_pauseOnFadeOut | bool | ||
_position | float | ||
_radius | float | ||
_sound | |||
_target | |||
_volume | float | ||
_volumeAdjust | float |
Метод | Описание | |
---|---|---|
FlxSound ( ) : System |
The FlxSound constructor gets all the variables initialized, but NOT ready to play a sound yet.
|
|
destroy ( ) : void |
Clean up memory.
|
|
fadeIn ( float seconds ) : void |
Call this function to make a sound fade in over a certain time interval (calls
|
|
fadeOut ( float seconds, bool pauseInstead = false ) : void |
Call this function to make this sound fade out over a certain time interval.
|
|
getActualVolume ( ) : float |
Returns the currently selected "real" volume of the sound (takes fades and proximity into account).
|
|
kill ( ) : void | ||
loadEmbedded ( |
One of two main setup functions for sounds, this function loads a sound from an embedded MP3.
|
|
loadStream ( string soundUrl, bool looped = false, bool autoDestroy = false ) : |
One of two main setup functions for sounds, this function loads a sound from a URL.
|
|
pause ( ) : void |
Call this function to pause this sound.
|
|
play ( bool forceRestart = false ) : void |
Call this function to play the sound - also works on paused sounds.
|
|
proximity ( float x, float y, |
Call this function if you want this sound's volume to change based on distance from a particular FlxCore object.
|
|
resume ( ) : void |
Unpause a sound. Only works on sounds that have been paused.
|
|
stop ( ) : void |
Call this function to stop this sound.
|
|
update ( ) : void |
Handles fade out, fade in, panning, proximity, and amplitude operations each frame.
|
Метод | Описание | |
---|---|---|
createSound ( ) : void |
An internal function for clearing all the variables used by sounds.
|
Метод | Описание | |
---|---|---|
updateTransform ( ) : void |
Call after adjusting the volume to update the sound channel's settings.
|
public fadeIn ( float seconds ) : void | ||
seconds | float | The amount of time the fade-in operation should take. |
Результат | void |
public fadeOut ( float seconds, bool pauseInstead = false ) : void | ||
seconds | float | The amount of time the fade out operation should take. |
pauseInstead | bool | Tells the sound to pause on fadeout, instead of stopping. |
Результат | void |
public loadEmbedded ( |
||
embeddedSound | An embedded Class object representing an MP3 file. | |
looped | bool | Whether or not this sound should loop endlessly. |
autoDestroy | bool | Whether or not this FlxSound instance should be destroyed when the sound finishes playing. Default value is false, but FlxG.play() and FlxG.stream() will set it to true by default. |
Результат |
public loadStream ( string soundUrl, bool looped = false, bool autoDestroy = false ) : |
||
soundUrl | string | A string representing the URL of the MP3 file you want to play. |
looped | bool | Whether or not this sound should loop endlessly. |
autoDestroy | bool | Whether or not this FlxSound instance should be destroyed when the sound finishes playing. Default value is false, but FlxG.play() and FlxG.stream() will set it to true by default. |
Результат |
public play ( bool forceRestart = false ) : void | ||
forceRestart | bool | Whether to start the sound over or not. Default value is false, meaning if the sound is already playing or was paused when you call play() , it will continue playing from its current position, NOT start again from the beginning. |
Результат | void |
public proximity ( float x, float y, |
||
x | float | The X position of the sound. |
y | float | The Y position of the sound. |
target | The object you want to track. | |
radius | float | The maximum distance this sound can travel. |
pan | bool | Whether the sound should pan in addition to the volume changes (default: true). |
Результат |
protected SoundEffectInstance,Microsoft.Xna.Framework.Audio _sound | ||
Результат |