+ landscape support to song panel
This commit is contained in:
parent
43ba7ef62e
commit
09dc795ee6
|
@ -6,6 +6,11 @@ local BANNER_H = 368;
|
||||||
|
|
||||||
|
|
||||||
local render = function (deltaTime)
|
local render = function (deltaTime)
|
||||||
|
local resx, resy = game.GetResolution();
|
||||||
|
if (resx > resy) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
-- Get the banner downscaled in whatever resolution it is, while maintaining the aspect ratio
|
-- Get the banner downscaled in whatever resolution it is, while maintaining the aspect ratio
|
||||||
local tw,th = gfx.ImageSize(bannerBaseImage);
|
local tw,th = gfx.ImageSize(bannerBaseImage);
|
||||||
BANNER_H = th * (1080/tw);
|
BANNER_H = th * (1080/tw);
|
||||||
|
|
|
@ -19,6 +19,11 @@ end
|
||||||
|
|
||||||
|
|
||||||
local render = function (deltaTime, critLineCenterX, critLineCenterY, critLineRotation)
|
local render = function (deltaTime, critLineCenterX, critLineCenterY, critLineRotation)
|
||||||
|
local resx, resy = game.GetResolution();
|
||||||
|
if (resx > resy) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
setUpTransforms(
|
setUpTransforms(
|
||||||
critLineCenterX,
|
critLineCenterX,
|
||||||
critLineCenterY,
|
critLineCenterY,
|
||||||
|
|
|
@ -4,6 +4,8 @@ local DiffRectangle = require('components.diff_rectangle');
|
||||||
local desw = 1080;
|
local desw = 1080;
|
||||||
local desh = 1920;
|
local desh = 1920;
|
||||||
|
|
||||||
|
local isLandscape = false;
|
||||||
|
|
||||||
local bgLeftImage = gfx.CreateSkinImage("gameplay/song_panel/bg_left.png", 0);
|
local bgLeftImage = gfx.CreateSkinImage("gameplay/song_panel/bg_left.png", 0);
|
||||||
local bgRightImage = gfx.CreateSkinImage("gameplay/song_panel/bg_right.png", 0);
|
local bgRightImage = gfx.CreateSkinImage("gameplay/song_panel/bg_right.png", 0);
|
||||||
|
|
||||||
|
@ -37,6 +39,15 @@ local tickTransitions = function (deltaTime)
|
||||||
end
|
end
|
||||||
|
|
||||||
local render = function (deltaTime, bpm, laneSpeed, jacketPath, diff, level, progress, songTitle, songArtist)
|
local render = function (deltaTime, bpm, laneSpeed, jacketPath, diff, level, progress, songTitle, songArtist)
|
||||||
|
gfx.Save();
|
||||||
|
|
||||||
|
local resx, resy = game.GetResolution();
|
||||||
|
isLandscape = resx > resy;
|
||||||
|
|
||||||
|
if (isLandscape) then
|
||||||
|
gfx.Scale(0.7, 0.7);
|
||||||
|
end
|
||||||
|
|
||||||
if (not loadedJacketImage and jacketPath) then
|
if (not loadedJacketImage and jacketPath) then
|
||||||
loadJacketImage(jacketPath)
|
loadJacketImage(jacketPath)
|
||||||
end
|
end
|
||||||
|
@ -44,7 +55,7 @@ local render = function (deltaTime, bpm, laneSpeed, jacketPath, diff, level, pro
|
||||||
tickTransitions(deltaTime)
|
tickTransitions(deltaTime)
|
||||||
|
|
||||||
|
|
||||||
local y = 210;
|
local y = isLandscape and 0 or 210;
|
||||||
|
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
gfx.ImageRect(
|
gfx.ImageRect(
|
||||||
|
@ -72,7 +83,7 @@ local render = function (deltaTime, bpm, laneSpeed, jacketPath, diff, level, pro
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
gfx.ImageRect(
|
gfx.ImageRect(
|
||||||
32,
|
32,
|
||||||
241.25, -- why does this need to be here?
|
y+31.25, -- why does this need to be here?
|
||||||
105,
|
105,
|
||||||
105,
|
105,
|
||||||
jacketImage,
|
jacketImage,
|
||||||
|
@ -81,7 +92,7 @@ local render = function (deltaTime, bpm, laneSpeed, jacketPath, diff, level, pro
|
||||||
);
|
);
|
||||||
|
|
||||||
-- Draw diff rectangle
|
-- Draw diff rectangle
|
||||||
DiffRectangle.render(deltaTime, 31, 350, 0.84, diff, level);
|
DiffRectangle.render(deltaTime, 31, y+140, 0.84, diff, level);
|
||||||
|
|
||||||
gfx.FontSize(30);
|
gfx.FontSize(30);
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
|
||||||
|
@ -97,13 +108,13 @@ local render = function (deltaTime, bpm, laneSpeed, jacketPath, diff, level, pro
|
||||||
-- Draw progress
|
-- Draw progress
|
||||||
gfx.BeginPath()
|
gfx.BeginPath()
|
||||||
gfx.FillColor(244, 204, 101)
|
gfx.FillColor(244, 204, 101)
|
||||||
gfx.Rect(222, 291, 622 * progress, 3)
|
gfx.Rect(222, y+81, 622 * progress, 3)
|
||||||
gfx.Fill()
|
gfx.Fill()
|
||||||
|
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
gfx.ImageRect(
|
gfx.ImageRect(
|
||||||
208 + 622 * progress + ((1-progress) * 8),
|
208 + 622 * progress + ((1-progress) * 8),
|
||||||
288.5,
|
y+78.5,
|
||||||
24*0.85,
|
24*0.85,
|
||||||
10*0.85,
|
10*0.85,
|
||||||
progressDotImage,
|
progressDotImage,
|
||||||
|
@ -115,7 +126,9 @@ local render = function (deltaTime, bpm, laneSpeed, jacketPath, diff, level, pro
|
||||||
|
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
|
||||||
gfx.FontSize(22)
|
gfx.FontSize(22)
|
||||||
gfx.Text(songTitle .. ' / ' .. songArtist, 385, 270);
|
gfx.Text(songTitle .. ' / ' .. songArtist, 385, y+60);
|
||||||
|
|
||||||
|
gfx.Restore();
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue