Jump to content

Resoultion...


AHSS

Recommended Posts

I made a gui-label.

No parent, with relative values.

It fits perfect on my screen 1440x900.

I made it on that resolution.

Now someone with resolution 800x600

Will not see it the same.

I know guiGetScreenSize.

I know screenX / 2 - windowX / 2

But I don't want it in the middle, I want it somewhere else, on the screen, fits on all resolutions.

Link to comment

No i don't think so. But you can adjust it :

  
local screenwidth, screenheight = guiGetScreenSize () 
            if screenwidth == 1440 then 
                gImage["img"] = guiCreateStaticImage(screenwidth-130,120,5,18,"images/img.bmp",false) 
            else 
            gImage["img"] = guiCreateStaticImage(screenwidth-211,0+10,5,18,"images/img.bmp",false) 
            end 
  

Link to comment
  
sx,sy=guiGetScreenSize() 
relativeX,relativeY,relativeW,relativeH= 0.5,0.5,0.1,0.1--float between 0 and 1, where 0 is left/top, and 1is right/bottom.same applies to sizes(W,H). 
addEventHandler("onClientRender",getRootElement(),function() 
 dxDrawImage(relativeX*sx,relativeY*sy,relativeW*sx,relativeH*sy,"randompic.png") 
end) 
  

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