+ finish diff rect component

This commit is contained in:
FajsiEx 2021-10-28 11:02:11 +02:00
parent 3a4ba85885
commit ec08c8ece3
3 changed files with 37 additions and 7 deletions

View File

@ -10,18 +10,40 @@ local difficultyLabelImages = {
gfx.CreateSkinImage("diff/8 vivid.png", 0)
}
function render(deltatime, x, y, diff, level)
local difficultyLabelTexts = {
"NOV",
"ADV",
"EXH",
"MXM",
"GRV",
"HVN",
"VVD"
}
function render(deltatime, x, y, scale, diff, level)
gfx.Save()
gfx.Translate(x,y);
gfx.Scale(scale,scale)
gfx.LoadSkinFont('Digital-Serial-Bold.ttf')
gfx.BeginPath();
gfx.ImageRect(x, y, 140 / 1.5, 31 / 1.5,
difficultyLabelImages[diff] or
gfx.ImageRect(0, 0, 140, 31 ,
difficultyLabelImages[diff+1] or
difficultyLabelImages[4], 1, 0);
gfx.FontSize(17)
gfx.FontSize(24)
gfx.LoadSkinFont('Digital-Serial-Bold.ttf')
gfx.TextAlign(gfx.TEXT_ALIGN_RIGHT + gfx.TEXT_ALIGN_MIDDLE)
gfx.Text(level, x + 50, y+8);
gfx.Text(level, 120, 16);
gfx.FontSize(22)
gfx.Scale(1.2,1); -- Make the diff text more W I D E
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
gfx.Text(difficultyLabelTexts[diff+1], 18, 17);
-- -- Draw volforce badge
@ -31,6 +53,9 @@ function render(deltatime, x, y, diff, level)
-- -- Draw volforce label
-- gfx.FontSize(11)
-- gfx.Text('VOLFORCE', x + 47, y + 14);
gfx.ResetTransform()
gfx.Restore()
end
return {

View File

@ -33,7 +33,7 @@ function render(deltaTime)
Banner.render(deltaTime);
UserPanel.render(deltaTime);
SongPanel.render(deltaTime, gameplay.bpm, gameplay.hispeed, gameplay.jacketPath);
SongPanel.render(deltaTime, gameplay.bpm, gameplay.hispeed, gameplay.jacketPath, gameplay.difficulty, gameplay.level);
ScorePanel.render(deltaTime, score, maxChain)
Gauge.render(

View File

@ -1,4 +1,6 @@
local DiffRectangle = require('components.diff_rectangle');
local desw = 1080;
local desh = 1920;
@ -32,7 +34,7 @@ local tickTransitions = function (deltaTime)
end
local render = function (deltaTime, bpm, laneSpeed, jacketPath)
local render = function (deltaTime, bpm, laneSpeed, jacketPath, diff, level)
if (not loadedJacketImage and jacketPath) then
loadJacketImage(jacketPath)
end
@ -75,6 +77,9 @@ local render = function (deltaTime, bpm, laneSpeed, jacketPath)
1,
0
);
-- Draw diff rectangle
DiffRectangle.render(deltaTime, 31, 350, 0.84, diff, level);
gfx.FontSize(30);
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)