Interface IColliderComponent
Adds the ability for an entity to check collisions (i.e check whether it collides with a point in the room). The collision is checked via either the entity's bounding box, or via a pixel perfect collision if the IPixelPerfectComponent exists and enabled.
Inherited Members
System.IDisposable.Dispose()
System.ComponentModel.INotifyPropertyChanged.PropertyChanged
Namespace: AGS.API
Assembly: AGS.API.dll
Syntax
[RequiredComponent(typeof(IDrawableInfoComponent), true)]
[RequiredComponent(typeof(IScaleComponent), true)]
[RequiredComponent(typeof(IPixelPerfectComponent), true)]
public interface IColliderComponent : IComponent, IDisposable, INotifyPropertyChanged
Properties
| Improve this Doc View SourceCenterPoint
Gets the center point of the entity.
Declaration
PointF? CenterPoint { get; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<PointF> | The center point. |
Methods
| Improve this Doc View SourceCollidesWith(Single, Single, IViewport)
Does the entity collide with point (x,y)? The (x,y) is expected in room-coordinates after adjusting for the viewport. The collision is checked via either the entity's bounding box, or via a pixel perfect collision if the IPixelPerfectComponent exists and enabled.
Declaration
bool CollidesWith(float x, float y, IViewport viewport)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | x | The x coordinate. |
| System.Single | y | The y coordinate. |
| IViewport | viewport | The viewport to check the collisions against |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|