Editor selections resolution aware!!

This commit is contained in:
lunarcleint
2025-03-04 20:03:06 -07:00
parent 0970a63dd1
commit f11c821cbf
+14
View File
@@ -11,6 +11,8 @@ class EditorTreeMenu extends TreeMenu {
public override function create() {
super.create();
UIState.setResolutionAware();
FlxG.camera.fade(0xFF000000, 0.5, true);
bg = new FlxBackdrop();
@@ -23,6 +25,18 @@ class EditorTreeMenu extends TreeMenu {
FlxG.switchState(new MainMenuState());
}
public override function onResize(width:Int, height:Int) {
super.onResize(width, height);
if (!UIState.resolutionAware) return;
if (width < FlxG.initialWidth || height < FlxG.initialHeight) {
width = FlxG.initialWidth; height = FlxG.initialHeight;
}
if (pathDesc != null && pathLabel != null)
pathDesc.width = pathLabel.width = width - 8;
}
public override function update(elapsed:Float) {
super.update(elapsed);
bg.x += elapsed * 125;