A rectangular trigger area that detects entity entry. More...
| Import Statement: | import Clayground.Behavior |
| Inherits: |
RectTrigger is an invisible physics sensor that emits a signal when another physics entity enters its bounds. It uses Box2D sensor fixtures for collision detection without physical response.
Example usage:
import Clayground.Behavior RectTrigger { xWu: 10 yWu: 5 widthWu: 2 heightWu: 2 visible: true // Show for debugging color: "yellow" opacity: 0.5 onEntered: (entity) => { console.log("Player entered trigger zone!") } }
entered(var entity) |
Emitted when a physics entity enters the trigger area.
entity The physics body that entered the trigger.
Note: The corresponding handler is onEntered.