From 007bd904ba4ff54a039a62a97aec803f71275e2b Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Sat, 21 Sep 2024 16:33:27 -0400 Subject: [PATCH] flxtrail separate function for update revert additional function spacing --- flixel/addons/effects/FlxTrail.hx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/flixel/addons/effects/FlxTrail.hx b/flixel/addons/effects/FlxTrail.hx index e7caef35..b7628255 100644 --- a/flixel/addons/effects/FlxTrail.hx +++ b/flixel/addons/effects/FlxTrail.hx @@ -24,6 +24,11 @@ class FlxTrail extends #if (flixel < "5.7.0") FlxSpriteGroup #else FlxSpriteCont */ public var target(default, null):FlxSprite; + /** + * Useful if you need to have more granular control over per-sprite offsetting. + */ + public var effectOffset(default, null):FlxPoint = FlxPoint.get(); + /** * How often to update the trail. */ @@ -164,7 +169,7 @@ class FlxTrail extends #if (flixel < "5.7.0") FlxSpriteGroup #else FlxSpriteCont spritePosition = FlxPoint.get(); } - spritePosition.set(target.x - target.offset.x, target.y - target.offset.y); + spritePosition.set(target.x - target.offset.x - effectOffset.x, target.y - target.offset.y - effectOffset.y); _recentPositions.unshift(spritePosition); // Also do the same thing for the Sprites angle if rotationsEnabled