From e9e36edfde6538a8eaec34b4aea26e2aec364b64 Mon Sep 17 00:00:00 2001 From: Ne_Eo Date: Tue, 13 May 2025 16:28:39 +0200 Subject: [PATCH] Backdrop Rotation & Zoom + FlxPoint Reflectable FlxBackdrop now has .rotation and .zoom allowing you to rotate and zoom You can now also use the entire FlxPoint api from hscript --- source/funkin/editors/EditorTreeMenu.hx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/funkin/editors/EditorTreeMenu.hx b/source/funkin/editors/EditorTreeMenu.hx index f65cd4bf..1577ad96 100644 --- a/source/funkin/editors/EditorTreeMenu.hx +++ b/source/funkin/editors/EditorTreeMenu.hx @@ -7,6 +7,7 @@ import funkin.options.*; class EditorTreeMenu extends TreeMenu { public var bg:FlxBackdrop; public var bgType:String = "default"; + public var bgMovement:FlxPoint = new FlxPoint(); public override function create() { super.create(); @@ -16,16 +17,16 @@ class EditorTreeMenu extends TreeMenu { bg = new FlxBackdrop(); bg.loadGraphic(Paths.image('editors/bgs/${bgType}')); bg.antialiasing = true; + setBackgroundRotation(-5); add(bg); } + public inline function setBackgroundRotation(rotation:Float) { + bg.rotation = rotation; + bg.velocity.set(85, 0).degrees = bg.rotation; + } + public override function exit() { FlxG.switchState(new MainMenuState()); } - - public override function update(elapsed:Float) { - super.update(elapsed); - bg.x += elapsed * 125; - bg.y += elapsed * 125; - } } \ No newline at end of file