* make gauge work... kind of

This commit is contained in:
FajsiEx 2021-07-25 21:33:40 +02:00
parent fd2080941f
commit b30fcb3c22
11 changed files with 13 additions and 9 deletions

View File

@ -695,21 +695,25 @@ end
-- -------------------------------------------------------------------------- -- -- -------------------------------------------------------------------------- --
-- draw_gauge: -- -- draw_gauge: --
local gaugeNumBack = gfx.CreateSkinImage("gauge_num_back.png", 0) local gaugeNumBack = gfx.CreateSkinImage("gauge_num_back.png", 0)
gfx.SetGaugeColor(0, 47, 244, 255) --Normal gauge fail local gaugeBgImage = gfx.CreateSkinImage("gameplay/gauges/hard/gauge_back.png", 0)
gfx.SetGaugeColor(1, 252, 76, 171) --Normal gauge clear local gaugeFillImage = gfx.CreateSkinImage("gameplay/gauges/hard/gauge_fill.png", 0)
gfx.SetGaugeColor(2, 255, 255, 255) --Hard gauge low (<30%)
gfx.SetGaugeColor(3, 255, 255, 255) --Hard gauge high (>30%)
function draw_gauge(deltaTime) function draw_gauge(deltaTime)
local height = 702 * scale / 1
local width = 82 * scale / 1 local width = 82 * scale / 1
local posy = resy / 2 - height / 2 + 60 local height = 702 * scale / 1
local posx = resx - width local posx = resx - width
local posy = resy / 2 - height / 2 + 60
if portrait then if portrait then
posy = posy - 90
posx = resx - width posx = resx - width
posy = posy - 90
end end
gfx.DrawGauge(gameplay.gauge.value, posx, posy, width, height, deltaTime)
local tw, th = gfx.ImageSize(gaugeBgImage)
gfx.ImageRect(posx, posy, tw, th, gaugeBgImage, 1, 0)
gfx.ImageRect(posx+22, posy+11+(629-(629*(gameplay.gauge.value))), 23, 629*(gameplay.gauge.value), gaugeFillImage, 1, 0)
--draw gauge % label --draw gauge % label
posx = posx / scale posx = posx / scale
@ -718,7 +722,7 @@ function draw_gauge(deltaTime)
height = 960 * 0.5 height = 960 * 0.5
posy = posy / scale posy = posy / scale
local tw, th = gfx.ImageSize(gaugeNumBack) tw, th = gfx.ImageSize(gaugeNumBack)
-- 80 = 100% position -- 80 = 100% position
posy = posy + (95 * 0.5) + height - height * gameplay.gauge.value posy = posy + (95 * 0.5) + height - height * gameplay.gauge.value
-- Draw the background -- Draw the background

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 95 B

After

Width:  |  Height:  |  Size: 95 B

View File

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 95 B

After

Width:  |  Height:  |  Size: 95 B

View File

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB