Skip to content

Commit

Permalink
update transform after setting pan (#2863)
Browse files Browse the repository at this point in the history
* update transform after setting pan

* add mono note
  • Loading branch information
Geokureli authored Apr 16, 2024
1 parent e27670e commit 295cece
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion flixel/sound/FlxSound.hx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ class FlxSound extends FlxBasic

/**
* Pan amount. -1 = full left, 1 = full right. Proximity based panning overrides this.
*
* Note: On desktop targets this only works with mono sounds, due to limitations of OpenAL.
* More info: [OpenFL Forums - SoundTransform.pan does not work](https://community.openfl.org/t/windows-legacy-soundtransform-pan-does-not-work/6616/2?u=geokureli)
*/
public var pan(get, set):Float;

Expand Down Expand Up @@ -773,7 +776,9 @@ class FlxSound extends FlxBasic

inline function set_pan(pan:Float):Float
{
return _transform.pan = pan;
_transform.pan = pan;
updateTransform();
return pan;
}

inline function get_time():Float
Expand Down

0 comments on commit 295cece

Please sign in to comment.