SpriteManager

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

Creating Runtime Objects as Instances

Introduction Objects can be instantiated directly inside the Objects folder of Screens or Entities. Typically these instances are of standard types such as Sprite or TileShapeCollection. Also, the type of instances can be entity types, such as an instance of a Player in the GameScreen. If your game includes a special type which is not[…]

SkiaSpriteCanvas

Introduction The SkiaSpriteCanvas type provides a Skia canvas which can be used to render any Skia graphics. All rendering performed on the canvas is efficiently converted to a Texture2D. SkiaSpriteCanvas inherits from the standard FlatRedBall Sprite, so it provides all of the common Sprite functionality including: Attachment to entities Sorting according to the SpriteManager settings Rotation,[…]

03 – Loading Textures and Using Sprites

Introduction Textures (which use the type Microsoft.Xna.Framework.Graphics.Texture2D) are used to draw graphics on the screen. A Texture is a resource which is usually loaded from .png and is drawn to the screen using the Sprite type. This code-only tutorial shows how to load a PNG to disk and how to draw it on screen using[…]

gluj/glux

Introduction FlatRedBall Glue projects are saved in either gluj (Glue JSON) or glux (Glue Xml) files. Furthermore, new projects also save their screens in glsj (Glue Screen JSON) and entities in glej (Glue Entity JSON) files. This document discusses details about the glue data files. Versions which display the green checkbox ✅ can typically be upgraded[…]

RenderTargetSprite

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

Texture

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