2021-08-31 18:24:48 +02:00
|
|
|
|
|
|
|
local baseImage = gfx.CreateSkinImage("gameplay/crit_line/base.png", 0)
|
|
|
|
local textImage = gfx.CreateSkinImage("gameplay/crit_line/text.png", 0)
|
2021-11-21 16:56:23 +01:00
|
|
|
local cursorImage = gfx.CreateSkinImage("gameplay/crit_line/cursor.png", 0)
|
2021-08-31 18:24:48 +02:00
|
|
|
|
|
|
|
local CRITBAR_W = 1496
|
|
|
|
local CRITBAR_H = 348
|
|
|
|
|
|
|
|
local setUpTransforms = function (x,y,rotation)
|
2021-10-28 17:27:26 +02:00
|
|
|
local resx, resy = game.GetResolution()
|
|
|
|
local desw = 1080
|
|
|
|
local desh = 1920
|
|
|
|
local scale = resx / desw
|
|
|
|
|
2021-08-31 18:24:48 +02:00
|
|
|
gfx.Translate(x, y)
|
|
|
|
gfx.Rotate(rotation)
|
2021-10-28 17:27:26 +02:00
|
|
|
gfx.Scale(scale,scale)
|
2021-08-31 18:24:48 +02:00
|
|
|
end
|
|
|
|
|
2021-11-21 16:56:23 +01:00
|
|
|
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)
|
2021-08-31 18:24:48 +02:00
|
|
|
setUpTransforms(centerX, centerY, rotation)
|
|
|
|
|
2021-10-28 17:56:57 +02:00
|
|
|
gfx.BeginPath()
|
|
|
|
gfx.FillColor(0, 0, 0, 192)
|
|
|
|
gfx.Rect(-1080/2, 0, 1080, 1080)
|
|
|
|
gfx.Fill()
|
|
|
|
|
2021-08-31 18:24:48 +02:00
|
|
|
gfx.BeginPath();
|
|
|
|
gfx.ImageRect(
|
|
|
|
-CRITBAR_W/2,
|
|
|
|
-CRITBAR_H/2,
|
|
|
|
CRITBAR_W,
|
|
|
|
CRITBAR_H,
|
|
|
|
baseImage,
|
|
|
|
1,
|
|
|
|
0
|
|
|
|
);
|
|
|
|
|
2021-11-21 16:56:23 +01:00
|
|
|
drawCursors(cursors)
|
|
|
|
|
2021-08-31 18:24:48 +02:00
|
|
|
gfx.ResetTransform()
|
|
|
|
end
|
|
|
|
|
|
|
|
local renderOverlay = function (deltaTime)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
return {
|
|
|
|
renderBase=renderBase,
|
|
|
|
renderOverlay=renderOverlay
|
|
|
|
}
|