chore: port menu to rect

This commit is contained in:
Kazhnuz 2020-11-27 16:02:54 +01:00
parent e58f197049
commit 82cf59588a

View file

@ -21,7 +21,9 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]] ]]
local Menu = Object:extend() local Rect = require "birb.objects.2D.rect"
local Menu = Rect:extend()
local function updateWidgetByOrder(a, b) local function updateWidgetByOrder(a, b)
if a.order ~= b.order then if a.order ~= b.order then
@ -38,10 +40,7 @@ function Menu:new(menusystem, name, x, y, w, h)
self.menusystem = menusystem self.menusystem = menusystem
self.name = name self.name = name
self.x = x Menu.super.new(self, x, y, w, h)
self.y = y
self.w = w
self.h = h
self.widget = {} self.widget = {}
self.widget.list = {} self.widget.list = {}
@ -137,10 +136,7 @@ function Menu:clear()
end end
function Menu:resize(x,y,w,h) function Menu:resize(x,y,w,h)
self.x = x self:set(x,y,w,h)
self.y = y
self.w = w
self.h = h
self:updateWidgetSize() self:updateWidgetSize()
end end