scenes/mainmenu: make object menu take screen size from screen object
This commit is contained in:
parent
8c48370a48
commit
0fc2f85ef0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue