Flash CS3 ドキュメンテーション |
|||
| ActionScript 2.0 リファレンスガイド > ActionScript クラス > Rectangle (flash.geom.Rectangle) > intersection (Rectangle.intersection メソッド) | |||
public intersection(toIntersect: Rectangle ) : Rectangle
toIntersect パラメータで指定された Rectangle オブジェクトがこの Rectangle オブジェクトと交差する場合に、 intersection() メソッドは、交差領域を Rectangle オブジェクトとして返します。矩形が交差しない場合、このメソッドは、プロパティが 0 に設定された空の Rectangle オブジェクトを返します。
対応バージョン : ActionScript 1.0、Flash Player 8
toIntersect:Rectangle - この Rectangle オブジェクトと交差するかどうかを調べる対象の Rectangle オブジェクト
Rectangle - 交差領域と等しい Rectangle オブジェクト。矩形が交差しない場合、このメソッドは x、y、width、および height の各プロパティが 0 に設定された空の Rectangle オブジェクトを返します。
次の例では、rect_1 が rect_2 と交差する領域を判別します。
import flash.geom.Rectangle; var rect_1:Rectangle = new Rectangle(0, 0, 50, 50); var rect_2:Rectangle = new Rectangle(25, 25, 100, 100); var intersectingArea:Rectangle = rect_1.intersection(rect_2); trace(intersectingArea.toString()); // (x=25, y=25, w=25, h=25)
このページに新しいコメントが追加された場合に、電子メールでの通知を希望する。 | コメントレポート
現在のページ: http://livedocs.adobe.com/flash/9.0_jp/main/00002086.html