diff --git a/scripts/titlescreen.lua b/scripts/titlescreen.lua index a98771d..88c3be4 100644 --- a/scripts/titlescreen.lua +++ b/scripts/titlescreen.lua @@ -64,8 +64,10 @@ draw_button = function(button, x, y, selected, index) if (selected) then -- Draw button background + gfx.BeginPath(); gfx.ImageRect(x, y+(196/2 * (1-scrollTransitionScale)), 505, 196*scrollTransitionScale, selectedButtonBgImage, 1, 0); -- Draw button main label + gfx.BeginPath(); gfx.ImageRect(x + 256 - (labelWidth/2), (y+58)+(64/2 * (1-scrollTransitionScale)), labelWidth, 64*scrollTransitionScale, labelImage, 1, 0); -- Draw description @@ -73,10 +75,12 @@ draw_button = function(button, x, y, selected, index) gfx.GlobalAlpha((scrollTransitionScale - 0.8) * 5) gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_MIDDLE) gfx.FontSize(40); + gfx.BeginPath(); gfx.Text(descriptionText, x+256, y+28); gfx.GlobalAlpha(1) -- Draw the glow overlay + gfx.BeginPath(); gfx.ImageRect(x+2, (y-42)+(277/2 * (1-scrollTransitionScale)), 501, 277*scrollTransitionScale, selectedButtonOverImage, 1, 0); else if scrollingUp then @@ -95,13 +99,16 @@ draw_button = function(button, x, y, selected, index) end end -- Draw button background + gfx.BeginPath(); gfx.ImageRect(x, y + buttonsMovementScale*buttonHeight, 1026 / 2, 257 / 2, unselectedButtonImage, 1, 0); -- Draw button main label + gfx.BeginPath(); gfx.ImageRect(x+64, y+28 + buttonsMovementScale*buttonHeight, labelWidth, 64, labelImage, 1, 0); -- Draw description gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE) gfx.FontSize(28); + gfx.BeginPath(); gfx.Text(descriptionText, x+64, y+18 + buttonsMovementScale*buttonHeight); gfx.GlobalAlpha(1) @@ -167,8 +174,10 @@ end; function drawTexts() currentFullDescriptionText = buttons[cursorIndex][5]; + gfx.BeginPath(); gfx.UpdateLabel(selectorDescriptionLabel, currentFullDescriptionText, 22) + gfx.BeginPath(); gfx.UpdateLabel(selectorLegendScrollLabel, 'DEBUG: ' .. buttonsMovementScale, 20); -- descriptionAlpha = math.abs(selectedButtonScaleY - 0.5) * 2; @@ -176,13 +185,19 @@ function drawTexts() -- Description gfx.FillColor(255,255,255,math.floor(scrollTransitionScale*255)); + gfx.BeginPath(); gfx.DrawLabel(selectorDescriptionLabel, 64, desh/2 + SELECTOR_BAR_OFFSET_FROM_CENTER - 52); -- Legend on the selector gfx.FillColor(217,177,126); + + gfx.BeginPath(); gfx.DrawLabel(selectorLegendScrollLabel, 118, desh/2 + SELECTOR_BAR_OFFSET_FROM_CENTER + 56); + + gfx.BeginPath(); gfx.DrawLabel(selectorLegendSelectLabel, 360, desh/2 + SELECTOR_BAR_OFFSET_FROM_CENTER + 56); + gfx.FillColor(255,255,255); end; @@ -257,6 +272,7 @@ render = function(deltaTime) gfx.Scale(scale, scale); -- Draw background + gfx.BeginPath(); gfx.ImageRect(0, 0, desw, desh, bgImage, 1, 0); local idolAnimTickRes = gfx.TickAnimation(idolAnimation, deltaTime); @@ -268,11 +284,13 @@ render = function(deltaTime) idolAnimTransitionScale = 1; end + gfx.BeginPath(); gfx.ImageRect(0, 0, desw, desh, idolAnimation, 1, 0); gfx.GlobalAlpha(1); end -- Draw selector background + gfx.BeginPath(); gfx.ImageRect(0, (desh/2 + SELECTOR_BAR_OFFSET_FROM_CENTER) - 280/2, 1079, 280, selectorBgImage, 1, 0); setButtons() @@ -283,6 +301,7 @@ render = function(deltaTime) drawTexts(); -- Draw the arrows around the selected button + gfx.BeginPath(); gfx.ImageRect(desw-512, desh/2 + SELECTOR_BAR_OFFSET_FROM_CENTER - buttonHeight - 8, 501, 300, selectorArrowsImage, 1, 0); -- Draw top and bottom bars