ConvertToZBufferedSprite

Introduction The ConvertToZBufferedSprite method can be used on Sprites which have already been added to the SpriteManager as ordered (not z-buffered). This method assumes: That the argument Sprite has already been added to the SpriteManager That the Sprite is not on a Layer Code Example The following code adds a Sprite regularly, then converts it[…]

Screen.CustomDestroy

Introduction The CustomDestroy (if using Glue) and Destroy (if not using Glue) methods are called when the Screen is going to be removed from your game. This method should never be manually called – the ScreenManager will call this after the Screen’s IsActivityFinished property is set to true. The purpose of the CustomDestroy/Destroy methods is[…]

Cleaning Up Screens

Introduction This error can occur if your current Screen is destroyed without cleaning up after itself. More specifically this means that objects were added to the FlatRedBall managers during the Screen’s life but were not removed prior to or during the Screen’s Destroy method. The error that you see will tell you which member to[…]

Texture

Introduction The Sprite’s Texture property controls which image the Sprite is displaying. This property is of type Texture2D. When a Sprite is created through the SpriteManager’s AddSprite method, the Sprite’s Texture property gets set inside that method. Code Example The following code explains how Textures are assigned. Files used: Add the following at class scope:[…]

FlatRedBall.Content.ContentManager

Introduction Content managers provide functionality for organizing and caching game assets. They can be thought of as a “bucket of assets”. When you create an asset through the Content Manager, you give it a name (usually its file name) and decide which Content Manager it goes into. Later if the same name appears, the FlatRedBall[…]

BottomTextureCoordinate

Introduction The TopTextureCoordinate, BottomTextureCoodinate, LeftTextureCoordinate, and RightTextureCoordinate properties control the coordinates in “uv space” of the top, bottom, left, and right sides of the Sprite. In other words, these values can be used to make a Sprite draw part of a texture instead of the entire thing. These properties are often used when working on[…]

LeftTextureCoordinate

Introduction The TopTextureCoordinate, BottomTextureCoodinate, LeftTextureCoordinate, and RightTextureCoordinate properties control the coordinates in “uv space” of the top, bottom, left, and right sides of the Sprite. In other words, these values can be used to make a Sprite draw part of a texture instead of the entire thing. These properties are often used when working on[…]

RightTextureCoordinate

Introduction The TopTextureCoordinate, BottomTextureCoodinate, LeftTextureCoordinate, and RightTextureCoordinate properties control the coordinates in “uv space” of the top, bottom, left, and right sides of the Sprite. In other words, these values can be used to make a Sprite draw part of a texture instead of the entire thing. These properties are often used when working on[…]

KeepTrackOfReal

Introduction The PositionedObject’s Velocity and Acceleration values often dictate the position and movement of a PositionedObject, but sometimes these properties are also used in game code to control other objects. For example, in a physically realistic game if an airplane is flying at a certain speed and fires a bullet, the bullet’s world velocity should[…]

Screen

Introduction The Screen class is a container for Entities, content (such as loaded .png files), an FlatRedBall objects (such as Sprites). Games will usually have only one screen active most of the time.