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 的第二个索引。