2021-05-05 08:30:32 +02:00
|
|
|
local ListBox = require "birb.modules.menusystem.listbox"
|
2021-05-05 11:41:25 +02:00
|
|
|
local TweenManager = require "birb.classes.time"
|
2020-08-19 20:44:08 +02:00
|
|
|
|
|
|
|
local RadianceMenu = ListBox:extend()
|
|
|
|
|
|
|
|
function RadianceMenu:new(scene, name, x, y, w, h, itemNumber)
|
|
|
|
self.scene = scene
|
|
|
|
self.tweens = TweenManager(self)
|
|
|
|
RadianceMenu.super.new(self, self.scene.menusystem, name, x, y, w, h, itemNumber)
|
|
|
|
end
|
|
|
|
|
|
|
|
function RadianceMenu:update(dt)
|
|
|
|
self.tweens:update(dt)
|
|
|
|
RadianceMenu.super.update(self, dt)
|
|
|
|
end
|
|
|
|
|
|
|
|
function RadianceMenu:moveFrom(x, y)
|
|
|
|
local newX, newY = self.x, self.y
|
|
|
|
self.x, self.y = x, y
|
|
|
|
|
|
|
|
self.tweens:addTween(0, 0.3, {x = newX, y = newY}, "inOutQuad")
|
|
|
|
end
|
|
|
|
|
|
|
|
function RadianceMenu:moveTo(newX, newY)
|
|
|
|
self.tweens:addTween(0, 0.3, {x = newX, y = newY}, "inOutQuad")
|
|
|
|
end
|
|
|
|
|
|
|
|
function RadianceMenu:getCenter()
|
|
|
|
return self.x + self.width, self.y + self.height
|
|
|
|
end
|
|
|
|
|
|
|
|
function RadianceMenu:activationAction()
|
|
|
|
-- Do nothing
|
|
|
|
end
|
|
|
|
|
|
|
|
return RadianceMenu
|