Difference between revisions of "Shape:testPoint"

m (included link to other languages)
Line 14: Line 14:
 
* [[parent::Shape]]
 
* [[parent::Shape]]
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=Checks whether a point lies inside the shape.
+
{{#set:Description=Checks whether a point lies inside the shape.}}
}}
+
{{#set:Since=000}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|Shape:testPoint}}
 
{{i18n|Shape:testPoint}}

Revision as of 11:54, 25 March 2011

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