Oh, ok I seem to have misunderstood you then. There are currently two ways to achieve this:kikito wrote:I was not concerned about drawing the buttons; I was concerned about properly detecting that the mouse was over them - set the "state" to "hot" only if the mouse is really inside the circle, not in the rectangle of the button.
- overwrite gui.core.mouse.inRect() or even gui.core.mouse.updateState() for specially shaped hit boxes, or
- create a new widget that does the correct check.
However, I am open to make the hit test more flexible. The only question is how to do so without making the interface too complicated. After all the biggest motivator for using IMGUI is that the code is straightforward and relatively easy to understand.
Relatively easy, but you have to carry the state yourself:Gravy wrote:How hard would it be to implement double-clicking?
Code: Select all
if gui.core.Button("Double Click Me!", ...) then
local now = love.timer.getTime()
if now - lastclick < threshold then
print("Double click!")
end
lastclick = now
end
The problem is that Quicky extracts the mouse coordinates itself, without applying the camera transformation beforehand. For example, if the camera looks 10 pixels to the right, i.e. moves everything 10 pixels to the left, then the hit boxes will also be 10px off.trubblegum wrote:It has worked fine with the HUMP camera for meI might want to (say) use a camera system, so the mouse/button coordinates are different. I might need to transform the mouse coordinates. I'm not sure quickie is able to support that right now.
Anyway, apart from overwriting gui.core.mouse.inRect(), you can also apply the camera transformation to gui.core.mouse.x and gui.core.mouse.y before defining the widgets in love.update().