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:
PositionedObjectLists can also be created through the regular right-click menu in an screen or entity’s Objects node:
- Right-click on Objects
- Select Add Object
- Make sure FlatRedBall or Custom Type is selected
- Select PositionedObjectList<T>
- Select the type of list to create using the dropdown
- 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:
- Right-click on the list
- Select Add Object
- 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:
Instances (of the same type or of derived type) can be added to a list by dragging the entity directly on the list: