> split song select header to component & / z-index issue with filter wheel and header and footer
This commit is contained in:
parent
da48de6957
commit
de5174a76a
|
@ -60,7 +60,11 @@ local progressTransitions = function ()
|
|||
footerY = resy-FOOTER_HEIGHT+entryTransitionFooterYOffset;
|
||||
end
|
||||
|
||||
local draw = function ()
|
||||
local draw = function (params)
|
||||
if (params and params.noEnterTransition) then
|
||||
entryTransitionScale = 1;
|
||||
end
|
||||
|
||||
gfx.Save()
|
||||
resetLayoutInformation()
|
||||
gfx.Scale(scale, scale)
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
|
||||
|
||||
local resx, resy = game.GetResolution();
|
||||
local desw = 1080;
|
||||
local desh = 1920;
|
||||
local scale = 1;
|
||||
|
||||
local BAR_ALPHA = 191;
|
||||
|
||||
local HEADER_HEIGHT = 100
|
||||
local headerY = 0;
|
||||
|
||||
local animationHeaderGlowScale = 0;
|
||||
local animationHeaderGlowAlpha = 0;
|
||||
|
||||
-- Images
|
||||
local headerTitleImage = gfx.CreateSkinImage("song_select/header/title.png", 1)
|
||||
local headerGlowTitleImage = gfx.CreateSkinImage("song_select/header/title_glow.png", 1)
|
||||
|
||||
function resetLayoutInformation()
|
||||
resx, resy = game.GetResolution()
|
||||
desw = 1080
|
||||
desh = 1920
|
||||
scale = resx / desw
|
||||
end
|
||||
|
||||
local drawHeader = function ()
|
||||
gfx.BeginPath();
|
||||
gfx.FillColor(0,0,0,BAR_ALPHA);
|
||||
gfx.Rect(0,0,desw, HEADER_HEIGHT);
|
||||
gfx.Fill();
|
||||
gfx.ClosePath()
|
||||
|
||||
gfx.ImageRect(42, 14, 423*0.85, 80*0.85, headerTitleImage, 1, 0)
|
||||
gfx.ImageRect(42, 14, 423*0.85, 80*0.85, headerGlowTitleImage, animationHeaderGlowAlpha, 0)
|
||||
end
|
||||
|
||||
local progressTransitions = function (deltatime)
|
||||
-- HEADER GLOW ANIMATION
|
||||
if animationHeaderGlowScale < 1 then
|
||||
animationHeaderGlowScale = animationHeaderGlowScale + deltatime / 1 -- transition should last for that time in seconds
|
||||
else
|
||||
animationHeaderGlowScale = 0
|
||||
end
|
||||
|
||||
if animationHeaderGlowScale < 0.5 then
|
||||
animationHeaderGlowAlpha = animationHeaderGlowScale * 2;
|
||||
else
|
||||
animationHeaderGlowAlpha = 1-((animationHeaderGlowScale-0.5) * 2);
|
||||
end
|
||||
animationHeaderGlowAlpha = animationHeaderGlowAlpha*0.4
|
||||
end
|
||||
|
||||
local draw = function (deltatime)
|
||||
gfx.Save()
|
||||
resetLayoutInformation()
|
||||
gfx.Scale(scale, scale)
|
||||
|
||||
gfx.LoadSkinFont("NotoSans-Regular.ttf");
|
||||
|
||||
drawHeader();
|
||||
|
||||
progressTransitions(deltatime);
|
||||
gfx.Restore()
|
||||
end
|
||||
|
||||
return {
|
||||
draw = draw
|
||||
};
|
|
@ -1,5 +1,7 @@
|
|||
require('common')
|
||||
local Easing = require('common.easings');
|
||||
local SongSelectHeader = require('components.headers.songSelectHeader')
|
||||
local Footer = require('components.footer');
|
||||
|
||||
local defaultFolderBgImage = gfx.CreateSkinImage('song_select/filter_wheel/bg.png', 0)
|
||||
|
||||
|
@ -233,16 +235,29 @@ function tickTransitions(deltaTime)
|
|||
end
|
||||
end
|
||||
|
||||
render = function(deltaTime, shown)
|
||||
if not shown then return end
|
||||
function drawFilterWheel(deltatime)
|
||||
gfx.ResetTransform()
|
||||
resetLayoutInformation()
|
||||
tickTransitions(deltaTime);
|
||||
tickTransitions(deltatime);
|
||||
gfx.Scale(scale,scale);
|
||||
|
||||
drawFolderList()
|
||||
|
||||
drawCursor()
|
||||
end
|
||||
|
||||
render = function(deltatime, shown)
|
||||
if not shown then
|
||||
game.SetSkinSetting('_songWheelOverlayActive', 0);
|
||||
else
|
||||
game.SetSkinSetting('_songWheelOverlayActive', 1);
|
||||
drawFilterWheel(deltatime)
|
||||
end
|
||||
|
||||
SongSelectHeader.draw(deltatime);
|
||||
Footer.draw({
|
||||
noEnterTransition = true
|
||||
});
|
||||
|
||||
-- Debug text
|
||||
gfx.BeginPath();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
require('common')
|
||||
local Easing = require('common.easings');
|
||||
local SongSelectHeader = require('components.headers.songSelectHeader');
|
||||
local Footer = require('components.footer');
|
||||
|
||||
local HEADER_HEIGHT = 100;
|
||||
|
@ -445,20 +446,6 @@ function drawSearch()
|
|||
gfx.Text(songwheel.searchText, desw-200, 30);
|
||||
end
|
||||
|
||||
function drawHeader()
|
||||
gfx.Save()
|
||||
gfx.BeginPath();
|
||||
gfx.FillColor(0,0,0,BAR_ALPHA);
|
||||
gfx.Rect(0,0,desw, HEADER_HEIGHT);
|
||||
gfx.Fill();
|
||||
gfx.ClosePath()
|
||||
|
||||
gfx.ImageRect(42, 14, 423*0.85, 80*0.85, headerTitleImage, 1, 0)
|
||||
gfx.ImageRect(42, 14, 423*0.85, 80*0.85, headerGlowTitleImage, animationHeaderGlowAlpha, 0)
|
||||
|
||||
gfx.Restore()
|
||||
end
|
||||
|
||||
function tickTransitions(deltaTime)
|
||||
if transitionScrollScale < 1 then
|
||||
transitionScrollScale = transitionScrollScale + deltaTime / 0.1 -- transition should last for that time in seconds
|
||||
|
@ -535,20 +522,6 @@ function tickTransitions(deltaTime)
|
|||
else
|
||||
transitionAfterscrollJacketBgAlpha = 1;
|
||||
end
|
||||
|
||||
-- HEADER GLOW ANIMATION
|
||||
if animationHeaderGlowScale < 1 then
|
||||
animationHeaderGlowScale = animationHeaderGlowScale + deltaTime / 1 -- transition should last for that time in seconds
|
||||
else
|
||||
animationHeaderGlowScale = 0
|
||||
end
|
||||
|
||||
if animationHeaderGlowScale < 0.5 then
|
||||
animationHeaderGlowAlpha = animationHeaderGlowScale * 2;
|
||||
else
|
||||
animationHeaderGlowAlpha = 1-((animationHeaderGlowScale-0.5) * 2);
|
||||
end
|
||||
animationHeaderGlowAlpha = animationHeaderGlowAlpha*0.4
|
||||
end
|
||||
|
||||
|
||||
|
@ -570,8 +543,10 @@ render = function (deltaTime)
|
|||
|
||||
drawSearch();
|
||||
|
||||
drawHeader();
|
||||
Footer.draw();
|
||||
-- if (game.GetSkinSetting('_songWheelOverlayActive') ~= 1) then
|
||||
-- SongSelectHeader.draw(deltaTime);
|
||||
-- Footer.draw();
|
||||
-- end
|
||||
|
||||
|
||||
gfx.BeginPath();
|
||||
|
|
Loading…
Reference in New Issue