AHSS Posted October 7, 2011 Posted October 7, 2011 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.
AHSS Posted October 7, 2011 Author Posted October 7, 2011 What? I don't understand. Simply, Is there a way to fit a gui ( not just in the middle of the screen ) on all resolutions?
BriGhtx3 Posted October 7, 2011 Posted October 7, 2011 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
karlis Posted October 7, 2011 Posted October 7, 2011 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)
karlis Posted October 7, 2011 Posted October 7, 2011 oh sorry, then even simplier:use relative positions
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now