# 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[…]

# FlatRedBall.Math.PositionedObjectList.SortXInsertionAscending

Introduction The SortXInsertionAscending (and SortYInsertionAscending/SortZInsertionAscending) function can be used to sort all contained PositionedObjects in a list by their X (or Y/Z) value. Code Example The following code creates 3 Circles and places them in a PositionedObjectList in descending X order. Then SortXInsertionAscending is called, and the positions of the Circles are printed out: FlatRedBall.Math.PositionedObjectList<Circle>[…]

# FlatRedBall.Math.PositionedObjectList.Clear

Introduction The Clear function is a function that will empty a PositionedObjectList of all contained references – it operates the same way as calling Clear on a normal List. However, although Clear is a very common function when dealing with regular Lists, it is not often used on PositionedObjectLists. If you are using Clear, make[…]

Introduction The Add method adds the argument PositionedObject to the PositionedObjectList. The argument object will create a two-way relationship with the list. Null arguments are not allowed.

# FlatRedBall.Math.PositionedObjectList.GetFirstAfter

Introduction The GetFirstAfter value can be used to get the index of the next object after a given position value. For example, if you are working with a group of Circles and are implementing some spacial partitioning logic, you can use GetFirstAfter to find the index of the first Circle in a list to begin[…]

# FlatRedBall.Math.PositionedObjectList.GetFirstAfterPosition

Introduction GetFirstAfterPosition is obsolete. The upper bound for GetFirstAfterPosition is inclusive. GetFirstAfter uses an exclusive upper bound to match other range-accepting methods in C#. Please use FlatRedBall.Math.PositionedObjectList.GetFirstAfter.

# FlatRedBall.Math.PositionedObjectList.AttachTo

Introduction The AttachTo method is a shortcut method for attaching all contained elements in the list to the argument. The method’s contents are as follows: public void AttachTo(PositionedObject newParent, bool changeRelative) { for (int i = 0; i < Count; i++) { this[i].AttachTo(newParent, changeRelative); } } For more information on the AttachTo method, see the[…]

# FlatRedBall.Math.PositionedObjectList

Introduction The PositionedObjectList is an object which can store lists of PositionedObjects. It is the base class of the SpriteList class and is commonly used to store lists of Entities and shapes such as Polygons. The PositionedObjectList inherits from the AttachableList and it establishes two-way relationships with objects that are added to it. Common Usage[…]

# RenderTargetSprite

Introduction The RenderTargetSprite class provides a simple way to perform rendering using a RenderTarget2D. Although FlatRedBall provides support for using MonoGame render targets, the RenderTargetSprite simplifies the creation and management of render targets. RenderTargetSprite instances provide a FlatRedBall Layer for adding visual objects to the sprite. RenderTargetSprite Concepts To understand how a RenderTargetSprite works, we can[…]

# RemoveFromManagers

Introduction RemoveFromManagers removes all contained tiles from any managers and other PositionedObjectLists that hold the tiles. Specifically calling RemoveFromManagers will: Remove all shapes from the ShapeManager for every-frame management Remove all shapes from the ShapeManager for rendering Clear the TileShapeCollection Remove shapes in the TileShapeCollection from any other PositionedObjectList containing these shapes, including parent/child relationships[…]