Saturday, July 12, 2008
AE / intersectRect(the rect of grc "blue",the rect of grc "red")
ふたつの矩形のオブジェクトの重なった the rect を返します。
サンプルでは、重なった部分に、グリーンのグラフィックが現れます。
基本構文
intersectrect(矩形1の the rect , 矩形2 の the rect)
intersectrect(the rect of grc "blue",the rect of grc "red")
-- カード内のスクリプト
command setIntersect
get intersectrect(the rect of grc "blue",the rect of grc "red")
if it <> false then
set the rect of grc "green" to it
show grc "green"
put it into fld "intersect"
else
hide grc "green"
put empty into fld "intersect"
end if
end setIntersect
-- それぞれのグラフィック内のスクリプト
on mouseMove
setIntersect
pass mouseMove
end mouseMove
on mouseDown
grab me
end mouseDown
始めにAnimation Engineを開いて、start using stack "animationEngine"
サンプルスタックは、下記をメッセージボックスにコピペしてリターンキーを
go stack url "http://homepage.mac.com/kenjikojima/jrevnote/intersectRect.rev"