diff --git a/src/gui/GuiControl.hx b/src/gui/GuiControl.hx index c732746f..3199fda8 100644 --- a/src/gui/GuiControl.hx +++ b/src/gui/GuiControl.hx @@ -175,13 +175,13 @@ class GuiControl { } if (this.horizSizing == HorizSizing.Left) { if (this.parent != null) { - rect.position.x = parentRect.position.x + parentRect.extent.x - (parent.extent.x - this.position.x * uiScaleFactor); + rect.position.x = parentRect.position.x + parentRect.extent.x - (parent.extent.x - this.position.x) * uiScaleFactor; rect.extent.x *= uiScaleFactor; } } if (this.vertSizing == VertSizing.Top) { if (this.parent != null) { - rect.position.y = parentRect.position.y + parentRect.extent.y - (parent.extent.y - this.position.y * uiScaleFactor); + rect.position.y = parentRect.position.y + parentRect.extent.y - (parent.extent.y - this.position.y) * uiScaleFactor; rect.extent.y *= uiScaleFactor; } } diff --git a/src/gui/GuiSlider.hx b/src/gui/GuiSlider.hx index 44aa1063..a38ad012 100644 --- a/src/gui/GuiSlider.hx +++ b/src/gui/GuiSlider.hx @@ -6,6 +6,7 @@ import hxd.res.Sound; import hxd.Key; import gui.GuiControl.MouseState; import src.Util; +import src.Settings; class GuiSlider extends GuiImage { public var sliderValue:Float = 0; @@ -30,7 +31,7 @@ class GuiSlider extends GuiImage { slidingSound.pause = true; this.bmp.x = renderRect.position.x + renderRect.extent.x * sliderValue; this.bmp.x = Util.clamp(this.bmp.x, renderRect.position.x, renderRect.position.x + renderRect.extent.x - bmp.width / 2); - this.bmp.width = this.bmp.tile.width; + this.bmp.width = this.bmp.tile.width * Settings.uiScale; super.update(dt, mouseState); } } diff --git a/src/gui/PlayGui.hx b/src/gui/PlayGui.hx index 863963e2..2f98cd8a 100644 --- a/src/gui/PlayGui.hx +++ b/src/gui/PlayGui.hx @@ -243,8 +243,9 @@ class PlayGui { } public function initCenterText() { - RSGOCenterText.x = scene2d.width / 2 - RSGOCenterText.frames[0].width / 2; + RSGOCenterText.x = scene2d.width / 2 - RSGOCenterText.frames[0].width * Settings.uiScale / 2; RSGOCenterText.y = scene2d.height * 0.3; // - RSGOCenterText.frames[0].height / 2; + RSGOCenterText.setScale(Settings.uiScale); } public function setCenterText(identifier:String) { @@ -253,19 +254,19 @@ class PlayGui { } else if (identifier == 'ready') { this.RSGOCenterText.visible = true; this.RSGOCenterText.currentFrame = 0; - RSGOCenterText.x = scene2d.width / 2 - RSGOCenterText.frames[0].width / 2; + RSGOCenterText.x = scene2d.width / 2 - RSGOCenterText.frames[0].width * Settings.uiScale / 2; } else if (identifier == 'set') { this.RSGOCenterText.visible = true; this.RSGOCenterText.currentFrame = 1; - RSGOCenterText.x = scene2d.width / 2 - RSGOCenterText.frames[1].width / 2; + RSGOCenterText.x = scene2d.width / 2 - RSGOCenterText.frames[1].width * Settings.uiScale / 2; } else if (identifier == 'go') { this.RSGOCenterText.visible = true; this.RSGOCenterText.currentFrame = 2; - RSGOCenterText.x = scene2d.width / 2 - RSGOCenterText.frames[2].width / 2; + RSGOCenterText.x = scene2d.width / 2 - RSGOCenterText.frames[2].width * Settings.uiScale / 2; } else if (identifier == 'outofbounds') { this.RSGOCenterText.visible = true; this.RSGOCenterText.currentFrame = 3; - RSGOCenterText.x = scene2d.width / 2 - RSGOCenterText.frames[3].width / 2; + RSGOCenterText.x = scene2d.width / 2 - RSGOCenterText.frames[3].width * Settings.uiScale / 2; } } @@ -300,8 +301,9 @@ class PlayGui { gemImageSceneTarget.depthBuffer = new DepthBuffer(60, 60); gemImageSceneTargetBitmap = new Bitmap(Tile.fromTexture(gemImageSceneTarget), scene2d); - gemImageSceneTargetBitmap.x = -8; - gemImageSceneTargetBitmap.y = -8; + gemImageSceneTargetBitmap.x = -8 * Settings.uiScale; + gemImageSceneTargetBitmap.y = -8 * Settings.uiScale; + gemImageSceneTargetBitmap.setScale(Settings.uiScale); // gemImageSceneTargetBitmap.blendMode = None; // gemImageSceneTargetBitmap.addShader(new ColorKey()); @@ -354,8 +356,9 @@ class PlayGui { powerupImageSceneTarget.depthBuffer = new DepthBuffer(68, 67); powerupImageSceneTargetBitmap = new Bitmap(Tile.fromTexture(powerupImageSceneTarget), scene2d); - powerupImageSceneTargetBitmap.x = scene2d.width - 88; - powerupImageSceneTargetBitmap.y = 18; + powerupImageSceneTargetBitmap.x = scene2d.width - 88 * Settings.uiScale; + powerupImageSceneTargetBitmap.y = 18 * Settings.uiScale; + powerupImageSceneTargetBitmap.setScale(Settings.uiScale); } function initTexts() { diff --git a/src/gui/PlayMissionGui.hx b/src/gui/PlayMissionGui.hx index 73092b39..284d1e7e 100644 --- a/src/gui/PlayMissionGui.hx +++ b/src/gui/PlayMissionGui.hx @@ -397,7 +397,7 @@ class PlayMissionGui extends GuiImage { pmDifficultyTopC.addChild(pmDifficultyTopCTab); var pmDifficultyTopC2 = new GuiControl(); - pmDifficultyTopC2.horizSizing = Relative; + pmDifficultyTopC2.horizSizing = Left; pmDifficultyTopC2.vertSizing = Bottom; pmDifficultyTopC2.position = new Vector(293, 0); pmDifficultyTopC2.extent = new Vector(243, 45);