proracer Posted January 14, 2011 Share Posted January 14, 2011 So I have created logo for our server.The code is this: function drawTripleXLogoImage() GUIEditor_Image = {} local sWidth, sHeight = guiGetScreenSize() GUIEditor_Image[1] = guiCreateStaticImage(sWidth-1334.976,sHeight-169.992,sWidth-1265.088,sHeight-910.008,"triplexlogo.png",false) guiSetAlpha(GUIEditor_Image[1],1) end addEventHandler("onClientResourceStart",getRootElement(), drawTripleXLogoImage) Some our players on server reported that they don't see the logo.I instantly thought I wrongly set up the script to work on all monitor resolutions but I don't understand... Where is the error? I see it normally because I use Res: 1920 * 1080 px. Link to comment
12p Posted January 14, 2011 Share Posted January 14, 2011 Check RELATIVE GUI. Use GUI Editor to toggle the mode to relative Link to comment
proracer Posted January 14, 2011 Author Share Posted January 14, 2011 Why should I use relatives? Why I can't use the absolute Pos? Link to comment
12p Posted January 14, 2011 Share Posted January 14, 2011 Because you see isn't working -.- Link to comment
proracer Posted January 14, 2011 Author Share Posted January 14, 2011 I have made this.But it isn't showing the image. function drawTripleXLogoImage() GUIEditor_Image = {} local sWidth, sHeight = guiGetScreenSize() GUIEditor_Image[1] = guiCreateStaticImage(sWidth-0.3375,sHeight-0.1898,sWidth-0.6661,sHeight-0.812,"triplexlogo.png",true) guiSetAlpha(GUIEditor_Image[1],1) end addEventHandler("onClientResourceStart",getRootElement(), drawTripleXLogoImage) Link to comment
12p Posted January 14, 2011 Share Posted January 14, 2011 omg I meant you used GUI Editor Resource, not only changing the relative function parameter -.- Link to comment
proracer Posted January 14, 2011 Author Share Posted January 14, 2011 What is wrong?... Because I'm not really good with GUI's. I looked last example on this site: https://wiki.multitheftauto.com/wiki/GuiGetScreenSize Link to comment
12p Posted January 14, 2011 Share Posted January 14, 2011 ok it's easy. Go to GUI Editor. Enable your window or whatever you want to make relative. Right mouse click on the mta "desktop", then select "Load GUI". Click on your window. Set all the variable names (you know, "mainWindow", "exitButton", etc...) When you ended, right click on mta desktop and select "Rel/Abs Screen", then do the same with "Rel/Abs Child". Then go to mta desktop with right click and select "Output Code". Go to [mta/server/mods/deathmatch/resources/guieditor] and open "GUIEditorOutput.txt". Then check the last part of the file and copy all the lines that are about the GUI into your GUI Script. ENJOY Link to comment
proracer Posted January 14, 2011 Author Share Posted January 14, 2011 No, I have already know how to set Relative Pos from Absolute... But I want that everyone can see the logo with every monitor resolution.So when I saw last example at site I posted in my previous post I created that.But it doesn't work. Btw I don't understand your post.It's all in my first post. LoL? I just did for example: sWidth - 0.3375 for turning the GUI to be set in same position as in all resolution monitors. Please check site on my previous post and look at last example. Btw, Code in my first post works and in second doesnt. Link to comment
12p Posted January 14, 2011 Share Posted January 14, 2011 function drawTripleXLogoImage() GUIEditor_Image = {} local sWidth, sHeight = guiGetScreenSize() GUIEditor_Image[1] = guiCreateStaticImage(sWidth-(1334.976*sWidth),sHeight-(169.992*sHeight),sWidth-(1265.088*sWidth),sHeight-(910.008*sHeight),"triplexlogo.png",false) guiSetAlpha(GUIEditor_Image[1],1) end addEventHandler("onClientResourceStart",getRootElement(), drawTripleXLogoImage) Next time, just use Relative -.- Link to comment
proracer Posted January 14, 2011 Author Share Posted January 14, 2011 I tested it but it doesn't work. I mean it doesn't show the picture... Link to comment
SDK Posted January 14, 2011 Share Posted January 14, 2011 Try this function drawTripleXLogoImage() GUIEditor_Image = {} local sWidth, sHeight =1920, 1080 GUIEditor_Image[1] = guiCreateStaticImage( (sWidth-1334.976)/sWidth, (sHeight-169.992)/sHeight, (sWidth-1265.088)/sWidth, (sHeight-910.008)/sHeight, "triplexlogo.png",true) guiSetAlpha(GUIEditor_Image[1],1) end addEventHandler("onClientResourceStart",getRootElement(), drawTripleXLogoImage) Link to comment
proracer Posted January 15, 2011 Author Share Posted January 15, 2011 Thanks man it finally works. 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