Jump to content

Hiding DX Rectangle


drk

Recommended Posts

Posted

Hi ! I'm creating a Login / Register System in DX Rectangle, but I dont know to assign a variable to the Rectangle and how to hide the Rectangle.

Anyone can help me ?

Posted

Hmm, lets assume you have a var containing the rectangle alpha (for example):

local rcAlpha = 255; 
  
function drawMyRec() 
  dxDrawRectangle( x, x, x, x, tocolor( 0, 0, 0, rcAlpha ), false ) --replace 'x' with your screen coordinates 
end 
addEventHandler( "onClientRender", root, drawMyRec ) 

So when you need to hide it, you just set rcAlpha to zero, or you just do

removeEventHandler( "onClientRender", root, drawMyRec ) 

to entirely stop the drawing of your rectangle.

As you can see, there are different ways of doing what you want (if I understood correctly what you want, ofcourse...)

Posted

Ooow ! Now I understand ! Thank you very much DakiLLa ;D

EDIT: I'm creating a Login / Register System, but the GUI Window is a shit, I prefer in DX. xD

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