Is Within
根據 Shape 的位置是否落在另一個 Shape 內部來切換屬性。Is Within 當 Shape 在 Within Shape 外部 時輸出 0,在 內部 時輸出 1。
Within Shape - 連接一個 shape 作為其他 shapes 的邊界。
包含 2 points 的 Lines 可以用作 Within Shape。線的左側被視為內部 — 想像沿著線的路徑方向行走並向左看。選中 Shape 並使用 Edit Shape tool,可以在 Viewport 中查看 Path 方向。
如果使用 Basic Line,請記得將 Divisions 減少到 0。
Invert - 切換結果,使 Shape 在 Within Shape 內部時輸出 0,在外部時輸出 1。
- 建立 2 個 Polygons。
- 命名為 Poly 和 Zone。
- 建立一個 Is Within Behaviour。
- 連接 zone.id→isWithin.withinShape。
- 建立一個 Color Array。
- 向陣列加入第二個索引並設定顏色。
- 連接 isWithin.id→colorArray.index。
- 連接 colorArray.id→poly.fillColor。
當 Poly 移動時,其 pivot 位於 Zone Shape 內部時,其顏色將變為 Color Array 的第二個索引。