Jump to content

Crear un rectangulo encima de un boton


Ernesto

Recommended Posts

Posted
	elseif window.type == "button" then
		local line_height = line_height * 2 - 4
		if not window.button then
			window.button = guiCreateButton ( x + width / 4, y + 3, width / 2, line_height - 4, tostring( window.text ), false ) ---- Aqui es donde ponerlo osea que este aqui encima, lo llevo intentando un buen rato y no me sale
  
			
			addEventHandler( "onClientElementDestroy", window.button, function( ) window.button = nil end, false )
			if window.onClick then
				addEventHandler( "onClientGUIClick", window.button,
					function( button, state )
						if state == "up" then
							if button == "left" then
								window.onClick( 1 )
							elseif button == "right" then
								window.onClick( 2 )
							end
						end
					end,
					false
				)
			end
			
			if window.id then
				destroy[ window.id ] = window.button
			else
				table.insert( destroy, window.button )
			end
		else
			local bx, by = guiGetPosition( window.button, false )
			if by ~= y + 3 then
				guiSetPosition( window.button, bx, y + 3, false )
			end
		end
		
		y = y + line_height

Llevo intentandolo un buen tiempo y no me sale, lo que hace es que desaparezca el boton funccional (ESTO VIENE DE PARADISE) (El resource GUI)

Posted

Es un método super chorra, pero bueno, creo que ésto debería funcionar

dxDrawRectangle(  x + width / 4, y + 3, width / 2, line_height - 4, tocolor( 0, 0, 0, 150 ) )

 

Posted

YA pero esque no se como hacer un boton DX funccional xD a ver si se pero en el script GUI de paradise en contreto porque al hacerlo deja de funccionar todo el .lua modificado

 

  • 3 weeks later...
Posted

dxDrawRectangle tiene un argumento que es PostGUI, debe de ser true para así se renderiza luego de cualquier GUI. Para esto también se debe de ejecutar con onClientRender y no con onClientPreRender como hacen algunos.

Ejemplo:

function onRender()
	dxDrawRectangle(0, 0, 20, 20, tocolor (0, 0, 0, 150), true --[[Este es el argumento importante]])
end
addEventHandler("onClientRender", root, onRender)

 

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