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 tutorial shows how to load a PNG to disk and how to draw it on screen using a[…]

01 – BindingContext

Introduction The BindingContext property is used for all data binding. This tutorial introduces the BindingContext property and creates a simple example using BindingContext to control the UI. Example Screen For this tutorial we will create a Gum screen which contains the following: Points Display Health Bar Button for awarding points Button for taking damage Button[…]


Introduction The Texture property is a reference to the Texture2D referenced by an AnimationFrame. This is the Texture that it will apply when the animation is being displayed. This is automatically set when loading a .achx file (such as in Glue), but it can be changed at runtime, or can be set when creating a[…]


Introduction PaintTileTextureCoordinates can be used to change the texture coordinates on a tile by its ordered index. This method can specify all four coordiantes (left, top, right, bottom) or just the top and left. If only the top and left are specified, the bottom and right are automatically determined based on the tileset’s tile dimensions.[…]


Introduction The TextRenderingMode property controls the approach that the RenderingLibrary uses to render Text objects internally. The following two approaches are supported: TextRenderingMode.RenderTarget TextRenderingMode.CharacterByCharacter By default the RenderingLibrary sets the TextRenderingMode to CharacterByCharacter. CharacterByCharacter TextRenderingMode.CharacterByCharacter renders each character separately, similar to a situation where each character in a Text object is a separate Sprite object. This[…]


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


Introduction The TextBox control can be used to let the user enter text input such as a profile name. Layout Requirements The TextBox control requires: An Text named TextInstance An object named CaretInstance of any type Although not required, the TextInstance should be contained within an object that has its Clips Children set to True. This can be a container within the TextBox, of[…]


Introduction FromTexture2D creates an ImageData object, filled with data from a Texture2D instance. It’s important to note that the ImageData is a copy of the Texture2D, so making changes to the ImageData will not change the source Texture2D. Code Example The following code shows how to create an ImageData instance from a Texture2D instance, then[…]


Introduction Texture2D instances can be created through Glue by adding image files to entities, screens, or global content. By default, any image file added to Glue will be loaded when the containing screen/entity is created. Files added to Global Content can be accessed as soon as the game launches from any screen or entity. Example[…]