Merge branch 'master' of github.com:FajsiEx/exceed
This commit is contained in:
commit
2b710798e5
|
@ -74,8 +74,7 @@ local draw = function (deltaTime, params)
|
|||
end
|
||||
|
||||
gfx.Save()
|
||||
resetLayoutInformation()
|
||||
gfx.Scale(scale, scale)
|
||||
|
||||
|
||||
gfx.LoadSkinFont("NotoSans-Regular.ttf");
|
||||
|
||||
|
|
|
@ -17,12 +17,6 @@ local animationHeaderGlowAlpha = 0;
|
|||
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();
|
||||
|
@ -53,8 +47,6 @@ end
|
|||
|
||||
local draw = function (deltatime)
|
||||
gfx.Save()
|
||||
resetLayoutInformation()
|
||||
gfx.Scale(scale, scale)
|
||||
|
||||
gfx.LoadSkinFont("NotoSans-Regular.ttf");
|
||||
|
||||
|
|
|
@ -105,12 +105,53 @@ local render = function (deltaTime, gaugeType, gaugeValue, isArsEnabled)
|
|||
gfx.BeginPath()
|
||||
gfx.FillColor(255, 255, 255)
|
||||
gfx.LoadSkinFont("Digital-Serial-Bold.ttf")
|
||||
gfx.FontSize(22)
|
||||
gfx.TextAlign(gfx.TEXT_ALIGN_RIGHT + gfx.TEXT_ALIGN_MIDDLE)
|
||||
gfx.Text(math.floor(gaugeValue * 100), gaugePosX-16, gaugeMarkerY+17)
|
||||
|
||||
-- The big number
|
||||
local gaugePercent = gaugeValue * 100;
|
||||
local bigNumber = 0;
|
||||
local smallNumber = 0;
|
||||
local smallNumberX = gaugePosX-38;
|
||||
if (gaugePercent < 10) then
|
||||
bigNumber = math.floor(gaugePercent) .. '.';
|
||||
|
||||
local decimalPortion = math.floor(
|
||||
(
|
||||
gaugePercent -
|
||||
math.floor(gaugePercent)
|
||||
) * 100
|
||||
);
|
||||
smallNumber = string.format('%02d', decimalPortion);
|
||||
smallNumberX = gaugePosX-38;
|
||||
elseif (gaugePercent < 100) then
|
||||
bigNumber = math.floor(gaugePercent) .. '.';
|
||||
|
||||
local decimalPortion = math.floor(
|
||||
(
|
||||
gaugePercent -
|
||||
math.floor(gaugePercent)
|
||||
) * 10
|
||||
);
|
||||
smallNumber = decimalPortion;
|
||||
smallNumberX = gaugePosX-26;
|
||||
else
|
||||
bigNumber = '100';
|
||||
smallNumber = 0;
|
||||
smallNumberX = -100; -- yeet it out of existance
|
||||
end
|
||||
|
||||
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
|
||||
|
||||
-- big text
|
||||
gfx.FontSize(22)
|
||||
gfx.Text(bigNumber, gaugePosX-56, gaugeMarkerY+16.5)
|
||||
|
||||
-- small text
|
||||
gfx.FontSize(18)
|
||||
gfx.Text(smallNumber, smallNumberX, gaugeMarkerY+17.5)
|
||||
|
||||
-- %
|
||||
gfx.FontSize(16)
|
||||
gfx.Text('%', gaugePosX-4, gaugeMarkerY+17)
|
||||
gfx.Text('%', gaugePosX-15, gaugeMarkerY+16.5)
|
||||
end
|
||||
|
||||
return {
|
||||
|
|
|
@ -3,6 +3,8 @@ local Easing = require('common.easings');
|
|||
local SongSelectHeader = require('components.headers.songSelectHeader')
|
||||
local Footer = require('components.footer');
|
||||
|
||||
local backgroundImage = gfx.CreateSkinImage("bg_pattern.png", gfx.IMAGE_REPEATX | gfx.IMAGE_REPEATY)
|
||||
|
||||
local defaultFolderBgImage = gfx.CreateSkinImage('song_select/filter_wheel/bg.png', 0)
|
||||
local collectionFolderBgImage = gfx.CreateSkinImage('song_select/filter_wheel/col_bg.png', 0)
|
||||
local subFolderBgImage = gfx.CreateSkinImage('song_select/filter_wheel/sub_bg.png', 0)
|
||||
|
@ -107,6 +109,24 @@ local transitionLeaveScale = 1;
|
|||
local transitionLeaveReappearTimer = 0;
|
||||
local TRANSITION_LEAVE_DURATION = 0.1;
|
||||
|
||||
-- Window variables
|
||||
local resX, resY
|
||||
|
||||
-- Aspect Ratios
|
||||
local landscapeWidescreenRatio = 16 / 9
|
||||
local landscapeStandardRatio = 4 / 3
|
||||
local portraitWidescreenRatio = 9 / 16
|
||||
|
||||
-- Portrait sizes
|
||||
local fullX, fullY
|
||||
|
||||
local resolutionChange = function(x, y)
|
||||
resX = x
|
||||
resY = y
|
||||
fullX = portraitWidescreenRatio * y
|
||||
fullY = y
|
||||
end
|
||||
|
||||
function resetLayoutInformation()
|
||||
resx, resy = game.GetResolution()
|
||||
scale = resx / desw
|
||||
|
@ -260,6 +280,8 @@ function drawCursor()
|
|||
end
|
||||
|
||||
function drawScrollbar()
|
||||
if not isFilterWheelActive or transitionLeaveScale ~= 0 then return end
|
||||
|
||||
gfx.BeginPath()
|
||||
local bgW = 13*0.85;
|
||||
local bgH = 1282*0.85;
|
||||
|
@ -321,34 +343,23 @@ function tickTransitions(deltaTime)
|
|||
end
|
||||
end
|
||||
|
||||
function drawFilterWheel(deltatime)
|
||||
gfx.ResetTransform()
|
||||
resetLayoutInformation()
|
||||
function drawFilterWheelContent(deltatime)
|
||||
tickTransitions(deltatime);
|
||||
gfx.Scale(scale, scale);
|
||||
|
||||
drawFolderList()
|
||||
end
|
||||
|
||||
render = function(deltatime, shown)
|
||||
isFilterWheelActive = shown;
|
||||
drawFilterWheel(deltatime)
|
||||
local drawFilterWheel = function (x,y,w,h, deltaTime)
|
||||
gfx.Translate(x,y);
|
||||
gfx.Scale(w/1080, h/1920);
|
||||
|
||||
if not shown then
|
||||
game.SetSkinSetting('_songWheelOverlayActive', 0);
|
||||
else
|
||||
game.SetSkinSetting('_songWheelOverlayActive', 1);
|
||||
end
|
||||
|
||||
game.SetSkinSetting('_songWheelActiveFolderLabel', getFolderData(filters.folder[selectedFolder]).label);
|
||||
game.SetSkinSetting('_songWheelActiveSubFolderLabel', getFolderData(filters.level[selectedLevel]).label);
|
||||
|
||||
drawFilterWheelContent(deltaTime)
|
||||
drawCursor()
|
||||
drawScrollbar()
|
||||
|
||||
SongSelectHeader.draw(deltatime);
|
||||
Footer.draw(deltatime);
|
||||
|
||||
|
||||
if (game.GetSkinSetting('_currentScreen') == 'songwheel') then
|
||||
SongSelectHeader.draw(deltaTime);
|
||||
Footer.draw(deltaTime);
|
||||
end
|
||||
|
||||
if (isFilterWheelActive ~= previousActiveState) then
|
||||
game.PlaySample('filter_wheel/open_close.wav');
|
||||
|
@ -365,6 +376,29 @@ render = function(deltatime, shown)
|
|||
-- transitionLeaveScale .. ' // L_TRT: ' .. transitionLeaveReappearTimer, 8, 1870);
|
||||
end
|
||||
|
||||
render = function(deltaTime, shown)
|
||||
isFilterWheelActive = shown;
|
||||
|
||||
if not shown then
|
||||
game.SetSkinSetting('_songWheelOverlayActive', 0);
|
||||
else
|
||||
game.SetSkinSetting('_songWheelOverlayActive', 1);
|
||||
end
|
||||
|
||||
game.SetSkinSetting('_songWheelActiveFolderLabel', getFolderData(filters.folder[selectedFolder]).label);
|
||||
game.SetSkinSetting('_songWheelActiveSubFolderLabel', getFolderData(filters.level[selectedLevel]).label);
|
||||
|
||||
-- detect resolution change
|
||||
local resx, resy = game.GetResolution();
|
||||
if resx ~= resX or resy ~= resY then
|
||||
resolutionChange(resx, resy)
|
||||
end
|
||||
|
||||
gfx.GlobalAlpha(1)
|
||||
|
||||
drawFilterWheel((resX - fullX) / 2, 0, fullX, fullY, deltaTime);
|
||||
end
|
||||
|
||||
set_selection = function(newIndex, isFolder)
|
||||
local oldIndex = 1;
|
||||
local total = 1;
|
||||
|
|
|
@ -5,6 +5,8 @@ local common = require('common.common')
|
|||
|
||||
local VolforceCalc = require('components.volforceCalc');
|
||||
|
||||
local backgroundImage = gfx.CreateSkinImage("bg_pattern.png", gfx.IMAGE_REPEATX | gfx.IMAGE_REPEATY)
|
||||
|
||||
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 gradeBgImage = gfx.CreateSkinImage("song_select/data_panel/grade_bg.png", 1)
|
||||
|
@ -143,11 +145,26 @@ local transitionLeaveScale = 0;
|
|||
local transitionLeaveReappearTimer = 0;
|
||||
local TRANSITION_LEAVE_DURATION = 0.1;
|
||||
|
||||
function resetLayoutInformation()
|
||||
resx, resy = game.GetResolution()
|
||||
desw = 1080
|
||||
desh = 1920
|
||||
scale = resx / desw
|
||||
-- Window variables
|
||||
local resX, resY
|
||||
|
||||
-- Aspect Ratios
|
||||
local landscapeWidescreenRatio = 16 / 9
|
||||
local landscapeStandardRatio = 4 / 3
|
||||
local portraitWidescreenRatio = 9 / 16
|
||||
|
||||
-- Portrait sizes
|
||||
local fullX, fullY
|
||||
local desw = 1080
|
||||
local desh = 1920
|
||||
|
||||
local resolutionChange = function(x, y)
|
||||
resX = x
|
||||
resY = y
|
||||
fullX = portraitWidescreenRatio * y
|
||||
fullY = y
|
||||
|
||||
game.Log('resX:' .. resX .. ' // resY:' .. resY .. ' // fullX:' .. fullX .. ' // fullY:' .. fullY, game.LOGGER_ERROR);
|
||||
end
|
||||
|
||||
function load_number_image(path)
|
||||
|
@ -230,13 +247,14 @@ function getGradeImageForScore(score)
|
|||
end
|
||||
|
||||
function drawLaserAnim()
|
||||
gfx.Save();
|
||||
gfx.BeginPath()
|
||||
|
||||
|
||||
gfx.Scissor(0, transitionLaserY, desw, 100);
|
||||
|
||||
|
||||
gfx.ImageRect(0, 0, desw, desh, laserAnimBaseImage, 1, 0)
|
||||
|
||||
gfx.ResetScissor();
|
||||
|
||||
gfx.Restore();
|
||||
end
|
||||
|
||||
function drawBackground(deltaTime)
|
||||
|
@ -744,17 +762,12 @@ function tickTransitions(deltaTime)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
render = function (deltaTime)
|
||||
resetLayoutInformation();
|
||||
tickTransitions(deltaTime);
|
||||
gfx.Scale(scale, scale);
|
||||
|
||||
common.stopMusic();
|
||||
|
||||
if not difficultyNumbers then
|
||||
difficultyNumbers = load_number_image('diff_num')
|
||||
end
|
||||
draw_songwheel = function(x,y,w,h, deltaTime)
|
||||
|
||||
gfx.Translate(x,y);
|
||||
gfx.Scale(w/1080, h/1920);
|
||||
gfx.Scissor(0,0,1080,1920);
|
||||
|
||||
|
||||
drawBackground(deltaTime);
|
||||
|
||||
|
@ -775,6 +788,34 @@ render = function (deltaTime)
|
|||
local debugScrollingUp= "FALSE"
|
||||
if scrollingUp then debugScrollingUp = "TRUE" end;
|
||||
-- gfx.Text('S_I: ' .. selectedIndex .. ' // S_D: ' .. selectedDifficulty .. ' // S_UP: ' .. debugScrollingUp .. ' // AC_TS: ' .. transitionAfterscrollScale .. ' // L_TS: ' .. transitionLeaveScale, 8, 8);
|
||||
|
||||
gfx.ResetTransform();
|
||||
end
|
||||
|
||||
render = function (deltaTime)
|
||||
tickTransitions(deltaTime);
|
||||
|
||||
game.SetSkinSetting('_currentScreen', 'songwheel')
|
||||
|
||||
common.stopMusic();
|
||||
|
||||
if not difficultyNumbers then
|
||||
difficultyNumbers = load_number_image('diff_num')
|
||||
end
|
||||
|
||||
-- detect resolution change
|
||||
local resx, resy = game.GetResolution();
|
||||
if resx ~= resX or resy ~= resY then
|
||||
resolutionChange(resx, resy)
|
||||
end
|
||||
|
||||
gfx.BeginPath()
|
||||
bgImageWidth, bgImageHeight = gfx.ImageSize(backgroundImage)
|
||||
gfx.Rect(0, 0, resX, resY)
|
||||
gfx.FillPaint(gfx.ImagePattern(0, 0, bgImageWidth, bgImageHeight, 0, backgroundImage, 0.2))
|
||||
gfx.Fill()
|
||||
|
||||
draw_songwheel((resX - fullX) / 2, 0, fullX, fullY, deltaTime);
|
||||
end
|
||||
|
||||
songs_changed = function (withAll)
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
require('common')
|
||||
local Easing = require('common.easings');
|
||||
|
||||
local resx, resy = game.GetResolution()
|
||||
local desw, desh = 1080, 1920
|
||||
|
||||
-- AUDIO
|
||||
game.LoadSkinSample('sort_wheel/enter.wav');
|
||||
game.LoadSkinSample('sort_wheel/leave.wav');
|
||||
|
@ -12,10 +15,6 @@ local activeItemBgImage = gfx.CreateSkinImage(
|
|||
local titleTextImage =
|
||||
gfx.CreateSkinImage('song_select/sort_wheel/title.png', 0)
|
||||
|
||||
local resx, resy = game.GetResolution()
|
||||
local desw, desh = 1080, 1920;
|
||||
local scale = 1;
|
||||
|
||||
local selection = 1;
|
||||
local renderedButtonLabels = {}
|
||||
|
||||
|
@ -48,9 +47,24 @@ local transitionEnterOffsetX = 0;
|
|||
|
||||
local previousActiveState = false;
|
||||
|
||||
function resetLayoutInformation()
|
||||
resx, resy = game.GetResolution()
|
||||
scale = resx / desw
|
||||
-- Window variables
|
||||
local resX, resY
|
||||
|
||||
-- Aspect Ratios
|
||||
local landscapeWidescreenRatio = 16 / 9
|
||||
local landscapeStandardRatio = 4 / 3
|
||||
local portraitWidescreenRatio = 9 / 16 --+ 0.0035
|
||||
|
||||
-- Portrait sizes
|
||||
local fullX, fullY
|
||||
|
||||
local resolutionChange = function(x, y)
|
||||
resX = x
|
||||
resY = y
|
||||
fullX = portraitWidescreenRatio * y
|
||||
fullY = y
|
||||
|
||||
game.Log('resX:' .. resX .. ' // resY:' .. resY .. ' // fullX:' .. fullX .. ' // fullY:' .. fullY, game.LOGGER_ERROR);
|
||||
end
|
||||
|
||||
function tableContains(table, value)
|
||||
|
@ -136,11 +150,16 @@ function tickTransitions(deltaTime)
|
|||
transitionEnterOffsetX = Easing.inOutQuad(1 - transitionEnterScale) * 416
|
||||
end
|
||||
|
||||
function drawSortWheel(deltaTime)
|
||||
local drawSortWheel = function (x,y,w,h, deltaTime)
|
||||
gfx.Scissor(x,y,w,h);
|
||||
gfx.Translate(x,y);
|
||||
gfx.Scale(w/1080, h/1920);
|
||||
gfx.Scissor(0,0,1080,1920);
|
||||
|
||||
-- Draw the dark overlay above song wheel
|
||||
gfx.BeginPath();
|
||||
gfx.FillColor(0, 0, 0, math.floor(transitionEnterScale * 192));
|
||||
gfx.Rect(0, 0, desw, desh);
|
||||
gfx.Rect(0, 0, 1080, 1920);
|
||||
gfx.Fill();
|
||||
|
||||
-- Draw the panel background
|
||||
|
@ -188,8 +207,7 @@ function render(deltaTime, shown)
|
|||
gfx.Save()
|
||||
gfx.ResetTransform()
|
||||
renderedButtonLabels = {};
|
||||
resetLayoutInformation()
|
||||
gfx.Scale(scale, scale)
|
||||
|
||||
|
||||
if (shown ~= previousActiveState) then
|
||||
if (shown) then
|
||||
|
@ -201,12 +219,20 @@ function render(deltaTime, shown)
|
|||
previousActiveState = shown;
|
||||
end
|
||||
|
||||
-- detect resolution change
|
||||
local resx, resy = game.GetResolution();
|
||||
if resx ~= resX or resy ~= resY then
|
||||
resolutionChange(resx, resy)
|
||||
end
|
||||
|
||||
gfx.GlobalAlpha(1)
|
||||
|
||||
if not shown then
|
||||
transitionEnterReverse = true
|
||||
if (transitionEnterScale > 0) then drawSortWheel(deltaTime) end
|
||||
if (transitionEnterScale > 0) then drawSortWheel((resX - fullX) / 2, 0, fullX, fullY, deltaTime) end
|
||||
else
|
||||
transitionEnterReverse = false
|
||||
drawSortWheel(deltaTime)
|
||||
drawSortWheel((resX - fullX) / 2, 0, fullX, fullY, deltaTime)
|
||||
end
|
||||
tickTransitions(deltaTime)
|
||||
setSkinSetting();
|
||||
|
|
|
@ -19,7 +19,7 @@ local desw = 1080
|
|||
local desh = 1920
|
||||
local scale;
|
||||
|
||||
local bgImage = gfx.CreateSkinImage('titlescreen/bg.png', 0);
|
||||
local backgroundImage = gfx.CreateSkinImage("bg_pattern.png", gfx.IMAGE_REPEATX | gfx.IMAGE_REPEATY)
|
||||
local headerTitleImage = gfx.CreateSkinImage('titlescreen/title.png', 0);
|
||||
local selectorBgImage = gfx.CreateSkinImage('titlescreen/selector_bg.png', 0);
|
||||
local selectorArrowsImage = gfx.CreateSkinImage(
|
||||
|
@ -66,6 +66,24 @@ local oldCursorIndex = 3;
|
|||
local scrollingUp = false;
|
||||
local playedBgm = false;
|
||||
|
||||
-- Window variables
|
||||
local resX, resY
|
||||
|
||||
-- Aspect Ratios
|
||||
local landscapeWidescreenRatio = 16 / 9
|
||||
local landscapeStandardRatio = 4 / 3
|
||||
local portraitWidescreenRatio = 9 / 16
|
||||
|
||||
-- Portrait sizes
|
||||
local fullX, fullY
|
||||
|
||||
local resolutionChange = function(x, y)
|
||||
resX = x
|
||||
resY = y
|
||||
fullX = portraitWidescreenRatio * y
|
||||
fullY = y
|
||||
end
|
||||
|
||||
function resetLayoutInformation()
|
||||
resx, resy = game.GetResolution()
|
||||
desw = 1080
|
||||
|
@ -327,14 +345,11 @@ function handle_controller()
|
|||
end
|
||||
end
|
||||
|
||||
render = function(deltaTime)
|
||||
if not playedBgm then
|
||||
game.PlaySample('titlescreen/bgm.wav', true);
|
||||
playedBgm = true;
|
||||
end
|
||||
draw_titlescreen = function (x, y, w, h, deltaTime)
|
||||
gfx.Scissor(x,y,w,h);
|
||||
gfx.Translate(x,y);
|
||||
gfx.Scale(w/1080, h/1920);
|
||||
|
||||
resetLayoutInformation();
|
||||
gfx.Scale(scale, scale);
|
||||
gfx.LoadSkinFont("segoeui.ttf")
|
||||
|
||||
-- Draw background
|
||||
|
@ -376,6 +391,31 @@ render = function(deltaTime)
|
|||
drawHeader();
|
||||
Footer.draw(deltaTime);
|
||||
|
||||
gfx.ResetTransform();
|
||||
end
|
||||
|
||||
render = function(deltaTime)
|
||||
if not playedBgm then
|
||||
game.PlaySample('titlescreen/bgm.wav', true);
|
||||
playedBgm = true;
|
||||
end
|
||||
|
||||
game.SetSkinSetting('_currentScreen', 'title')
|
||||
|
||||
-- detect resolution change
|
||||
local resx, resy = game.GetResolution();
|
||||
if resx ~= resX or resy ~= resY then
|
||||
resolutionChange(resx, resy)
|
||||
end
|
||||
|
||||
gfx.BeginPath()
|
||||
bgImageWidth, bgImageHeight = gfx.ImageSize(backgroundImage)
|
||||
gfx.Rect(0, 0, resX, resY)
|
||||
gfx.FillPaint(gfx.ImagePattern(0, 0, bgImageWidth, bgImageHeight, 0, backgroundImage, 0.2))
|
||||
gfx.Fill()
|
||||
|
||||
draw_titlescreen((resX - fullX) / 2, 0, fullX, fullY, deltaTime);
|
||||
|
||||
handle_controller()
|
||||
|
||||
scrollTransitionScale = scrollTransitionScale + 1 / 60 * 5;
|
||||
|
|
Loading…
Reference in New Issue