Sorting and Overlapping

Introduction Many games require Sprites to overlap to create realistic scenes. FlatRedBall offers a number of ways to control sorting. This article will discuss and link to various methods of controlling how Sprites (and other objects) overlap. What are the methods? There are a number of methods of controlling overlapping Sprites. Keep in mind that[…]

FlatRedBallXna:Tutorials:Object Sorting

Introduction Many games require Sprites to overlap to create realistic scenes. FlatRedBall offers a number of ways to control sorting. This article will discuss and link to various methods of controlling how Sprites (and other objects) overlap. What are the methods? There are a number of methods of controlling overlapping Sprites. Keep in mind that[…]

ConvertToZBufferedSprite

Introduction The ConvertToZBufferedSprite method can be used on Sprites which have already been added to the SpriteManager as ordered (not z-buffered). This method assumes: That the argument Sprite has already been added to the SpriteManager That the Sprite is not on a Layer Code Example The following code adds a Sprite regularly, then converts it[…]

RotationMatrix

Introduction The Camera object inherits from the PositionedObject class. Therefore, it can be rotated just like any other PositionedObject. For information on using rotation values on a PositionedObject in general, see the following pages: FlatRedBall.PositionedObject.RotationX FlatRedBall.PositionedObject.RotationY FlatRedBall.PositionedObject.RotationZ FlatRedBall.PositionedObject.RotationMatrix By default the Camera will attempt to orient itself so that “up” is the Y vector (0,1,0).[…]

AddPositionedObject

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

FlatRedBall.Math.AttachableList.MakeOneWay

Introduction The MakeOneWay method makes the calling AttachbleList a one-way list. In other words, it means that the AttachableList will still contain all of the objects that it contained before calling MakeOneWay; however, the contained elements will no longer know that they belong to this List. This essentially makes the AttachableList behave like a regular[…]

FlatRedBall.IO.FileManager.RelativeDirectory

Introduction The FileManager’s RelativeDirectory is a directory that is used as the directory that file loading is performed relative to. For example, let’s say the FileManager’s RelativeDirectory is “C:\Projects\MyGame\bin\x86\debug\” In this case any file-related FRB call will result in FlatRedBall looking in this directory for files. Therefore, we could create a Sprite as follows: SpriteManager.AddSprite(“redball.bmp”);[…]

Save Classes

Introduction If you’ve worked with FlatRedBall you may have come across “Save” classes. A Save class is a class that is designed to allow the user to save a runtime object to an XML file, as well as to load the XML and convert it back into a fully-functional runtime object. In other words, Save[…]

FlatRedBall.Instructions.InstructionManager.MoveThrough

Introduction This method creates instructions for moving the argument PositionedObject through a list of points which is created from the list of IPositionables passed as the second argument. This method can be used in combination with the NodeNetwork class to automatically move objects along a path. Code Example The following creates five Sprites. The four[…]

Shape

Introduction The ShapeManager is responsible for managing “Shapes”. Shapes are most often used for collision between objects. Objects which belong to the Shape categorization are: AxisAlignedCube AxisAlignedRectangle Capsule2D Circle Line Polygon Sphere All of these objects share the PositionedObject base class. These are the only objects which the ShapeManager manages. Although there is no “Shape”[…]