From 55a9c58b3d6f92df11cdd109d4df437805079ad5 Mon Sep 17 00:00:00 2001 From: Ralty <78720179+Raltyro@users.noreply.github.com> Date: Fri, 20 Mar 2026 16:23:55 +0700 Subject: [PATCH] Add `FlxGraphic.defaultDestroyOnNoUse` --- flixel/graphics/FlxGraphic.hx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flixel/graphics/FlxGraphic.hx b/flixel/graphics/FlxGraphic.hx index 656a0ace93..b8e05466a6 100644 --- a/flixel/graphics/FlxGraphic.hx +++ b/flixel/graphics/FlxGraphic.hx @@ -24,6 +24,12 @@ class FlxGraphic implements IFlxDestroyable */ public static var defaultPersist:Bool = false; + /** + * The default value for the `destroyOnNoUse` variable at creation + * @since FunkinCrew's Flixel + */ + public static var defaultDestroyOnNoUse:Bool = true; + /** * Creates and caches FlxGraphic object from openfl.Assets key string. * @@ -301,7 +307,7 @@ class FlxGraphic implements IFlxDestroyable * Whether this `FlxGraphic` should be destroyed when `useCount` becomes zero (defaults to `true`). * Has no effect when `persist` is `true`. */ - public var destroyOnNoUse(default, set):Bool = true; + public var destroyOnNoUse(default, set):Bool = defaultDestroyOnNoUse; /** * Whether the `BitmapData` of this graphic object has been loaded or not.