megaman54 Posted September 12, 2011 Share Posted September 12, 2011 Hi! I'm trying to get my server name under the minimap, like the MTA version number is in the lower right corner. But when i start the script, it goes to the right place on my screen but for some players it is above the minimap and for other it wont show at all. My code is just a simple guiCreateLabel but how to calculate the right position for every screen/resolution? Link to comment
BinSlayer1 Posted September 12, 2011 Share Posted September 12, 2011 to make GUI fit on all resolutions use the relative argument in the guiCreateLabel if you need further help, you'll have to post your script Link to comment
Axel Posted September 12, 2011 Share Posted September 12, 2011 u can use x,y,z = getScreenSize(thePlayer) Link to comment
bandi94 Posted September 12, 2011 Share Posted September 12, 2011 for guiCreateLabel use bool relative true and x,y 0-1 and then put in the right corner it will be +/- x =0 or 0.1 and y 0.8 or 0.9 test it that cordinates are +/- Link to comment
JR10 Posted September 12, 2011 Share Posted September 12, 2011 Axel, it's guiGetScreenSize, and it returns 2 values, screenX , screenY. Link to comment
AGENT_STEELMEAT Posted September 12, 2011 Share Posted September 12, 2011 local serverName = "SERVER_NAME_HERE" addEventHandler("onClientResourceStart", root, function() local _,y = guiGetScreenSize() local label = guiCreateLabel(0, 0, 0, 0, serverName, false) guiSetPosition(label, 5, y - ( guiLabelGetFontHeight(label) + 5), false) end) Untested. Link to comment
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