Show / Hide Table of Contents

    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
    IComponent.Name
    IComponent.Entity
    IComponent.RegistrationType
    IComponent.Init(IEntity, Type)
    IComponent.AfterInit()
    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 Source

    CenterPoint

    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 Source

    CollidesWith(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

    true, if it collides with the point, false otherwise.

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX