Difference between revisions of "Shape:testPoint"

(Added oldin notice)
Line 1: Line 1:
Checks whether a point lies inside the shape.
+
{{oldin|[[0.8.0]]|080|type=method|text=Use [[Fixture:testPoint]] instead}}Checks whether a point lies inside the shape.
 
This is particularly useful for mouse interaction with the shapes. By looping through all shapes and testing the mouse position with this function, we can find which shapes the mouse touches.
 
This is particularly useful for mouse interaction with the shapes. By looping through all shapes and testing the mouse position with this function, we can find which shapes the mouse touches.
 
== Function ==
 
== Function ==

Revision as of 16:01, 17 April 2012

Removed in LÖVE 0.8.0
Use Fixture:testPoint instead.

Checks whether a point lies inside the shape. This is particularly useful for mouse interaction with the shapes. By looping through all shapes and testing the mouse position with this function, we can find which shapes the mouse touches.

Function

Synopsis

hit = Shape:testPoint( x, y )

Arguments

number x
The x-component of the point.
number y
The y-component of the point.

Returns

boolean hit
True if inside, false if outside

See Also


Other Languages