Fixed BT/FX chips being too thin + Scaling changes #36

Merged
hersi merged 3 commits from domdoc-develop into master 2022-06-06 16:31:49 +02:00
3 changed files with 15 additions and 13 deletions
Showing only changes of commit 614dcfe9b7 - Show all commits

View File

@ -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);

View File

@ -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

View File

@ -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,