The area component.
groupComponents
subgroupComponent Types
area: shape: Shape | null
If we use a custom shape over render shape.
Area scale.
Area offset.
cursor: Cursor | null
Cursor on hover.
Collider area info.
If this object should ignore collisions against certain other objects.
sincev3000.0
Restitution ("bounciness") of the object.
Friction of the object.
Whether collision detection should be done even without body.
If was just clicked on last frame.
If is being hovered on.
checkCollision(other: GameObj ): Collision | null
Check collision with another game obj.
sincev3000.0
Get all collisions currently happening.
sincev3000.0
If is currently colliding with another game obj.
If is currently overlapping with another game obj (like isColliding, but will return false if the objects are just touching edges).
Returns true if the objects collide in screen space
paramother
onClick(f: ()=>void , btn?: MouseButton ): KEventController
Register an event runs when clicked.
sincev2000.1
onHover(action: ()=>void ): KEventController
Register an event runs once when hovered.
sincev3000.0
onHoverUpdate(action: ()=>void ): KEventController
Register an event runs every frame when hovered.
sincev3000.0
onHoverEnd(action: ()=>void ): KEventController
Register an event runs once when unhovered.
sincev3000.0
onCollide(tag: Tag , f: (obj: GameObj , col?: Collision )=>void ): KEventController
Register an event runs once when collide with another game obj with certain tag.
sincev2001.0
onCollide(f: (obj: GameObj , col?: Collision )=>void ): KEventController
Register an event runs once when collide with another game obj.
sincev2000.1
onCollideUpdate(tag: Tag , f: (obj: GameObj , col?: Collision )=>void ): KEventController
Register an event runs every frame when collide with another game obj with certain tag.
sincev3000.0
onCollideUpdate(f: (obj: GameObj , col?: Collision )=>void ): KEventController
Register an event runs every frame when collide with another game obj.
sincev3000.0
onCollideEnd(tag: Tag , f: (obj: GameObj )=>void ): KEventController
Register an event runs once when stopped colliding with another game obj with certain tag.
sincev3000.0
onCollideEnd(f: (obj: GameObj )=>void ): void
Register an event runs once when stopped colliding with another game obj.
sincev3000.0
hasPoint(p: Vec2 ): boolean
If has a certain point inside collider.
Push out from another solid game obj if currently overlapping.
Get the geometry data for the collider in local coordinate space.
sincev3000.0
Get the geometry data for the collider in world coordinate space.
Get the bounding box of the geometry data for the collider in world coordinate space.
Get the geometry data for the collider in screen coordinate space.