Jump to content

[Help] Dx


ivor

Recommended Posts

  • 2 weeks later...
  
function isMouseWithinRangeOf(psx,psy,pssx,pssy) 
    if not isCursorShowing() then 
        return false 
    end 
    local cx,cy = getCursorPosition() 
    cx,cy = cx*x,cy*y 
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then 
        return true,cx,cy 
    else 
        return false 
    end 
end 
  
function dx() 
    dxDrawRectangle (0, 0, 100, 50, tocolor ( 195, 195, 195, 50 ) ) 
    dxDrawText ("#B01010CLICK!",0, 0, 100, 50, tocolor(195, 195, 195, 255), 15, "default", "center", "center", false, false, true, true) 
    CursorInButton = isMouseWithinRangeOf(0, 0, 100, 50) 
    if CursorInButton then 
        dxDrawRectangle (0, 0, 100, 50, tocolor ( 195, 195, 195, 100 ) ) 
    end 
end 
addEventHandler("onClientRender", root, dx) 
function click(theButton, press) 
    if theButton == "mouse1" and press == true then 
        if CursorInButton then 
            outputChatBox("wow") 
        end 
    end 
end 
addEventHandler("onClientKey", root, click) 
  

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