FlatRedBall.Graphics.Layer.Remove

Introduction The Remove method is responsible for removing the argument object from the calling Layer. Remove has the following signatures: Remove(Sprite spriteToRemove) Remove(SpriteFrame spriteFrame) Remove(Text textToRemove) Remove(Scene scene) Remove(IDrawableBatch batchToRemove) When to call Remove Calling Remove is usually not necessary. The reason is because the internal list that Layers use to keep track of objects[…]

FlatRedBall.Graphics.LayerCameraSettings.OrthogonalWidth

Introduction The OrthogonalWidth and OrthogonalHeight of a LayerCameraSettings object controls the number of units wide and high that the Layer will display. The LayerCameraSettings’ Orthogonal value must be true for the OrthogonalWidth and OrthogonalHeight properties to apply. Orthogonal Examples This example was initially constructed in Glue. To reproduce this: Create a Screen Add a Sprite[…]

FlatRedBall.Graphics.LayerCameraSettings.TopDestination

Introduction The TopDestination, BottomDestination, LeftDestination, and RightDestination properties of the LayerCameraSettings class allow Layers to render to only a portion of the Screen (also known as creating a mask). These coordinates are measured in pixel units in screen space. In other words, 0 is the left side of the screen for LeftDestination and RightDestination, and[…]

FlatRedBall.Graphics.Layer.LayerCameraSettings

Introduction The LayerCameraSettings property is of type FlatRedBall.Graphics.LayerCameraSettings which can be used to override the settings of the Camera when rendering the particular Layer. For more information on how to use this, see the LayerCameraSettings page.

FlatRedBall.Graphics.Layer.SortType

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

FlatRedBall.Graphics.Layer.UsePixelCoordinates

Introduction The UsePixelCoordinates can be used to easily create a 2D Layer. This method is often used in combination with attaching Entities to a Camera so that they can be placed in screen space. This method is used by Glue if a given Layer’s “Is 2D” property is set true. Code Example The following example[…]

FlatRedBall.Graphics.Layer:Layer Membership Details

Introduction Layers provide a way to force a particular order of drawing on a single Camera. While the concept is fairly straight-forward, things can become more complicated when objects are moved from being layered to unlayered, or when objects have presence on multiple layers. Since there are a variety of ways to layer and unlayer[…]

Layers

Introduction The Layers property contains all of the Layers specific to this Camera. Cameras will have one Layer in the Layers property by default. This can be accessed in one of two ways: var defaultLayer = CameraInstance.Layers[0]; or var defaultLayer = CameraInstance.Layer; Notice that the first Layer in Layers is equivalent to the Layer property.[…]

OrderedSprites

Introduction The OrderedSprites list contains all of the Sprites that will be rendered by the SpriteManager. It does not include any Sprites which are on Layers, nor any Sprites which are z-buffered. This list can be used at runtime to verify whether Sprites that you expect to be created actually are created, or to investigate[…]

Layer

Introduction Layers are a type of object which can be used to control the order in which visible objects in FlatRedBall are drawn. Most objects sort by their Z value. In other words, objects which are further from the Camera will draw behind objects which are closer to the Camera. Layers allow control over draw[…]