Error getting tags :
error 404Error getting tags :
error 404 intersect | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
intersect
Basics
Expander triangle
Type
Function
Syntax
intersect(object,object)
Introduced
1.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Returns true if two objects overlap, false otherwise.
Examples

intersect(field "Comment",the selectedField)
if intersect(button "target", button "crosshairs") then flashScreen

Additional Comments
Expander triangle

Use the intersect function to determine whether one object obscures part of another object, or whether one object is over another object.

Parameters:

The object is any object reference.

Value:

The intersect function returns true or false.

Comments:

If both objects are stacks or cards, the intersect function returns true if the stack windows overlap.

The intersect function uses screen coordinates for stacks and cards, and window coordinates for controls. This means that if one object is a stack or card and the other is a control, the intersect function does not return a reliable result.

User Comments
Expander triangle
User thumbnail
Hans Behrens
StarStarStarStarStar
Apr 24, 2009
The intersect() command takes two objects as inputs. In some situations, it may be useful to find the intersect of a point and a rectangle. The custom function below may be used in those cases:


function pointIntersect pPoint,pRect
split pPoint by comma
split pRect by comma
return ((pRect[1] <= pPoint[1]) and (pPoint[1] <= pRect[3]) and (pRect[2] <= pPoint[2]) and (pPoint[2] <= pRect[4]))
end pointIntersect


Examples: pointIntersect(the mouseLoc, the rectangle of stack "MyStack") pointIntersect(the clickLoc, the rect of img "Splash")
Use the pointIntersect function to determine whether a point is within a specified rectangle.
Parameters: The pPoint is an expression that evaluates to a point. The pRect is a rectangle consisting of four integers separated by commas.
Value: The pointIntersect function returns true or false.
Comments: The pointIntersect function does not differentiate between screen coordinates and window coordinations. This means that if the point is screen-relative, such as a mouseLoc, and the rectangle is window-relative, such as an object's rectangle, the pointIntersect function does not return a reliable result.