add tintable laser cursor tails
This commit is contained in:
parent
65ed417b26
commit
ac4ba5b1a4
|
@ -20,6 +20,7 @@ local cursorGlowTopImages = {
|
||||||
|
|
||||||
local cursorGlowWhite = gfx.CreateSkinImage("gameplay/crit_line/cursor_glow_white.png", 0);
|
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 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 = {
|
local cursorTailImages = {
|
||||||
gfx.CreateSkinImage("gameplay/crit_line/cursor_tail_l.png", 0),
|
gfx.CreateSkinImage("gameplay/crit_line/cursor_tail_l.png", 0),
|
||||||
gfx.CreateSkinImage("gameplay/crit_line/cursor_tail_r.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
|
for i = 0, 1, 1 do
|
||||||
local luaIndex = i + 1
|
local luaIndex = i + 1
|
||||||
local cursor = cursors[i];
|
local cursor = cursors[i];
|
||||||
|
local r, g, b = game.GetLaserColor(i);
|
||||||
|
|
||||||
gfx.Save();
|
gfx.Save();
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
|
@ -51,23 +53,20 @@ local drawCursors = function (scale, cursors, laserActive)
|
||||||
local cursorX = cursorPos - cursorW / 2;
|
local cursorX = cursorPos - cursorW / 2;
|
||||||
local cursorY = -cursorH / 2;
|
local cursorY = -cursorH / 2;
|
||||||
|
|
||||||
if laserActive[luaIndex] then
|
gfx.SetImageTint(r, g, b);
|
||||||
gfx.ImageRect(
|
gfx.ImageRect(
|
||||||
cursorPos - tailW / 2,
|
cursorPos - tailW / 2,
|
||||||
- tailH / 2,
|
- tailH / 2,
|
||||||
tailW,
|
tailW,
|
||||||
tailH,
|
tailH,
|
||||||
cursorTailImages[luaIndex],
|
cursorTailColor,
|
||||||
cursor.alpha / 2,
|
cursor.alpha / 2,
|
||||||
0
|
0
|
||||||
)
|
)
|
||||||
end
|
|
||||||
|
|
||||||
local glowAlpha = cursor.alpha;
|
local glowAlpha = cursor.alpha;
|
||||||
if (i == 1) then glowAlpha = glowAlpha * 0.7; end
|
if (i == 1) then glowAlpha = glowAlpha * 0.7; end
|
||||||
|
|
||||||
local r, g, b = game.GetLaserColor(i);
|
|
||||||
|
|
||||||
gfx.ImageRect(
|
gfx.ImageRect(
|
||||||
cursorX,
|
cursorX,
|
||||||
cursorY,
|
cursorY,
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
Loading…
Reference in New Issue