Jump to content

[HELP] getScreenSize, easy way to use it


..:D&G:..

Recommended Posts

Posted

Hello, I want to know whats the easiest way to use the getScreenSize on a dxDrawn image. I know many people use it, and I don't think they spend like 2 days on finding the position on a small image :P

Posted

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 :)

  • 2 weeks later...
Posted

Thanks for the tip. Isn´t there a method where you can do it easier? It takes way tooo much to calibrate even 1 small button, and I hardly find the right position.

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