ExperimentalGear/scripts/result.lua

33 lines
765 B
Lua
Raw Normal View History

2021-07-25 20:10:06 +02:00
local resx,resy = game.GetResolution()
2021-07-27 20:00:02 +02:00
local desw = 1080
local desh = 1920
2021-07-25 20:10:06 +02:00
2021-07-27 20:00:02 +02:00
local bgSfxPlayed = false;
2021-07-25 20:10:06 +02:00
2021-07-27 20:00:02 +02:00
local backgroundImage = gfx.CreateSkinImage("bg.png", 1);
game.LoadSkinSample("result")
2021-07-25 20:10:06 +02:00
2021-07-27 20:00:02 +02:00
function resetLayoutInformation()
resx, resy = game.GetResolution()
desw = 1080
desh = 1920
scale = resx / desw
2021-07-25 20:10:06 +02:00
end
render = function(deltaTime, showStats)
2021-07-27 20:00:02 +02:00
resetLayoutInformation()
gfx.ImageRect(0, 0, desw, desh, backgroundImage, 0.5, 0);
2021-07-25 20:10:06 +02:00
gfx.Scale(scale,scale)
2021-07-27 20:00:02 +02:00
if not bgSfxPlayed then
2021-07-25 20:10:06 +02:00
game.PlaySample("result", true)
2021-07-27 20:00:02 +02:00
bgSfxPlayed = true
2021-07-25 20:10:06 +02:00
end
if game.GetButton(game.BUTTON_STA) then
game.StopSample("result")
end
if game.GetButton(game.BUTTON_BCK) then
game.StopSample("result")
end
end