Skip to content

FlxSound and FlxG.sound: Large refactor of sound initialization#3558

Merged
Geokureli merged 39 commits intoHaxeFlixel:devfrom
Geokureli:more-sound-refactors
Feb 24, 2026
Merged

FlxSound and FlxG.sound: Large refactor of sound initialization#3558
Geokureli merged 39 commits intoHaxeFlixel:devfrom
Geokureli:more-sound-refactors

Conversation

@Geokureli
Copy link
Member

@Geokureli Geokureli commented Feb 17, 2026

FlxSound

Add new chained setup system, I.E.:

mySound.load(path).setup(volume, numLoops, autoDestroy, onComplete).play()

Changes

  • Add setup method, to init playback fields like volume, looped, loopUntil, autoDestroy and onComplete
  • Change some new methods from FlxSound: Rework load method names #3479 and Add support for music streaming #3518
    • Removes "setup" fields from load, loadStreamed and loadFromURL
  • Small improvement to event handling
  • Small improvement to amplitudes (a flash only feature)
  • Add internal updateProximity, update positional sounds when they move, rather than the next update
  • Give SoundFrontEnd full private access to FlxSound
  • Add Null types in various places
  • Various doc fixes
  • Add unit tests (disabled on ubuntu - Overhaul to CI #3562)

FlxG.sound

Similar chained setup to work with FlxSound changes:

FlxG.sound.create(path).setup(volume, numLoops, autoDestroy, onComplete).play()

Changes:

  • New overload of playMusic, deprecating the old function
  • Deprecates load and loadStreamed for the new create and createStreamed
  • Replaces loadFromURL with createFromURL
  • Add Null types where needed
  • Add Unit tests

FlxG.assets

  • Make canStreamSound dynamic
  • Make addSoundExt public

FlxAssets

  • Add assertBitmapData, assertSound and resolveSound
  • Add logging to resolveBitmapData

@Geokureli Geokureli mentioned this pull request Feb 23, 2026
@Geokureli Geokureli merged commit 95c4dc6 into HaxeFlixel:dev Feb 24, 2026
10 checks passed
@Geokureli Geokureli changed the title More sound refactors FlxSound and FlxG.sound: Large refactor of sound initializatin Feb 24, 2026
@Geokureli Geokureli changed the title FlxSound and FlxG.sound: Large refactor of sound initializatin FlxSound and FlxG.sound: Large refactor of sound initialization Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant