Introduction The Z value controls the ordering of the batch relative to other batches, z-ordered sprites and text objects. Since the rendering performed in IDrawableBatches may be preceded and followed by other FlatRedBall rendeing calls, render states are not preserved between DrawableBatch Draw calls.

FlatRedBall.Graphics.IDrawableBatch:Render State

Introduction Most rendering APIs (including XNA and DirectX) have what are called “render states”. While there are RenderState classes, the term “render state” is a general term which is a variable that can be set before rendering to impact the rendering of objects. When rendering objects, there are many (dozens upon dozens) of states that[…]


Introduction The MapDrawableBatch class represents a single layer in a .tmx file. It implements the IDrawableBatch class to perform custom rendering. It internally creates a single vertex buffer which is drawn all at once with no render state changes for maximum performance. Usually .tmx files are loaded into a LayeredTileMap, which contains one or more[…]


Introduction The MapDrawableBatch class is the heart of the Tile Graphics Plugin. It is ultimately the class responsible for rendering the tile map graphics when your game runs. Although the Tile Graphics Plugin provides ways to construct MapDrawableBatches from .scnx files, the MapDrawableBatch can also be constructed purely in code. While this does require some[…]


Introduction Each Layer can have its own SortType which controls how Sprites, Text, and IDrawableBatches sort. This property allows each Layer to have its own Sort type. By default objects on Layers will be sorted by their Z values – objects with smaller Z values (which are in the distance) will draw behind objects which[…]


Introduction The VerticesForDrawing member that is sometimes used internally by FlatRedBall to draw Sprites. This member can be used to perform custom drawing in IDrawableBatches. When is the VerticesForDrawing member valid? The VerticesForDrawing is used to store vertices for one of two reasons: To prevent every-frame calculation of vertices when it is not needed To[…]


Introduction The AddManagedInvisibleSprite method can optionally create and add a Sprite or simply add an already-created Sprite to a list which receives full every-frame updates without being rendered. In other words, any Sprite that has passed through the AddManagedInvisibleSprite method will be fully functional (velocity, attachments, animation, instructions), but will not pass through the rendering[…]


Introduction Although the feature set for FlatRedBall is rapidly expanding, it is impossible for the engine to handle every graphical possibility. DrawableBatches are a solution to this problem as they allow custom rendering in the engine. A DrawableBatch is a class that implements the IDrawableBatch interface, which allows user-specified rendering through XNA/MonoGame. For a full[…]


Introduction Layers provide a method of enforcing the order in which objects are drawn. This means that Layers can be used to override the default ordering of objects. In other words Layers can be used to make objects which are further from the Camera draw on top of objects which are closer to the Camera.[…]