Jump to content

ANIMAÇÃO PAINEL DX [ AJUDA ]


Recommended Posts

como faço pra animar um painel dx?, quando eu apertar uma tecla pra abrir ele abrir com alguma animação 

esse é meu codigo

local mostrar = false
cor = {}
function pdx()
  if mostrar == true then
  dxDrawRectangle(575, 230, 217, 309, tocolor(11, 11, 11, 178), false)
  dxDrawRectangle(575, 230, 217, 28, tocolor(21, 21, 21, 255), false)
  cor [1] = tocolor(0, 0, 0, 255)
  if isMouseInPosition(631, 369, 104, 29) then
    cor [1] = tocolor(0, 255, 0, 120)
  end
  dxDrawRectangle(631, 369, 104, 29, cor [1], false)
  dxDrawText("PEGAR", 631, 369, 736, 398, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false)
  dxDrawRectangle(575, 511, 217, 28, tocolor(21, 21, 21, 255), false)
end
end
addEventHandler("onClientRender", root, pdx)

function abrirdx()
  if mostrar == false then
    showCursor(true)
    mostrar = true
    addEventHandler("onClientRender", root,pdx) else
      showCursor(false)
      mostrar = false
      removeEventHandler("onClientRender", root, pdx)
    end
end
bindKey("x", "down", abrirdx)


function isMouseInPosition ( x, y, width, height )
	if ( not isCursorShowing( ) ) then
		return false
	end
	local sx, sy = guiGetScreenSize ( )
	local cx, cy = getCursorPosition ( )
	local cx, cy = ( cx * sx ), ( cy * sy )

	 return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) )
end

 

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