Introduction The IsOn3D method is a very powerful method that can be used to test if the cursor is over an object. IsOn3D is used by Glue generated code to test if the Cursor is over an Entity if the Entity implements IClickable or IWindow. The IsOn3D method is very powerful and flexible. It considers:[…]


Introduction The DestinationRectangle can be used to make a Layer only draw to part of a Screen. This is often referred to as “masking” or “creating a mask”. The DestinationRectangle property in Glue functions the same as in code. For a technical discussion on destination rectangles for Layers, see this page. Example Usage The DestinationRectangle[…]


Introduction The LayerCameraSettings class is a class which can be used to override the settings of a FlatRedBall.Camera on a by FlatRedBall.Graphics.Layer basis. LayerCameraSettings can be used to achieve the following: Adding a 2D layer when the main Camera is 3D Adding a 3D layer when the main Camera is 2D Adjusting the field of[…]


Introduction The LayerProvidedByContainer property gives you access to the layer that the containing Screen or Entity has passed to this through Glue or through the AddToManagers method call. For more information on working with Layers in code, see the Layer page. Usage You can access the Layer simply by using the LayerProvidedByContainer property: Layer layer[…]


Introduction The ForceUpdateDependencies for the Camera performs all of the same functionality as the PositionedObject’s ForceUpdateDependencies call, but it also does a few extra things. Specifically, it updates the mins and maxes of the camera, and recalculates its View and Project matrices. For information on ForceUpdateDependencies as it relates to PositionedObjects in general, see the[…]

Basic coding in Glue

Introduction This guide describes how to perform common operations with standard Glue objects. Most of what is described here can also be done through the Glue UI, but using code is sometimes necessary for dynamic behavior. The setup For this article we’ll use the following setup: A Screen which we’ll call GameScreen An Entity which[…]

Sorting and Overlapping

Introduction Many games require Sprites to overlap to create realistic scenes. FlatRedBall offers a number of ways to control sorting. This article will discuss and link to various methods of controlling how Sprites (and other objects) overlap. What are the methods? There are a number of methods of controlling overlapping Sprites. Keep in mind that[…]


Introduction Each Camera has a list of Layers which can be used to draw objects which should only appear on one Camera. This is commonly used for HUD elements such as score and health. By default each Camera has one Layer (no code necessary to add this). Therefore, if using only one Layer, then no[…]


Introduction The AddToLayer object adds an existing object instance to the argument FlatRedBall.Graphics.Layer. The first argument object may or may not already be added to the SpriteManager. If the object is an unlayered object then it will be removed from the “world layer” and added to the argument Layer. However, if an object is already[…]


Introduction The OrderedSortType property controls how Sprites are ordered when they are drawn. Z Buffered Sprites do not use this property when drawing. The following available options exist: SortType Description None No sorting will be performed. Objects will be drawn in the order that they have been added to the SpriteManager. Z (Default) Objects will[…]