37 lines
909 B
Lua
37 lines
909 B
Lua
|
local ListBox = require "birb.modules.menusystem.listbox"
|
||
|
local TweenManager = require "birb.classes.time"
|
||
|
|
||
|
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
|