display window on screen center

This commit is contained in:
Eduardo Bart
2012-01-02 23:32:34 -02:00
parent 05230f44e4
commit 7172d2251a
7 changed files with 17 additions and 17 deletions

View File

@@ -8,8 +8,14 @@ function Client.init()
if g_window.getPlatformType() == "X11-EGL" then
g_window.setFullscreen(true)
else
g_window.move({ x=220, y=220 })
g_window.resize({ width=800, height=480 })
local size = { width = 1024,
height = 768 }
g_window.resize(size)
local displaySize = g_window.getDisplaySize()
local pos = { x = (displaySize.width - size.width)/2,
y = (displaySize.height - size.height)/2 }
g_window.move(pos)
end
g_window.setTitle('OTClient')