RandomRambo Posted September 16, 2021 Posted September 16, 2021 (edited) Hi guys. Need some help with DX , I have some code and I need to put an image in the background of this window. Tryed guiCreateStaticImage But it doesn't work correctly or doesn't work at all I know that here is dxDrawRectangle but I need instead of this black "window" a transparent image behind this window. Help if u know how to do it. Code: function Render() if getElementData(localPlayer,"inMenu") == true then destroyWorkWindow() end dxDrawRectangle(x-450, y-292, 900, 400, tocolor ( 0, 0, 0, 210) ) dxDrawRectangle(x-410, y-242, 350, 320, tocolor ( 255, 255, 255, 80) ) twd = dxGetTextWidth(getElementData(isReal(),"name"), 1.3, "default-bold") dxDrawText(getElementData(isReal(),"name"),x-245-twd/2, y-272, 350, 500,tocolor (181,166,66, 255 ), 1.3, "default-bold") start = -10 for i, v in ipairs(works) do if i == qtLabelEntered and qtLabelSelected ~= i then dxDrawRectangle(x-410, y-232+start, 350, 35, tocolor ( 180, 180, 180, 210) ) elseif i == qLabelSelected then dxDrawRectangle(x-410, y-232+start, 350, 35, tocolor ( 181,166,66, 210) ) if qtAcceptEntered == 1 then dxDrawRectangle(x+10,y+28,400,50, tocolor( 181,166,66, 80)) else dxDrawRectangle(x+10,y+28,400,50, tocolor( 255, 255, 255, 80)) end local checkWork = getElementData(localPlayer,"works") or 0 if checkWork == v.works then twd = dxGetTextWidth("Accept",1.3,"default-bold") dxDrawText("Accept",x+210-twd/2,y+43,400,50,tocolor ( 255,255,255, 255 ), 1.3, "default-bold") else twd = dxGetTextWidth("Go",1.3,"default-bold") dxDrawText("Go",x+210-twd/2,y+43,400,50,tocolor ( 255,255,255, 255 ), 1.3, "default-bold") end end if getElementData(isReal(),"id") == v.works then twd = dxGetTextWidth(v.name,1.3,"default-bold") dxDrawText(v.name,x-245-twd/2, y-232+start+5, 350, 500,tocolor ( 255,255,255, 255 ), 1.3, "default-bold") start = start + 35 end end end Edited September 16, 2021 by RandomRambo
The_GTA Posted September 18, 2021 Posted September 18, 2021 Hello RandomRambo, have you tried using dxDrawImage with a transparent alpha value for color? You can load an image using dxCreateTexture at load-time of your resource and use the texture handle in a dxDrawImage call. This will allow you to draw the background image transparent instead of simple rectangles. Not using dxCreateTexture is not recommended. Developer of Magic.TXD • Developer of MTA:Eir, Eir Lua • Company owner of EirDev
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