The Circle represents a PositionedObject which can be used to draw circles or conduct circular collision which is very efficient. Circles are created and removed through the ShapeManager.

Creating a Circle in Glue

Glue supports the creation of Circles in Screens and Entities. To create a Circle in Glue:

  1. Expand a Screen or Entity
  2. Right-click on the Objects folder
  3. Select Add Object
  4. Select the Circle type
  5. Click OK

Simple Circle Example

The following example creates two circles and controls one of them with the Keyboard.

Add the following using statement
using FlatRedBall.Math.Geometry;
using FlatRedBall.Input;
At Class Scope:
Circle controlledCircle;
Circle idleCircle;
In Initialize:
 controlledCircle = ShapeManager.AddCircle();
 controlledCircle.X = 5;

 idleCircle = ShapeManager.AddCircle();
 idleCircle.Radius = 3;
In Update:
if (controlledCircle.CollideAgainst(idleCircle))
   controlledCircle.Color = Microsoft.Xna.Framework.Graphics.Color.Blue;
   controlledCircle.Color = Microsoft.Xna.Framework.Graphics.Color.Red;


Circle Members

Did this article leave any questions unanswered? Post any question in our forums for a rapid response.