ExperimentalGear/scripts/gameplay/banner.lua

32 lines
619 B
Lua
Raw Normal View History

local bannerBaseImage = gfx.CreateSkinImage("gameplay/banner/base.png", 0)
local BANNER_W = 1080;
local BANNER_H = 368;
local render = function (deltaTime)
2021-11-25 18:49:50 +01:00
local resx, resy = game.GetResolution();
if (resx > resy) then
return
end
-- Get the banner downscaled in whatever resolution it is, while maintaining the aspect ratio
local tw,th = gfx.ImageSize(bannerBaseImage);
BANNER_H = th * (1080/tw);
gfx.BeginPath();
gfx.ImageRect(
0,
0,
BANNER_W,
BANNER_H,
bannerBaseImage,
1,
0
);
end
return {
render=render
}