Introduction The SpriteManager is a static class which handles Sprite addition, removal, and common behavior. The SpriteManager manages behavior for Sprites and SpriteFrames. Sprites The SpriteManager provides numerous methods for for working with Sprites. The following sections provide code samples for working with Sprite-related methods. Sprite Addition Most AddSprite methods both instantiate a new Sprite[…]


Introduction The RenderTargetSprite class provides a simple way to perform rendering using a RenderTarget2D. Although FlatRedBall provides support for using MonoGame render targets, the RenderTargetSprite simplifies the creation and management of render targets. RenderTargetSprite instances provide a FlatRedBall Layer for adding visual objects to the sprite. RenderTargetSprite Concepts To understand how a RenderTargetSprite works, we can[…]


Introduction The Texture color operation results in an object being drawn with its unmodified texture. Color values (red, green and blue) on the IColorable are completely ignored, unless the object has no texture. The Texture color operation is the default color operation for FlatRedBall types like Sprite and Text. Code Example Texture color operation can[…]

04 – Manual Particle Systems

Introduction Particles may require a large number of FlatRedBall Sprite instances. This guide shows how to create an incredibly efficient particle system using manual particle sprites. What is a Manual Particle Sprite? Manual sprites are sprites which the engine does not automatically update every frame. Manual sprites are an efficient alternative to automatically-updates sprites (the[…]

Using Farseer in a Glue Project

Introduction This walkthrough shows how to add Farseer to a simple Glue project. We will create a diagonal stack of blocks which will fall and collide against a static surface. This tutorial uses the FlatRedBall desktop engine, which means it uses proper XNA (as opposed to MonoGame). MonoGame projects must use the MonoGame version of[…]

Code-only Farseer Introduction

Introduction The Farseer Physics Engine is a physics engine (as the name implies) written in C#. It is directed toward use with XNA and Silverlight, but it can be used with any .NET application. It is a common choice for expanding the physics capabilities of FlatRedBall. General Approach Unfortunately the tutorial support for Farseer (at[…]


Introduction The ImplementsIDrawableBatch property can be set to true for entities which require custom rendering code. If this value is true, Glue will generate most of the code necessary for implementing IDrawable batch, including: All necessary properties Empty implementation for IDrawableBatch.Update and IDrawableBatch.Update and IDrawableBatch.Destroy. These are are empty since entities already have update and destroy[…]


Introduction The RenderTarget property can be set so a given Layer will render to the RenderTarget rather than to screen. The RenderTarget property can be used for a number of reasons: To create textures used in a multi-pass rendering system, such as to apply layer-wide effects like color tinting or bloom To improve the performance[…]


Introduction ConvertToAutomaticallyUpdated can be used to convert an object back to an automatically updated object. This is useful for objects which typically do not move (so they shouldn’t be automatically updated), but which may move from time to time. ConvertToAutomaticallyUpdated can be called on Sprites and PositionedObject. Code Example The following shows how an entity[…]