From 6a631ea9affccc10816c7ba59e612fe2ab1f3093 Mon Sep 17 00:00:00 2001 From: FajsiEx Date: Tue, 12 Oct 2021 19:56:18 +0200 Subject: [PATCH] + song panel & + bpm and lanespeed texts to it --- scripts/gameplay.lua | 2 + scripts/gameplay/song_panel.lua | 64 ++++++++++++++++++ .../song_panel/bg_left.png} | Bin .../song_panel/bg_right.png} | Bin 4 files changed, 66 insertions(+) create mode 100644 scripts/gameplay/song_panel.lua rename textures/{song back v2/songback_album.png => gameplay/song_panel/bg_left.png} (100%) rename textures/{song back v2/songback_title.png => gameplay/song_panel/bg_right.png} (100%) diff --git a/scripts/gameplay.lua b/scripts/gameplay.lua index 5572d39..9b464ca 100644 --- a/scripts/gameplay.lua +++ b/scripts/gameplay.lua @@ -5,6 +5,7 @@ local Banner = require('gameplay.banner') local CritLine = require('gameplay.crit_line') local Console = require('gameplay.console') local UserPanel = require('gameplay.user_panel') +local SongPanel = require('gameplay.song_panel') local ScorePanel = require('gameplay.score_panel') local Gauge = require('gameplay.gauge') local Chain = require('gameplay.chain') @@ -32,6 +33,7 @@ function render(deltaTime) Banner.render(deltaTime); UserPanel.render(deltaTime); + SongPanel.render(deltaTime, gameplay.bpm, gameplay.hispeed); ScorePanel.render(deltaTime, score, maxChain) Gauge.render( diff --git a/scripts/gameplay/song_panel.lua b/scripts/gameplay/song_panel.lua new file mode 100644 index 0000000..d4eb68a --- /dev/null +++ b/scripts/gameplay/song_panel.lua @@ -0,0 +1,64 @@ + +local desw = 1080; +local desh = 1920; + +local bgLeftImage = gfx.CreateSkinImage("gameplay/song_panel/bg_left.png", 0); +local bgRightImage = gfx.CreateSkinImage("gameplay/song_panel/bg_right.png", 0); + + +local renderOutlinedText = function (x,y, text, outlineWidth) + gfx.BeginPath(); + gfx.FillColor(0,0,0,255); + gfx.Text(text, x-outlineWidth, y+outlineWidth); + gfx.Text(text, x-outlineWidth, y-outlineWidth); + gfx.Text(text, x+outlineWidth, y+outlineWidth); + gfx.Text(text, x+outlineWidth, y-outlineWidth); + + gfx.FillColor(255,255,255,255); + gfx.Text(text, x, y); +end + +local tickTransitions = function (deltaTime) + +end + +local render = function (deltaTime, bpm, laneSpeed) + tickTransitions(deltaTime) + + local y = 210; + + gfx.BeginPath(); + gfx.ImageRect( + 0, + y, + 884*0.85, + 374*0.85, + bgLeftImage, + 1, + 0 + ); + + gfx.BeginPath(); + gfx.ImageRect( + 200, + y, + 1016*0.85, + 122*0.85, + bgRightImage, + 1, + 0 + ); + + gfx.FontSize(30); + gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE) + renderOutlinedText(25,y+247, "BPM", 2); + renderOutlinedText(25,y+281, "LANE-SPEED", 2); + + gfx.TextAlign(gfx.TEXT_ALIGN_RIGHT + gfx.TEXT_ALIGN_MIDDLE) + renderOutlinedText(260,y+247, string.format("%.0f", bpm), 2); + renderOutlinedText(260,y+281, string.format("%.2f", laneSpeed), 2); +end + +return { + render=render +} \ No newline at end of file diff --git a/textures/song back v2/songback_album.png b/textures/gameplay/song_panel/bg_left.png similarity index 100% rename from textures/song back v2/songback_album.png rename to textures/gameplay/song_panel/bg_left.png diff --git a/textures/song back v2/songback_title.png b/textures/gameplay/song_panel/bg_right.png similarity index 100% rename from textures/song back v2/songback_title.png rename to textures/gameplay/song_panel/bg_right.png