diff --git a/scripts/common/dimensions.lua b/scripts/common/dimensions.lua index e381b8a..6e35543 100644 --- a/scripts/common/dimensions.lua +++ b/scripts/common/dimensions.lua @@ -48,9 +48,11 @@ end ---@param rotation number ---@return number, boolean # The scale applied to the transform and the current landscape state function dimtable.setUpTransforms(x, y, rotation) - local scale = dimtable.screen.width / dimtable.view.width; local isLandscape = dimtable.view.width > dimtable.view.height; + local designWidth = isLandscape and dimtable.design.height or dimtable.design.width + local scale = dimtable.view.width / designWidth + gfx.ResetTransform(); gfx.Translate(x, y); gfx.Rotate(rotation); diff --git a/scripts/gameplay/crit_line.lua b/scripts/gameplay/crit_line.lua index 916f7a7..e3edb54 100644 --- a/scripts/gameplay/crit_line.lua +++ b/scripts/gameplay/crit_line.lua @@ -22,13 +22,12 @@ local cursorTailImages = { gfx.CreateSkinImage("gameplay/crit_line/cursor_tail_r.png", 0), } -local CRITBAR_W = 1080 -local CRITBAR_H = 251 +local CRITBAR_W = 1080 * 1.4 +local CRITBAR_H = 251 * 1.4 -local scale = 1; local isLandscape = false; -local drawCursors = function (centerX, centerY,cursors, laserActive) +local drawCursors = function (scale, cursors, laserActive) local cursorW = 598 * 0.165; local cursorH = 673 * 0.14; @@ -45,12 +44,13 @@ local drawCursors = function (centerX, centerY,cursors, laserActive) local skew = cursor.pos * 0.001; gfx.SkewX(skew); - local cursorX = cursor.pos * (1 / scale) - cursorW / 2; + local cursorPos = cursor.pos * (1 / scale) + local cursorX = cursorPos - cursorW / 2; local cursorY = -cursorH / 2; if laserActive[luaIndex] then gfx.ImageRect( - cursor.pos - tailW / 2, + cursorPos - tailW / 2, - tailH / 2, tailW, tailH, @@ -105,7 +105,7 @@ local drawCursors = function (centerX, centerY,cursors, laserActive) end local renderBase = function (deltaTime, centerX, centerY, rotation) - scale, isLandscape = Dimensions.setUpTransforms(centerX, centerY, rotation) + _, isLandscape = Dimensions.setUpTransforms(centerX, centerY, rotation) gfx.BeginPath() gfx.FillColor(0, 0, 0, 192) @@ -124,9 +124,9 @@ local renderBase = function (deltaTime, centerX, centerY, rotation) end local renderOverlay = function (deltaTime, centerX, centerY, rotation, cursors, laserActive) - scale, isLandscape = Dimensions.setUpTransforms(centerX, centerY, rotation) + scale, _ = Dimensions.setUpTransforms(centerX, centerY, rotation) - drawCursors(centerX, centerY, cursors, laserActive) + drawCursors(scale, cursors, laserActive) gfx.ResetTransform() end diff --git a/scripts/gameplay/hitfx.lua b/scripts/gameplay/hitfx.lua index 71acc74..64500fd 100644 --- a/scripts/gameplay/hitfx.lua +++ b/scripts/gameplay/hitfx.lua @@ -126,10 +126,10 @@ function HitFX.renderLasers(deltaTime, critCenterX, critCenterY, critRotation, c end -- Render - local laserColor = {game.GetLaserColor(laser - 1)} - local x = cursors[laser - 1].pos + scale, _ = Dimensions.setUpTransforms(critCenterX, critCenterY, critRotation) - Dimensions.setUpTransforms(critCenterX, critCenterY, critRotation) + local laserColor = {game.GetLaserColor(laser - 1)} + local x = cursors[laser - 1].pos * (1 / scale) laserState.Dome:render(deltaTime, { centered = true,