Jump to content

dxDrawImage after login


ManeXi

Recommended Posts

Basically i've got a script to show certain buttons after login, it works perfectly, but i wanted to add a dxImage and i didn't got succesful, this is everything i use to do this actions: login>show buttons

This is to show the dxImage.

local screenW, screenH = guiGetScreenSize() 
  
addEventHandler("onClientRender", root, 
    function() 
        dxDrawImage(0, 0, screenW, screenH, ":tdm/pics/intro.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
    end 
) 

This is to hide login window and show the team selection buttons (guiSetVisible(TeamSlct_BTN[1],true))

function hideLoginWindow() --Show Team select panel after login 
    guiSetInputEnabled(false) 
    guiSetVisible(Login_TabPanel[1], false) 
    destroyElement(Login_TabPanel[1]) 
    Login_TabPanel[1] = nil 
    guiSetVisible(TeamSlct_BTN[1],true) 
    guiSetVisible(TeamSlct_BTN[2],true) 
    guiSetVisible(TeamSlct_BTN[3],true) 
  
    if blackLoginScreen == true then 
        fadeCamera(true,blackScreenTime) 
    end 
end 
addEvent("hideLoginWindow", true) 
addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) 

This are buttons script:

TeamSlct_BTN[3] = guiCreateButton(0, (screenH/2) - ((screenH/3)/2), screenW, screenH/3, "PLT", false) 
guiSetProperty(TeamSlct_BTN[3], "NormalTextColour", "FF0553B3") 
guiSetFont(TeamSlct_BTN[3], "sa-header") 
  
guiSetVisible(TeamSlct_BTN[3],false) 

If you need anything else to help me ask for it. Thanks for reading.

Link to comment
Basically i've got a script to show certain buttons after login, it works perfectly, but i wanted to add a dxImage and i didn't got succesful, this is everything i use to do this actions: login>show buttons

This is to show the dxImage.

local screenW, screenH = guiGetScreenSize() 
  
addEventHandler("onClientRender", root, 
    function() 
        dxDrawImage(0, 0, screenW, screenH, ":tdm/pics/intro.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
    end 
) 

This is to hide login window and show the team selection buttons (guiSetVisible(TeamSlct_BTN[1],true))

function hideLoginWindow() --Show Team select panel after login 
    guiSetInputEnabled(false) 
    guiSetVisible(Login_TabPanel[1], false) 
    destroyElement(Login_TabPanel[1]) 
    Login_TabPanel[1] = nil 
    guiSetVisible(TeamSlct_BTN[1],true) 
    guiSetVisible(TeamSlct_BTN[2],true) 
    guiSetVisible(TeamSlct_BTN[3],true) 
  
    if blackLoginScreen == true then 
        fadeCamera(true,blackScreenTime) 
    end 
end 
addEvent("hideLoginWindow", true) 
addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) 

This are buttons script:

TeamSlct_BTN[3] = guiCreateButton(0, (screenH/2) - ((screenH/3)/2), screenW, screenH/3, "PLT", false) 
guiSetProperty(TeamSlct_BTN[3], "NormalTextColour", "FF0553B3") 
guiSetFont(TeamSlct_BTN[3], "sa-header") 
  
guiSetVisible(TeamSlct_BTN[3],false) 

If you need anything else to help me ask for it. Thanks for reading.

Can you show the error? Do you have you image in your xml file? Do you have your image with the right path?

Link to comment
Basically i've got a script to show certain buttons after login, it works perfectly, but i wanted to add a dxImage and i didn't got succesful, this is everything i use to do this actions: login>show buttons

This is to show the dxImage.

local screenW, screenH = guiGetScreenSize() 
  
addEventHandler("onClientRender", root, 
    function() 
        dxDrawImage(0, 0, screenW, screenH, ":tdm/pics/intro.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
    end 
) 

This is to hide login window and show the team selection buttons (guiSetVisible(TeamSlct_BTN[1],true))

function hideLoginWindow() --Show Team select panel after login 
    guiSetInputEnabled(false) 
    guiSetVisible(Login_TabPanel[1], false) 
    destroyElement(Login_TabPanel[1]) 
    Login_TabPanel[1] = nil 
    guiSetVisible(TeamSlct_BTN[1],true) 
    guiSetVisible(TeamSlct_BTN[2],true) 
    guiSetVisible(TeamSlct_BTN[3],true) 
  
    if blackLoginScreen == true then 
        fadeCamera(true,blackScreenTime) 
    end 
end 
addEvent("hideLoginWindow", true) 
addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) 

This are buttons script:

TeamSlct_BTN[3] = guiCreateButton(0, (screenH/2) - ((screenH/3)/2), screenW, screenH/3, "PLT", false) 
guiSetProperty(TeamSlct_BTN[3], "NormalTextColour", "FF0553B3") 
guiSetFont(TeamSlct_BTN[3], "sa-header") 
  
guiSetVisible(TeamSlct_BTN[3],false) 

If you need anything else to help me ask for it. Thanks for reading.

Can you show the error? Do you have you image in your xml file? Do you have your image with the right path?

Link to comment

The debug script doesn't show any error, but what happens is that you start displaying the image since the begging and the image is not disabled while login panel is actived, and after clicking in a certain button, it should be disabled, but it stills there.

Mainly i need a command like (guiSetVisible(insert GUI stuff name here,true/false))

but for the dxImage

Link to comment
The debug script doesn't show any error, but what happens is that you start displaying the image since the begging and the image is not disabled while login panel is actived, and after clicking in a certain button, it should be disabled, but it stills there.

Mainly i need a command like (guiSetVisible(insert GUI stuff name here,true/false))

but for the dxImage

You should use cancleEventHandler to cancle the event handler that attached to onClientRender to draw the image when you clicked certain button

Link to comment
The debug script doesn't show any error, but what happens is that you start displaying the image since the begging and the image is not disabled while login panel is actived, and after clicking in a certain button, it should be disabled, but it stills there.

Mainly i need a command like (guiSetVisible(insert GUI stuff name here,true/false))

but for the dxImage

You should use cancleEventHandler to cancle the event handler that attached to onClientRender to draw the image when you clicked certain button

No such function, stop giving false answers.

+ It's not attached to a function, but a function itself created, which has no name, and the name can't be given. It's removeEventHandler.

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