PositionedObjectList

Introduction

PositionedObjectLists in Glue represent lists of objects which can be positioned. Positioned objects include:

  • Any Entity
  • Circles
  • AxisAlignedRectangles
  • Texts
  • Sprites

In code all of the objects mentioned above inherit from the FlatRedBall.PositionedObject class. The list above is just some of the most common types.

Creating a PositionedObjectList

Entity lists can be created by right-click drag+dropping an entity into a screen:

rightclickdragdrop

PositionedObjectLists can also be created through the regular right-click menu in an screen or entity’s Objects node:

  1. Right-click on Objects
  2. Select Add Object
  3. Make sure FlatRedBall or Custom Type is selected
  4. Select PositionedObjectList<T>
  5. Select the type of list to create using the dropdown
  6. Enter the name of the list

Adding to a List

Once a list has been created, instances of the list’s type can be added:

  1. Right-click on the list
  2. Select Add Object
  3. Glue will only ask for the new instance’s name (the type will match the list type), so enter a name and click OK

Instances can also be added to a list by first creating them outside of the list and dragging them onto the list. This is how instances of a derived entity type can be added to a list of a base type:

basederivedlist

Instances (of the same type or of derived type) can be added to a list by dragging the entity directly on the list:

basederivedlist2