megaman54 Posted September 12, 2011 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?
BinSlayer1 Posted September 12, 2011 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
bandi94 Posted September 12, 2011 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 +/-
JR10 Posted September 12, 2011 Posted September 12, 2011 Axel, it's guiGetScreenSize, and it returns 2 values, screenX , screenY.
AGENT_STEELMEAT Posted September 12, 2011 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.
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