ConvertToManagedInvisible

Introduction ManagedInvisible Sprites are Sprites which the SpriteManager performs every-frame updates on them (such as applying Velocity, Acceleration, and attachment logic). These Sprites are not drawn by the engine. For more information on managed invisible Sprites, see the AddManagedInvisibleSprite method. When to use ConvertToManagedInvisible The most common way of creating managed invisible Sprites is to[…]

AddSprite

Introduction The AddSprite function is one of the most common functions in FlatRedBall. The AddSprite function adds a Sprite instance to the SpriteManager. It can also create new Sprite instances depending on which overload is called. AddSprite Signatures public static Sprite AddSprite(string texture) public static Sprite AddSprite(AnimationChainList animationChainList) public static Sprite AddSprite(AnimationChain animationChain) public static[…]

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”);[…]

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

Inheriting from Sprite

Inheriting from the Sprite Class In general it is not recommended to inherit from the Sprite class. This can reslt in cluttered interfaces and improper instantiation of objects. Instead, we recommend using the Entity pattern for your game objects. However, if you are sure that inheriting from the Sprite class is the only solution to[…]

RemoveSelfFromListsBelongingTo

Introduction One of the most useful yet least understood features of PositionedObjects is their two-way relationship with AttachableLists. Before reading this article you may want to check this article to understand how two-way relationships work. The RemoveSelfFromListsBelongingTo method does essentially what the name says – it removes the calling PositionedObject from any AttachableLists that it[…]

ConvertToManuallyUpdated

Introduction The ConvertToManuallyUpdated method allows for the conversion of an automatically updated object to a manually updated object. Objects can be made manually updated so that they are still rendered by the engine, but automatic updates won’t be performed. This can be done to improve performance. At the time of this writing, the following types[…]

AddToLayer

Introduction The AddToLayer object adds an existing object instance to the argument FlatRedBall.Graphics.Layer. The first argument object may or may not already be added to the SpriteManager. If the object is an unlayered object then it will be removed from the “world layer” and added to the argument Layer. However, if an object is already[…]

FlatRedBallXna:Tutorials:Culling

Introduction Culling is the process of determining that an object or a part of an object does not need to be drawn, then skipping the drawing logic because of this determination. This is an effective way to improve performance if the process of detecting whether an object should be drawn is significantly faster than just[…]

SortYSpritesSecondary

<- SpriteManager Introduction The SortYSpritesSecondary performs a sort on all ordered Sprites so that sprites with a larger Y are drawn first. The sorting based off of Y is only done on Sprites which have the same Z value. Therefore, Z takes first priority, then Sprites with the same Z will be sorted so Sprites[…]