Touching

interface Touching

When a mouse event needs to check if the mouse is "touching" an actor, how is "touching" defined.

For some actors, this may be a simple bounds-check (i.e. is the mouse inside the actor's bounding box). See WithinBounds.

For others, we may want to do pixel detection (i.e. does the actor's appearance draw an opaque pixel at this point). See TouchingPixel.

For multi-line labels, we don't want pixel detection, because that would be too finicky. But just checking the overall bounds may give false positives. A better approach would check the bounding box of each line of the Label's text. FYI. At time of writing, this doesn't exist!

Should we include the actor's children too? See TouchingChildren.

Inheritors

Functions

Link copied to clipboard
abstract fun touching(actor: Actor, localPoint: Vector2): Boolean