scenes/mainmenu: make object menu take screen size from screen object

This commit is contained in:
Kazhnuz 2019-03-05 19:30:08 +01:00
parent 8c48370a48
commit 0fc2f85ef0
1 changed files with 4 additions and 3 deletions

View File

@ -4,11 +4,12 @@ local MenuObject = ListBox:extend()
local Widgets = require "scenes.debugmenu.widgets"
function MenuObject:new(scene, name)
local screenwidth, screenheight = core.screen:getDimensions()
local height, width, x, y
height = 240 - 88 - 24
height = screenheight - (88 + 24)
width = 240
x = 424/2 - width/2
y = 240/2 - height/2 - 8
x = screenwidth/2 - width/2
y = screenheight/2 - height/2 - 8
MenuObject.super.new(self, scene.menusystem, name, x, y, width, height, 5)
self.scene = scene