Package paintingcanvas.drawable
Interface Interactable
-
- All Known Implementing Classes:
Canvas,Circle,DrawableBase.InteractableShape,Ellipse,Rectangle,Square,Triangle
public interface InteractableAllows for interaction with elements on the canvas.
This interface is pretty rough, if you need anything more precise it would be best to add your own
KeyListenerorMouseListenertoInternalCanvas.panel.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanclicked()Check if the element has been clicked by the mouse.booleanhovered()Check if the element is currently being hovered over by the mouse.booleanintersects(java.awt.Point pos)Check if the point intersects with the element.
-
-
-
Method Detail
-
intersects
boolean intersects(java.awt.Point pos)
Check if the point intersects with the element.- Returns:
- true if the point intersects with the element, false otherwise.
-
hovered
boolean hovered()
Check if the element is currently being hovered over by the mouse.- Returns:
- true if the element is hovered, false otherwise.
-
clicked
boolean clicked()
Check if the element has been clicked by the mouse.- Returns:
- true if the element is clicked, false otherwise.
-
-