PolygonEditor:Tutorials:Editing Polygons

Introduction

Lists of Polygons are stored in the Polygon List XML File (.plylstx) and can be loaded in the FlatRedBall Engine to be used for collision and other logic which requires a defined area.

Adding a Polygon

To add a Polygon:

  • Click the “Add” menu strip command.
  • Click “Polygon (Rectangle)”. A new rectangle polygon will appear in the scene view.

Editing a Polygon

Editing Basic Properties

  • Click the Polygon in the scene view.
  • A PropertyGrid for the Polygon will appear.
  • Edit the UI representing the properties of the Polygon.

Deleting a Polygon

To delete a Polygon:

  • Select the Polygon. Its points will be represented by small squares.
  • Verify that no points are selected. If all point representations are the same color, then the polygon is selected. If any points are of different colors (like Green) then the points are selected. To delete an entire polygon make sure to not have any points selected.
  • Press Delete to delete the polygon.

Editing Points

Each polygon is made of an ordered list of points. These points can be moved and deleted, and new points can be added to Polygons as well.

Moving Points

To move a point:

  • Select a Polygon. Its points will be represented by small squares.
  • Select the Move icon in the Tools Window.
  • Click and drag one of the points on the Polygon. It will change color and move with the mouse as long as the mouse button is held down.

Deleting Points

To delete a point:

  • Select a Polygon. Its points will be represented by small squares.
  • Click on one of the points. It will change color to represent being selected.
  • Press the Delete key on the keyboard.

Adding Points

To add a point:

  • Select a Polygon. Its points will be represented by small squares.
  • Click the Add Point icon in the Tools Window.
  • A blue triangle will appear on the polygon which will move in response to the mouse movement.
  • Click the mouse to add a point. A new box will appear representing the newly-added point. You can continue to add points.
  • To stop adding points deselect the Add Point icon in the Tools Window or select a different action in the Tools Window.