Jump to content

DxDraw help


Recommended Posts

Hello,i just tried to wrote some some dxdraw text and image behind it.

So how to hide dxdraw text in this script?Cus i tried to hide it but only image was hidden.
Help plsssss

Script:

Quote


statsWindows = guiCreateStaticImage(0.80, 0.20, 0.19, 0.21, "images/deb.png",true)
guiSetAlpha(statsWindows,0.8)


local screenW,screenH = guiGetScreenSize()
local resW,resH = 1280,720
local sW,sH =  (screenW/resW), (screenH/resH)

 
function mis ()
dxDrawText ( "Mission1:",1035*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" )
if getElementData(localPlayer,"package") >= 1 then
dxDrawText ( "Completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" )
else
dxDrawText ( "Not completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" )
end
dxDrawText ( "Mission2:",1035*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" )
if getElementData(localPlayer,"package") >= 1 or getElementData(localPlayer,"package") >= 1 then
dxDrawText ( "Completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" )
else
dxDrawText ( "Not completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" )
end
dxDrawText ( "Mission3:",1035*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" )
if getElementData(localPlayer,"package") >= 1 then
dxDrawText ( "Completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" )
else
dxDrawText ( "Not completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" )
end
end
addEventHandler( "onClientRender", root, mis)


function showDebugMonitor ()
   local visible = guiGetVisible(statsWindows)
    guiSetVisible(statsWindows,not visible)
     local visible2 = guiGetVisible(mis)
      guiSetVisible(mis,not visible2)
end
bindKey("7","down",showDebugMonitor)

function xds()
    screenw,screenh = guiGetScreenSize()
    
    end
addEventHandler ( "onClientRender", getRootElement(), xds )
 


 

 

Edited by RandomRambo
Link to comment
statsWindows = guiCreateStaticImage(0.80, 0.20, 0.19, 0.21, "images/deb.png",true)
guiSetAlpha(statsWindows,0.8)


local screenW,screenH = guiGetScreenSize()
local resW,resH = 1280,720
local sW,sH =  (screenW/resW), (screenH/resH)
local dxText = false
 
function mis ()
dxDrawText ( "Mission1:",1035*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" )
if getElementData(localPlayer,"package") >= 1 then
dxDrawText ( "Completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" )
else
dxDrawText ( "Not completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" )
end
dxDrawText ( "Mission2:",1035*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" )
if getElementData(localPlayer,"package") >= 1 or getElementData(localPlayer,"package") >= 1 then
dxDrawText ( "Completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" )
else
dxDrawText ( "Not completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" )
end
dxDrawText ( "Mission3:",1035*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" )
if getElementData(localPlayer,"package") >= 1 then
dxDrawText ( "Completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" )
else
dxDrawText ( "Not completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" )
end
end

function showDebugMonitor ()
   local visible = guiGetVisible(statsWindows)
    guiSetVisible(statsWindows,not visible)
    local visible2 = guiGetVisible(mis)
    guiSetVisible(mis,not visible2)
    if dxText ~= true then 
    dxText = false
    removeEventHandler( "onClientRender", root, mis)
    else
    dxText = true
    addEventHandler( "onClientRender", root, mis)
    end
end
bindKey("7","down",showDebugMonitor)

 

Link to comment
16 hours ago, Oussema said:

statsWindows = guiCreateStaticImage(0.80, 0.20, 0.19, 0.21, "images/deb.png",true)
guiSetAlpha(statsWindows,0.8)


local screenW,screenH = guiGetScreenSize()
local resW,resH = 1280,720
local sW,sH =  (screenW/resW), (screenH/resH)
local dxText = false
 
function mis ()
dxDrawText ( "Mission1:",1035*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" )
if getElementData(localPlayer,"package") >= 1 then
dxDrawText ( "Completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" )
else
dxDrawText ( "Not completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" )
end
dxDrawText ( "Mission2:",1035*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" )
if getElementData(localPlayer,"package") >= 1 or getElementData(localPlayer,"package") >= 1 then
dxDrawText ( "Completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" )
else
dxDrawText ( "Not completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" )
end
dxDrawText ( "Mission3:",1035*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" )
if getElementData(localPlayer,"package") >= 1 then
dxDrawText ( "Completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" )
else
dxDrawText ( "Not completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" )
end
end

function showDebugMonitor ()
   local visible = guiGetVisible(statsWindows)
    guiSetVisible(statsWindows,not visible)
    local visible2 = guiGetVisible(mis)
    guiSetVisible(mis,not visible2)
    if dxText ~= true then 
    dxText = false
    removeEventHandler( "onClientRender", root, mis)
    else
    dxText = true
    addEventHandler( "onClientRender", root, mis)
    end
end
bindKey("7","down",showDebugMonitor)

Doesn't work,when local dxText = false ,it shows only image,no words,but when local dxText = true it shows words and image and when im trying to hide it it hides only image again and words are still remaining.

 

Link to comment
statsWindows = guiCreateStaticImage( 0.80 , 0.20 , 0.19 , 0.21 , "images/deb.png" , true )
guiSetAlpha( statsWindows , 0.8 )


local screenW,screenH = guiGetScreenSize()
local resW,resH = 1280,720
local sW,sH =  (screenW/resW), (screenH/resH)
 
function mis ()
	dxDrawText ( "Mission1:",1035*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" )
	local myData = tonumber( getElementData(localPlayer,"package") )
	if ( myData and myData >= 1 ) then
		dxDrawText ( "Completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" )
	else
		dxDrawText ( "Not completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" )
	end
	dxDrawText ( "Mission2:",1035*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" )
	if myData and myData >= 1 then
		dxDrawText ( "Completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" )
	else
		dxDrawText ( "Not completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" )
	end
	dxDrawText ( "Mission3:",1035*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" )
	if myData and myData >= 1 then
		dxDrawText ( "Completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" )
	else
		dxDrawText ( "Not completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" )
	end
end

addEventHandler( "onClientRender" , root , mis )

local function visible( )
	guiSetVisible( statsWindows , not guiGetVisible( statsWindows ) )
	if( guiGetVisible( statsWindows ) ) then
		addEventHandler( "onClientRender" , root , mis )
	else
		removeEventHandler( "onClientRender" , root , mis )
	end
end

bindKey( "7" , "down" , visible )

 

Edited by KillerX
  • Thanks 1
Link to comment
2 hours ago, KillerX said:

statsWindows = guiCreateStaticImage( 0.80 , 0.20 , 0.19 , 0.21 , "images/deb.png" , true )
guiSetAlpha( statsWindows , 0.8 )


local screenW,screenH = guiGetScreenSize()
local resW,resH = 1280,720
local sW,sH =  (screenW/resW), (screenH/resH)
 
function mis ()
	dxDrawText ( "Mission1:",1035*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" )
	local myData = tonumber( getElementData(localPlayer,"package") )
	if ( myData and myData >= 1 ) then
		dxDrawText ( "Completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" )
	else
		dxDrawText ( "Not completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" )
	end
	dxDrawText ( "Mission2:",1035*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" )
	if myData and myData >= 1 then
		dxDrawText ( "Completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" )
	else
		dxDrawText ( "Not completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" )
	end
	dxDrawText ( "Mission3:",1035*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" )
	if myData and myData >= 1 then
		dxDrawText ( "Completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" )
	else
		dxDrawText ( "Not completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" )
	end
end

addEventHandler( "onClientRender" , root , mis )

local function visible( )
	guiSetVisible( statsWindows , not guiGetVisible( statsWindows ) )
	if( guiGetVisible( statsWindows ) ) then
		addEventHandler( "onClientRender" , root , mis )
	else
		removeEventHandler( "onClientRender" , root , mis )
	end
end

bindKey( "7" , "down" , visible )

 

Thanks it works :)

  • Like 1
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...