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. Default Functionality – Glue Creates Lists in GameScreen By default[…]
Introduction The ManagedPositionedObject list in the SpriteManager object is a list of PositionedObjects which the SpriteManager is managing. In a typical project (using Glue), this list will contain mostly instances of Entities in your game, so you can look at this list to see what is actively managed.
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>[…]
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 AddPositionedObject method is a method which adds an existing PositionedObject instance to the SpriteManager for management. Managed PositionedObjects will have velocity, acceleration, drag, and attachment properties applied automatically every frame. This method should only be called for objects which are otherwise not handled specifically by the FlatRedBall Engine. For example, Sprites are managed[…]
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.
Introduction The TimedActivity method is a method used by PositionedObjects (and objects which inherit from PositionedObject such as Sprite) to perform common every-frame logic. The TimedActivity method performs the following: Adjusts position by velocity and acceleration Adjusts velocity by acceleration Adjusts rotation by rotation velocity Adjusts velocity by drag (linear representation) Calls TimedActivityRelative. Adjusts RealVelocity[…]
Back to Keyboard Introduction The ControlPositionedObject method is a method which can be used to move a PositionedObject with the arrow keys. this code is rarely used in final games, but can be very useful for learning how to use FlatRedBall and for quick prototypes. Code Example For an example, see this example on the[…]
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[…]
Introduction The ControlPositionedObject method is a shortcut method which can be used to quickly add control logic for PositionedObjects using a Xbox360GamePad. The ControlPositionedObject method modifies the Velocity values of a PositionedObject. Therefore, consider the following: Acceleration will not have any impact on a PositionedObject that is being controlled by ControlPositionedObject ControlPositionedObject sets Velocity even[…]