require "common.globals" require "common.class" local Display = require "scripts.graphics.display" local Image = require "scripts.graphics.image" local Page = require "api.page.page" ---@class USCPage : Page ---@field logo_img Image ---@field _timer number local USCPage = { __name = "USCPage", BACKGROUND_COLOR = {255, 255, 255}, LOGO_PATH = "titlescreen/splash/usc2.png", TIMEOUT = 3.0 } ---Create a new USCPage instance ---@param params? USCPage function USCPage.new(params) local self = CreateInstance(USCPage, params, Page) self.logo_img = Image.new(self.LOGO_PATH) self._timer = 0.0 return self end function USCPage:init() self._timer = 0.0 Page.init(self) end function USCPage:drawBackground(deltaTime) gfx.BeginPath() gfx.FillColor(table.unpack(self.BACKGROUND_COLOR)) gfx.Rect(0, 0, Display.design.width, Display.design.height) gfx.Fill() end function USCPage:drawContent(deltaTime) local x = (Display.design.width - self.logo_img.width) / 2 local y = (Display.design.height - self.logo_img.height) / 2 self.logo_img:setPosition(x, y) self.logo_img:render() end function USCPage:render(deltaTime) Page.render(self, deltaTime) if self._timer > self.TIMEOUT then self:onInvalidation() end self._timer = self._timer + deltaTime end return USCPage