+ cursor to critline wip

This commit is contained in:
FajsiEx 2021-11-21 16:56:23 +01:00
parent 580e0e2efe
commit 1f5b5c28b5
3 changed files with 26 additions and 2 deletions

View File

@ -59,7 +59,7 @@ function render(deltaTime)
end end
function render_crit_base(deltaTime) function render_crit_base(deltaTime)
CritLine.renderBase(deltaTime, gameplay.critLine.x, gameplay.critLine.y, -gameplay.critLine.rotation); CritLine.renderBase(deltaTime, gameplay.critLine.x, gameplay.critLine.y, -gameplay.critLine.rotation, gameplay.critLine.cursors);
Console.render(deltaTime, gameplay.critLine.x, gameplay.critLine.y, -gameplay.critLine.rotation); Console.render(deltaTime, gameplay.critLine.x, gameplay.critLine.y, -gameplay.critLine.rotation);
end end

View File

@ -1,6 +1,7 @@
local baseImage = gfx.CreateSkinImage("gameplay/crit_line/base.png", 0) local baseImage = gfx.CreateSkinImage("gameplay/crit_line/base.png", 0)
local textImage = gfx.CreateSkinImage("gameplay/crit_line/text.png", 0) local textImage = gfx.CreateSkinImage("gameplay/crit_line/text.png", 0)
local cursorImage = gfx.CreateSkinImage("gameplay/crit_line/cursor.png", 0)
local CRITBAR_W = 1496 local CRITBAR_W = 1496
local CRITBAR_H = 348 local CRITBAR_H = 348
@ -16,7 +17,28 @@ local setUpTransforms = function (x,y,rotation)
gfx.Scale(scale,scale) gfx.Scale(scale,scale)
end end
local renderBase = function (deltaTime, centerX, centerY, rotation) local drawCursors = function (cursors)
local cursorW = 598*0.2;
local cursorH = 673*0.2;
for i = 0, 1, 1 do
gfx.Save();
local cursor = cursors[i];
gfx.BeginPath();
gfx.SkewX(cursor.skew)
gfx.ImageRect(
cursor.pos - cursorW/2,
-cursorH/2,
cursorW,
cursorH,
cursorImage,
cursor.alpha,
0
);
gfx.Restore();
end
end
local renderBase = function (deltaTime, centerX, centerY, rotation, cursors)
setUpTransforms(centerX, centerY, rotation) setUpTransforms(centerX, centerY, rotation)
gfx.BeginPath() gfx.BeginPath()
@ -35,6 +57,8 @@ local renderBase = function (deltaTime, centerX, centerY, rotation)
0 0
); );
drawCursors(cursors)
gfx.ResetTransform() gfx.ResetTransform()
end end

View File

Before

Width:  |  Height:  |  Size: 169 KiB

After

Width:  |  Height:  |  Size: 169 KiB