add tintable laser cursor tails

This commit is contained in:
Hersi 2023-11-10 11:37:43 +01:00
parent 65ed417b26
commit ac4ba5b1a4
2 changed files with 12 additions and 13 deletions

View File

@ -20,6 +20,7 @@ local cursorGlowTopImages = {
local cursorGlowWhite = gfx.CreateSkinImage("gameplay/crit_line/cursor_glow_white.png", 0);
local cursorGlowColor = gfx.CreateSkinImage("gameplay/crit_line/cursor_glow_color.png", 0);
local cursorTailColor = gfx.CreateSkinImage("gameplay/crit_line/cursor_tail_color.png", 0)
local cursorTailImages = {
gfx.CreateSkinImage("gameplay/crit_line/cursor_tail_l.png", 0),
gfx.CreateSkinImage("gameplay/crit_line/cursor_tail_r.png", 0),
@ -40,6 +41,7 @@ local drawCursors = function (scale, cursors, laserActive)
for i = 0, 1, 1 do
local luaIndex = i + 1
local cursor = cursors[i];
local r, g, b = game.GetLaserColor(i);
gfx.Save();
gfx.BeginPath();
@ -51,23 +53,20 @@ local drawCursors = function (scale, cursors, laserActive)
local cursorX = cursorPos - cursorW / 2;
local cursorY = -cursorH / 2;
if laserActive[luaIndex] then
gfx.SetImageTint(r, g, b);
gfx.ImageRect(
cursorPos - tailW / 2,
- tailH / 2,
tailW,
tailH,
cursorTailImages[luaIndex],
cursorTailColor,
cursor.alpha / 2,
0
)
end
local glowAlpha = cursor.alpha;
if (i == 1) then glowAlpha = glowAlpha * 0.7; end
local r, g, b = game.GetLaserColor(i);
gfx.ImageRect(
cursorX,
cursorY,

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB