Can you make clickable GUI's with draw and/or surface

Wondering if I can make clickable GUI’s with draw and/or surface. I’m trying to make something like GB Radial menu that isn’t fully customizable but can store binds.

Thanks,
Flex

I’d recommend that you turn your GUI into a VGUI panel or set of VGUI panels and simply don’t call MakePopup so it won’t lock the mouse.

If you really want to use draw/surface libraries you’ll need to use something like



local function mouseInBox( x, y, w, h )
   local _x, _y = gui.MousePos();
   return _x >= _x and _y >= _y and _x<x+w and _y<y+h );
end
local function isBoxPressed( x, y, w, h )
    return gui.IsMouseDown( MOUSE_LEFT ) and mouseInBox( x, y, w, h );
end


I’ll try both and see which one I like better, thanks, if anyone else has any other ideas, I’ll leave the thread open for a bit.

[editline]13th July 2014[/editline]

Okay, I went with VGUI, so problem solved.

I’ve been making a inventory myself using surface functions and checking if your mouse is in boxes, would you guys think that using vgui instead would be much easier? I just really don’t like working with vgui, thats the problem

create controls vgui and use the surface functions inside the Paint hook