Ramsey

GUI Elements convert DX

Recommended Posts

Hello MTA Communinty,

I want to get help from you guys.

Example ;

sx, sy = guiGetScreenSize()

window = guiCreateWindow(sx/2-300/2, sy/2-300/2, 300, 300, "Test Window", false)

triggerEvent("convertDX", localPlayer, window)
------------------------------------------------------

addEvent("convertDX", true)
addEventHandler("convertDX", getRootElement(), function(window)
    guiSetAlpha(window,0)
   
   --Here I want to get help, the code here will transform the gui element into dx.
end)

Thank you very much, I tried, but I could not find it.

Share this post


Link to post

In that "convertDX" event handler, add another event handler that will make the DX show. Here's an example:

addEvent("convertDX", true)
addEventHandler("convertDX", getRootElement(), function(window)
    guiSetAlpha(window,0)
   	addEventHandler("onClientRender", localPlayer, drawDX)
end)

function drawDX()
  --all the drawings go here
end

 

Share this post


Link to post

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.