Jump to content

Centering a window.


Recommended Posts

So, with guieditor I made my gui, but when I switched resolution, it 'moved'.

So, I tried this:

  
local sx, sy = guiGetScreenSize() 
panel = guiCreateWindow((1113/1360)*sx,(643/768)*sy,914,536,"Extreme Gamers Admin Panel",false) 

But it doesn't work.

Also I tried this:

  
local sx, sy = guiGetScreenSize() 
panel = guiCreateWindow(247/2-sx,125/2-sy,914,536,"Extreme Gamers Admin Panel",false) 

But doesn't wok either, any ideas?

Thanks

Link to comment
So, with guieditor I made my gui, but when I switched resolution, it 'moved'.

So, I tried this:

  
local sx, sy = guiGetScreenSize() 
panel = guiCreateWindow((1113/1360)*sx,(643/768)*sy,914,536,"Extreme Gamers Admin Panel",false) 

But it doesn't work.

Also I tried this:

  
local sx, sy = guiGetScreenSize() 
panel = guiCreateWindow(247/2-sx,125/2-sy,914,536,"Extreme Gamers Admin Panel",false) 

But doesn't wok either, any ideas?

Thanks

Set the window in the center of the screen:

  
local sx, sy = guiGetScreenSize() 
panel = guiCreateWindow(sx/2-457, sy/2-268, 914, 536, "Extreme Gamers Admin Panel", false) 

Note:

screenWidth/2-windowWidth/2, screenHeight/2-windowHeight/2

Link to comment
So, with guieditor I made my gui, but when I switched resolution, it 'moved'.

So, I tried this:

  
local sx, sy = guiGetScreenSize() 
panel = guiCreateWindow((1113/1360)*sx,(643/768)*sy,914,536,"Extreme Gamers Admin Panel",false) 

But it doesn't work.

Also I tried this:

  
local sx, sy = guiGetScreenSize() 
panel = guiCreateWindow(247/2-sx,125/2-sy,914,536,"Extreme Gamers Admin Panel",false) 

But doesn't wok either, any ideas?

Thanks

Set the window in the center of the screen:

  
local sx, sy = guiGetScreenSize() 
panel = guiCreateWindow(sx/2-457, sy/2-268, 914, 536, "Extreme Gamers Admin Panel", false) 

Note:

screenWidth/2-windowWidth/2, screenHeight/2-windowHeight/2

Thank you!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...