Jump to content

Problem with guiGetScreenSize


Sex*

Recommended Posts

So i made a script works good in 800x600 (im using this because i own shit pc), but then i got that finished i checked in other resoulutions. And in different places..what could i expect. So i used guiGetSreenSize but i was using the script normally with 800x600 so i divided the cordinates with them but it didnt work! It messed even more up.

This was before and working good on 800x600:

function renderPlayerLogin ( ) 
    dxDrawColorText("#ffffff".. messageLogin,525.0,300.0,y/550,40.0,tocolor(200,0,0,255),1.1,"default-bold","right","top",false,false,false) 
    dxDrawImage (500.0,300.0,y/40,17,"icon/login.png",0,-120) 
end 
  

And after modding it with GuiGetScreenSize and dividing numbers with 800x600:

function renderPlayerLogin ( ) 
    dxDrawColorText("#ffffff".. messageLogin,y*0.656,x*0.5,y*0.687,x*15.0,tocolor(200,0,0,255),1.1,"default-bold","right","top",false,false,false) 
    dxDrawImage (500.0,300.0,y/40,17,"icon/login.png",0,-120)--image not done yet 
end 
addEventHandler ( "onClientRender", getRootElement(), renderPlayerLogin ) 
  

ofc i added this on top of the file:

x,y = guiGetScreenSize() 

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