Class BoxCollider
An axis aligned rectangular Collider.
public class BoxCollider : Collider, IDisposable
- Inheritance
-
BoxCollider
- Implements
- Inherited Members
Constructors
BoxCollider(Point)
Initializes a new instance of the BoxCollider with the given size.
public BoxCollider(Point size)
Parameters
sizePointThe size of the collider.
BoxCollider(int)
public BoxCollider(int size)
Parameters
sizeint
BoxCollider(int, int)
public BoxCollider(int width, int height)
Parameters
Properties
Max
Gets the bottom right corner of the box.
public Vector2 Max { get; }
Property Value
- Vector2
Min
Gets the top left corner of the box.
public Vector2 Min { get; }
Property Value
- Vector2
Size
Gets or sets the width and height.
public Point Size { get; set; }
Property Value
- Point
Methods
Draw(SpriteBatch)
Called once per frame to render the component.
protected override void Draw(SpriteBatch spriteBatch)
Parameters
spriteBatchSpriteBatchMicrosoft.Xna.Framework.Graphics.SpriteBatch
Intersects(Point)
Whether this collider intersects with the given Microsoft.Xna.Framework.Point.
public override bool Intersects(Point point)
Parameters
pointPointThe Microsoft.Xna.Framework.Point to check against.
Returns
- bool
trueif the collider intersect with the given Microsoft.Xna.Framework.Point.
Intersects(BoxCollider)
Whether this collider intersects with the given BoxCollider.
public override bool Intersects(BoxCollider other)
Parameters
otherBoxColliderThe BoxCollider to check against.
Returns
- bool
trueif the collider intersect with the given BoxCollider.
Intersects(CircleCollider)
Whether this collider intersects with the given CircleCollider.
public override bool Intersects(CircleCollider other)
Parameters
otherCircleColliderThe CircleCollider to check against.
Returns
- bool
trueif the collider intersect with the given CircleCollider.
Intersects(Collider)
Whether this collider intersects with the other given collider.
public override bool Intersects(Collider other)
Parameters
otherColliderThe other collider used to check intersection.
Returns
- bool
trueif the colliders intersect.