Introduction The FlatRedBall.SpriteManager method will perform a “secondary” sort of all Sprites by their Texture. The first sort condition must be Z to preserve draw order. Sprites with the same Z value will then be sorted by Texture.


Introduction The RemoveLayer function removes the current Layer from the SpritManager. This function can be used to remove Layers once they are no longer needed (such as Layers created in custom code), or to move Layers between different Cameras. Code Example The following code shows how to create and destroy a Layer in custom code.[…]


Introduction The RenderTargetRenderer class can be used to greatly increase the performance of FlatRedBall games which present complex scenes which never or rarely change. For static scenes a RenderTargetRenderer allows for near infinite complexity – specifically it allows for a very large number of visual elements to be drawn with almost no slowdown. Also, the[…]


Introduction The RemoveSpriteOneWay method removes the argument Sprite from the SpriteManager (for both rendering and automatic updates) but does not modify any relationships between the Sprite and objects outside of the game engine. Specifically, RemoveSpriteOneWay will remove a Sprite from: Rendering Ordered rendering Z-Buffered rendering Layered rendering Automatic engine updates RemoveSpriteOneWay will not remove a[…]

Adding WPF to an Existing Game

Introduction WPF controls can be added to any FlatRedBall PC game. This walkthrough shows how to add a floating control which will both display runtime information and also be used to add new entity instances. Setup This tutorial uses a Glue project named “FrbAndWpf” as the starting point. This Glue project will contain the following:[…]


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 ShowLineRectangles value controls whether dotted-line rectangles will be drawn around components. This value can help you debug where components are when they do not have visual elements, or to help you identify the clickable region when testing UI. When to set ShowLineRectangles This value is applied only when new GraphicalUiElements are created, so[…]


Introduction The RemoveDrawableBatch method removes the argument IDrawableBatch from the engine. Specifically it removes it from being rendered if it’s layered, unlayered, Z-buffered, or specific to a Camera Layer. Code Example The following assumes a valid IDrawableBatch-implementing instance called DrawableBatchInstance: SpriteManager.RemoveDrawableBatch(DrawableBatchInstance);


Introduction The AddDrawableBatch method is used to add an existing IDrawableBatch-implementing instance to the engine. Once an IDrawableBatch instance is part of the engine, then it will be automatically rendered. Code Example The following code can be used to add a drawable batch to the engine, assuming that MyDrawableBatch is a valid DrawableBatch instance: SpriteManager.AddDrawableBatch(MyDrawableBatch);


Introduction The OrderedSprites list contains all of the Sprites that will be rendered by the SpriteManager. It does not include any Sprites which are on Layers, nor any Sprites which are z-buffered. This list can be used at runtime to verify whether Sprites that you expect to be created actually are created, or to investigate[…]