Jump to content

Wanted to ask something about Picture GUI


proracer

Recommended Posts

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

I have made this.But it isn't showing the image. :cry:

  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

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 :D

Link to comment

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? :D

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

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

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