+ glowing infinite track header to songwheel
This commit is contained in:
parent
73cdc89eac
commit
5eca344e2e
|
@ -2,6 +2,9 @@ require('common')
|
||||||
local Easing = require('common.easings');
|
local Easing = require('common.easings');
|
||||||
local Footer = require('components.footer');
|
local Footer = require('components.footer');
|
||||||
|
|
||||||
|
local HEADER_HEIGHT = 128;
|
||||||
|
local BAR_ALPHA = 191;
|
||||||
|
|
||||||
local backgroundImage = gfx.CreateSkinImage("song_select/bg.png", 1)
|
local backgroundImage = gfx.CreateSkinImage("song_select/bg.png", 1)
|
||||||
local dataPanelImage = gfx.CreateSkinImage("song_select/data_bg_overlay.png", 1)
|
local dataPanelImage = gfx.CreateSkinImage("song_select/data_bg_overlay.png", 1)
|
||||||
local dataGlowOverlayImage = gfx.CreateSkinImage("song_select/data_panel/data_glow_overlay.png", 1)
|
local dataGlowOverlayImage = gfx.CreateSkinImage("song_select/data_panel/data_glow_overlay.png", 1)
|
||||||
|
@ -17,6 +20,9 @@ local diffCursorImage = gfx.CreateSkinImage("song_select/level_cursor.png", 1)
|
||||||
|
|
||||||
local searchBgImage = gfx.CreateSkinImage("song_select/search_bg.png", 1)
|
local searchBgImage = gfx.CreateSkinImage("song_select/search_bg.png", 1)
|
||||||
|
|
||||||
|
local headerTitleImage = gfx.CreateSkinImage("song_select/header/title.png", 1)
|
||||||
|
local headerGlowTitleImage = gfx.CreateSkinImage("song_select/header/title_glow.png", 1)
|
||||||
|
|
||||||
local defaultJacketImage = gfx.CreateSkinImage("song_select/loading.png", 0)
|
local defaultJacketImage = gfx.CreateSkinImage("song_select/loading.png", 0)
|
||||||
|
|
||||||
local difficultyLabelImages = {
|
local difficultyLabelImages = {
|
||||||
|
@ -109,6 +115,9 @@ local transitionAfterscrollTextSongArtist = 0;
|
||||||
local transitionAfterscrollDifficultiesAlpha = 0;
|
local transitionAfterscrollDifficultiesAlpha = 0;
|
||||||
local transitionAfterscrollJacketBgAlpha = 0;
|
local transitionAfterscrollJacketBgAlpha = 0;
|
||||||
|
|
||||||
|
local animationHeaderGlowScale = 0;
|
||||||
|
local animationHeaderGlowAlpha = 0;
|
||||||
|
|
||||||
function resetLayoutInformation()
|
function resetLayoutInformation()
|
||||||
resx, resy = game.GetResolution()
|
resx, resy = game.GetResolution()
|
||||||
desw = 1080
|
desw = 1080
|
||||||
|
@ -420,6 +429,20 @@ function drawSearch()
|
||||||
gfx.Text(songwheel.searchText, desw-200, 30);
|
gfx.Text(songwheel.searchText, desw-200, 30);
|
||||||
end
|
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(28, 28, 423*0.85, 80*0.85, headerTitleImage, 1, 0)
|
||||||
|
gfx.ImageRect(28, 28, 423*0.85, 80*0.85, headerGlowTitleImage, animationHeaderGlowAlpha, 0)
|
||||||
|
|
||||||
|
gfx.Restore()
|
||||||
|
end
|
||||||
|
|
||||||
function tickTransitions(deltaTime)
|
function tickTransitions(deltaTime)
|
||||||
if transitionScrollScale < 1 then
|
if transitionScrollScale < 1 then
|
||||||
transitionScrollScale = transitionScrollScale + deltaTime / 0.1 -- transition should last for that time in seconds
|
transitionScrollScale = transitionScrollScale + deltaTime / 0.1 -- transition should last for that time in seconds
|
||||||
|
@ -496,6 +519,20 @@ function tickTransitions(deltaTime)
|
||||||
else
|
else
|
||||||
transitionAfterscrollJacketBgAlpha = 1;
|
transitionAfterscrollJacketBgAlpha = 1;
|
||||||
end
|
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.3
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -517,6 +554,7 @@ render = function (deltaTime)
|
||||||
|
|
||||||
drawSearch();
|
drawSearch();
|
||||||
|
|
||||||
|
drawHeader();
|
||||||
Footer.draw();
|
Footer.draw();
|
||||||
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 8.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 480 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Loading…
Reference in New Issue