Introduction The Enabled property determines whether a UI element will react to input events, such as being clicked. IWindow instances which have their Enabled value set to false will be skipped over by the Cursor when performing UI checks; these instances will never be assigned to the Cursor.WindowOver property.


Introduction The CallClick method forces the implementing IWindow to raise its Click event. This can be used to test clicking events or to allow other input or logic to simulate a button click. Code Example The following calls click when the space bar is pressed. bool wasSpacePushed = InputManager.Keyboard.KeyPushed(Keys.Space); if(wasKeyPushed) { WindowInstance.CallClick(); }

5. Events on Gum Objects Part 2

Introduction This tutorial continues our look at working with events on Gum objects. The previous tutorial covered the most basic situation – a clickable button in a screen. We’ll expand upon the previous tutorial by creating a more complicated example – handling events on a popup container which displays a message and allows the user[…]


Introduction GetGraphicalUiElementByName returns the instance of a contained element by name, or null if a matching element isn’t found. Code Example The following code can be used to find the “Score” component and disable it from being a clickable UI element: // Assuming the current code has a EntireGumScreen object: EntireGumScreen.GetGraphicalUiElementByName(“Score”).Enabled = false; For more[…]


Introduction The IClickable interface requires implementation to specify a HasCursorOver method, which is typically used for clicking or grabbing an object. Since the IClickable interface works with the Cursor object, it can be used with a physical mouse, touch screen, or any other input device which maps to the Cursor object. Although GUI elements are[…]


Introduction The GraphicalUiElement is the base class for all Gum runtime objects. In other words, all Gum components, screens, and standard elements inherit from this class when running in a FlatRedBall project. The GraphicalUiElement class provides functionality for positioning, parenting, sizing, and layout logic. Every Screen and Component in a Gum project will create a[…]

4. Events on Gum Objects

Introduction So far we’ve discussed how to use Gum to create screens which can used and interacted with in your FlatRedBall game. This page discusses how to use events to attach custom code to common UI actions such as clicking. Gum and FlatRedBall.Forms Gum objects can be used as UI objects. The most common way[…]


Introduction The IWindow interface is an interface that enables objects to be added to the GuiManager. Once an object is added to the GuiManager it will automatically be tested for Cursor events. The IWindow interface can be used to simplify the implementation of buttons, check boxes, and any other types of UI elements which may[…]

Implements IWindow

Introduction IWindow serves as an interface for creating button-like Entities in Glue. Using the IWindow enables you to do the following: Respond to clicks (release of mouse-button or touch screen) Respond to pushes (initial press of a mouse-button or touch screen) Respond to dragging Prevent click-throughs on overlapping IWindows For initial information on how to[…]


Introduction The WindowOver returns the Window (or any object inheriting from Window such as Button, TextBox, etc.) that the Cursor is currently over. This will return the top-most window, so if the Cursor is over a Button which is contained inside a Window, the WindowOver property will contain a reference to the Button. Code Example[…]