Merge branch 'master' of https://github.com/FajsiEx/exceed
|
@ -741,15 +741,17 @@ function draw_gauge(deltaTime)
|
||||||
|
|
||||||
local BgW, BgH = gfx.ImageSize(gaugeBgImage);
|
local BgW, BgH = gfx.ImageSize(gaugeBgImage);
|
||||||
local FillW, FillH = gfx.ImageSize(gaugeFillImage);
|
local FillW, FillH = gfx.ImageSize(gaugeFillImage);
|
||||||
local gaugePosX = 1080 - BgW - 48;
|
local gaugePosX = 1080 - BgW - 110;
|
||||||
local gaugePosY = 1920/2 - BgH/2 - 32;
|
local gaugePosY = 1920/2 - BgH/2 - 95;
|
||||||
|
|
||||||
-- gfx.Text('RESX: ' .. resx .. ' // RESY: ' .. resy .. ' // GPX: ' .. gaugePosX, 255,1200);
|
-- gfx.Text('RESX: ' .. resx .. ' // RESY: ' .. resy .. ' // GPX: ' .. gaugePosX, 255,1200);
|
||||||
|
|
||||||
|
gfx.BeginPath()
|
||||||
gfx.ImageRect(gaugePosX, gaugePosY, BgW, BgH, gaugeBgImage, 1, 0)
|
gfx.ImageRect(gaugePosX, gaugePosY, BgW, BgH, gaugeBgImage, 1, 0)
|
||||||
|
|
||||||
gfx.GlobalAlpha(gaugeFillAlpha);
|
gfx.GlobalAlpha(gaugeFillAlpha);
|
||||||
gfx.ImageRect(gaugePosX+22, gaugePosY+11+(FillH-(FillH*(gameplay.gauge.value))), FillW, FillH*(gameplay.gauge.value), gaugeFillImage, 1, 0)
|
gfx.BeginPath()
|
||||||
|
gfx.ImageRect(gaugePosX+18, gaugePosY+9+(FillH-(FillH*(gameplay.gauge.value))), FillW, FillH*(gameplay.gauge.value), gaugeFillImage, 1, 0)
|
||||||
gfx.GlobalAlpha(1);
|
gfx.GlobalAlpha(1);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
game.Log("Something went wrong!", game.LOGGER_ERROR)
|
-- game.Log("Something went wrong!", game.LOGGER_ERROR)
|
||||||
|
|
||||||
--Horizontal alignment
|
--Horizontal alignment
|
||||||
TEXT_ALIGN_LEFT = 1
|
TEXT_ALIGN_LEFT = 1
|
||||||
|
@ -391,7 +391,7 @@ function deep_to_string(t)
|
||||||
end
|
end
|
||||||
|
|
||||||
draw_song = function(song, x, y, w, h, selected)
|
draw_song = function(song, x, y, w, h, selected)
|
||||||
game.Log("draw_song", game.LOGGER_ERROR);
|
-- game.Log("draw_song", game.LOGGER_ERROR);
|
||||||
|
|
||||||
local diffIndex = math.min(selectedDiff, #song.difficulties)
|
local diffIndex = math.min(selectedDiff, #song.difficulties)
|
||||||
local difficulty = song.difficulties[diffIndex]
|
local difficulty = song.difficulties[diffIndex]
|
||||||
|
@ -401,7 +401,7 @@ draw_song = function(song, x, y, w, h, selected)
|
||||||
local clearLampA = 100
|
local clearLampA = 100
|
||||||
|
|
||||||
if difficulty ~= nil then
|
if difficulty ~= nil then
|
||||||
game.Log(deep_to_string(difficulty), game.LOGGER_ERROR);
|
-- game.Log(deep_to_string(difficulty), game.LOGGER_ERROR);
|
||||||
if difficulty.scores[1] ~= nil then
|
if difficulty.scores[1] ~= nil then
|
||||||
if difficulty.topBadge == 1 then -- fail/played
|
if difficulty.topBadge == 1 then -- fail/played
|
||||||
clearLampR = 255
|
clearLampR = 255
|
||||||
|
@ -435,7 +435,7 @@ draw_song = function(song, x, y, w, h, selected)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
game.Log(" past difficulty check", game.LOGGER_ERROR);
|
-- game.Log(" past difficulty check", game.LOGGER_ERROR);
|
||||||
|
|
||||||
check_or_create_cache(song)
|
check_or_create_cache(song)
|
||||||
gfx.BeginPath()
|
gfx.BeginPath()
|
||||||
|
@ -705,7 +705,7 @@ draw_songwheel = function(x,y,w,h)
|
||||||
for i = math.max(selectedIndex - wheelSize/2, 1), math.max(selectedIndex - 1,0) do
|
for i = math.max(selectedIndex - wheelSize/2, 1), math.max(selectedIndex - 1,0) do
|
||||||
local song = songwheel.songs[i]
|
local song = songwheel.songs[i]
|
||||||
local xpos = x + width
|
local xpos = x + width
|
||||||
local offsetY = (selectedIndex - i + ioffset/2) * ( height * 1.05)
|
local offsetY = (selectedIndex - i + ioffset/2) * ( height * 1.0)
|
||||||
local ypos = y+((h/2 - height/2) - offsetY)
|
local ypos = y+((h/2 - height/2) - offsetY)
|
||||||
draw_song(song, xpos, ypos, width, height)
|
draw_song(song, xpos, ypos, width, height)
|
||||||
end
|
end
|
||||||
|
@ -714,7 +714,7 @@ draw_songwheel = function(x,y,w,h)
|
||||||
for i = math.min(selectedIndex + wheelSize/2, #songwheel.songs), selectedIndex + 1,-1 do
|
for i = math.min(selectedIndex + wheelSize/2, #songwheel.songs), selectedIndex + 1,-1 do
|
||||||
local song = songwheel.songs[i]
|
local song = songwheel.songs[i]
|
||||||
local xpos = x + width
|
local xpos = x + width
|
||||||
local offsetY = (selectedIndex - i + ioffset/2) * ( height * 1.05)
|
local offsetY = (selectedIndex - i + ioffset/2) * ( height * 1.0)
|
||||||
local ypos = y+((h/2 - height/2) - (selectedIndex - i) - offsetY)
|
local ypos = y+((h/2 - height/2) - (selectedIndex - i) - offsetY)
|
||||||
local alpha = 255 - (selectedIndex - i + ioffset) * 31
|
local alpha = 255 - (selectedIndex - i + ioffset) * 31
|
||||||
draw_song(song, xpos, ypos, width, height)
|
draw_song(song, xpos, ypos, width, height)
|
||||||
|
@ -801,7 +801,7 @@ render = function(deltaTime)
|
||||||
timer = (timer + deltaTime)
|
timer = (timer + deltaTime)
|
||||||
timer = timer % 2
|
timer = timer % 2
|
||||||
resx,resy = game.GetResolution();
|
resx,resy = game.GetResolution();
|
||||||
game.Log("res :: " .. resx .. "," .. resy, game.LOGGER_ERROR);
|
-- game.Log("res :: " .. resx .. "," .. resy, game.LOGGER_ERROR);
|
||||||
adjustScreen(resx,resy);
|
adjustScreen(resx,resy);
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
gfx.LoadSkinFont("dfmarugoth.ttf");
|
gfx.LoadSkinFont("dfmarugoth.ttf");
|
||||||
|
|
|
@ -3,6 +3,9 @@ game.LoadSkinSample('song_transition_screen/transition_enter.wav');
|
||||||
|
|
||||||
local bgImage = gfx.CreateSkinImage("songtransition/bg.png", 0)
|
local bgImage = gfx.CreateSkinImage("songtransition/bg.png", 0)
|
||||||
|
|
||||||
|
|
||||||
|
local difficultyNumbers;
|
||||||
|
|
||||||
local difficultyLabelImages = {
|
local difficultyLabelImages = {
|
||||||
gfx.CreateSkinImage("songtransition/difficulty_labels/nov.png", 0),
|
gfx.CreateSkinImage("songtransition/difficulty_labels/nov.png", 0),
|
||||||
gfx.CreateSkinImage("songtransition/difficulty_labels/adv.png", 0),
|
gfx.CreateSkinImage("songtransition/difficulty_labels/adv.png", 0),
|
||||||
|
@ -33,11 +36,43 @@ function resetLayoutInformation()
|
||||||
scale = resx / desw
|
scale = resx / desw
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function load_number_image(path)
|
||||||
|
local images = {}
|
||||||
|
for i = 0, 9 do
|
||||||
|
images[i + 1] = gfx.CreateSkinImage(string.format("%s/%d.png", path, i), 0)
|
||||||
|
end
|
||||||
|
return images
|
||||||
|
end
|
||||||
|
|
||||||
|
function draw_number(x, y, alpha, num, digits, images, is_dim, scale, kern)
|
||||||
|
scale = scale or 1;
|
||||||
|
kern = kern or 1;
|
||||||
|
local tw, th = gfx.ImageSize(images[1])
|
||||||
|
tw = tw * scale;
|
||||||
|
th = th * scale;
|
||||||
|
x = x + (tw * (digits - 1)) / 2
|
||||||
|
y = y - th / 2
|
||||||
|
for i = 1, digits do
|
||||||
|
local mul = 10 ^ (i - 1)
|
||||||
|
local digit = math.floor(num / mul) % 10
|
||||||
|
local a = alpha
|
||||||
|
if is_dim and num < mul then
|
||||||
|
a = 0.4
|
||||||
|
end
|
||||||
|
gfx.BeginPath()
|
||||||
|
gfx.ImageRect(x, y, tw, th, images[digit + 1], a, 0)
|
||||||
|
x = x - (tw * kern)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function render(deltaTime)
|
function render(deltaTime)
|
||||||
if not wasEnterSfxPlayed then
|
if not wasEnterSfxPlayed then
|
||||||
game.PlaySample('song_transition_screen/transition_enter.wav');
|
game.PlaySample('song_transition_screen/transition_enter.wav');
|
||||||
wasEnterSfxPlayed = true;
|
wasEnterSfxPlayed = true;
|
||||||
end
|
end
|
||||||
|
if not difficultyNumbers then
|
||||||
|
difficultyNumbers = load_number_image('diff_num')
|
||||||
|
end
|
||||||
|
|
||||||
resetLayoutInformation()
|
resetLayoutInformation()
|
||||||
gfx.ResetTransform();
|
gfx.ResetTransform();
|
||||||
|
@ -110,6 +145,11 @@ function render_screen(progress)
|
||||||
gfx.Text(song.effector, desw/2+70 , EFFECTOR_LABEL_Y-1)
|
gfx.Text(song.effector, desw/2+70 , EFFECTOR_LABEL_Y-1)
|
||||||
gfx.Text(song.illustrator, desw/2+70 , ILLUSTRATOR_LABEL_Y-3)
|
gfx.Text(song.illustrator, desw/2+70 , ILLUSTRATOR_LABEL_Y-3)
|
||||||
|
|
||||||
|
-- Draw song diff level
|
||||||
|
gfx.BeginPath();
|
||||||
|
draw_number(933, 1140, 1.0, song.level, 2, difficultyNumbers, false, 1, 1)
|
||||||
|
|
||||||
|
-- Draw song diff label (NOV/ADV/EXH/MXM/etc.)
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
local diffLabelImage = difficultyLabelImages[song.difficulty+1];
|
local diffLabelImage = difficultyLabelImages[song.difficulty+1];
|
||||||
local diffLabelW, diffLabelH = gfx.ImageSize(diffLabelImage);
|
local diffLabelW, diffLabelH = gfx.ImageSize(diffLabelImage);
|
||||||
|
|
|
@ -139,8 +139,8 @@ draw_buttons = function()
|
||||||
draw_button(buttons[indexes[3]], desw - 512, centerButtonY, false, 3); -- Placeholder for transition that goes to the top
|
draw_button(buttons[indexes[3]], desw - 512, centerButtonY, false, 3); -- Placeholder for transition that goes to the top
|
||||||
end
|
end
|
||||||
|
|
||||||
draw_button(buttons[indexes[4]], desw - 512, yBase + marginFromDesHCenter, false, 4);
|
draw_button(buttons[indexes[4]], desw - 512, yBase + marginFromDesHCenter + 10, false, 4);
|
||||||
draw_button(buttons[indexes[5]], desw - 512, yBase + marginFromDesHCenter + buttonHeight, false, 5);
|
draw_button(buttons[indexes[5]], desw - 512, yBase + marginFromDesHCenter + buttonHeight + 10, false, 5);
|
||||||
|
|
||||||
if not scrollingUp then
|
if not scrollingUp then
|
||||||
draw_button(buttons[indexes[1]], desw - 512, yBase + marginFromDesHCenter + buttonHeight*2, false, 6);
|
draw_button(buttons[indexes[1]], desw - 512, yBase + marginFromDesHCenter + buttonHeight*2, false, 6);
|
||||||
|
@ -283,7 +283,7 @@ render = function(deltaTime)
|
||||||
drawTexts();
|
drawTexts();
|
||||||
|
|
||||||
-- Draw the arrows around the selected button
|
-- Draw the arrows around the selected button
|
||||||
gfx.ImageRect(desw-512, desh/2 + SELECTOR_BAR_OFFSET_FROM_CENTER - buttonHeight, 501, 277, selectorArrowsImage, 1, 0);
|
gfx.ImageRect(desw-512, desh/2 + SELECTOR_BAR_OFFSET_FROM_CENTER - buttonHeight - 8, 501, 300, selectorArrowsImage, 1, 0);
|
||||||
|
|
||||||
-- Draw top and bottom bars
|
-- Draw top and bottom bars
|
||||||
--Bars.draw();
|
--Bars.draw();
|
||||||
|
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 11 KiB |