Skip to content

Commit e9e36ed

Browse files
committed
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
1 parent 137af7f commit e9e36ed

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

source/funkin/editors/EditorTreeMenu.hx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import funkin.options.*;
77
class EditorTreeMenu extends TreeMenu {
88
public var bg:FlxBackdrop;
99
public var bgType:String = "default";
10+
public var bgMovement:FlxPoint = new FlxPoint();
1011

1112
public override function create() {
1213
super.create();
@@ -16,16 +17,16 @@ class EditorTreeMenu extends TreeMenu {
1617
bg = new FlxBackdrop();
1718
bg.loadGraphic(Paths.image('editors/bgs/${bgType}'));
1819
bg.antialiasing = true;
20+
setBackgroundRotation(-5);
1921
add(bg);
2022
}
2123

22-
public override function exit() {
23-
FlxG.switchState(new MainMenuState());
24+
public inline function setBackgroundRotation(rotation:Float) {
25+
bg.rotation = rotation;
26+
bg.velocity.set(85, 0).degrees = bg.rotation;
2427
}
2528

26-
public override function update(elapsed:Float) {
27-
super.update(elapsed);
28-
bg.x += elapsed * 125;
29-
bg.y += elapsed * 125;
29+
public override function exit() {
30+
FlxG.switchState(new MainMenuState());
3031
}
3132
}

0 commit comments

Comments
 (0)