Jump to content

[HELP] getScreenSize, easy way to use it


..:D&G:..

Recommended Posts

guiGetScreenSize() gives you the size of your screens resolution. So if for example it was 1024x768, You'd know that 500 lengthways is about center. Same goes for widthways, ~370 would be close to center there. I usually use that when I'm trying to estimate where to place an image on screen.

I highly recommend NOT using single values like that though (such as 500 or 370) as what is in the center on one resolution will not be on another. Instead I'd do something like this:

local x, y = guiGetScreenSize() 
local middleX, middleY = x/2, y/2 

That way it will scale to all resolutions. This is just an example of centering images, but you get the idea :)

Link to comment
  • 2 weeks later...

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...