intersect

returns true if two objects overlap, false otherwise.

# Metadata

Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 1.0 Security:

# Syntax

intersect(object, object [, threshold] )

# Params

- object : an object reference. - threshold : The amount of transparency that pixels in the objects must have in order to be counted during the intersect calculation. Alternative (readable) theshold options

# Examples

intersect(field "Comment",the selectedField)

if intersect(button "target", button "crosshairs") then flashScreen

if intersect(graphic "spaceship", graphic "asteroid", "opaque pixels") then endGame

answer intersect(image "gradient", grc "solid",125)

# Description

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

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 relative 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.

# Tags

ui,

# See

- **property:** layer - **control structure:** function - **keyword:** card, control - **constant:** return - **object:** card, stack - **glossary:** control, relative coordinates, return, stack window, object - **function:** within, stacks