Adding Gum Screens to Glue Screens

Introduction Many games include a Gum screen for every Glue screen. Gum screens can be used for UI such as buttons and textboxes (usually using FlatRedBall.Forms) or can be used for read-only UI such as score and health display. Screens can be added in a variety of ways, depending on the state of your project.[…]

CurrentScreenSecondsSince

Introduction The CurrentScreenSecondsSince method returns how many seconds have passed since the argument time according to the current screen time. This is the preferred method of detecting how long time has passed since it takes into consideration screen pausing and the TimeManager’s TimeFactor property. Code Example: Spawning an Enemy on a Timer The following code[…]

OnScreenKeyboard

Introduction The OnScreenKeyboard, also referred to as a “software keyboard”, can be used to enter text in a TextBox using a GamePad. Console games and games which use a controller as a primary input device will usually include some form of OnScreenKeyboard for text entry. Although the OnScreenKeyboard is primarily designed to be used with[…]

BaseScreen

Introduction The BaseScreen value controls the base screen from which the current screen is derived. The derived screen will have all of the objects, files, events, variables, and code of the base screen, but can add more functionality and content in Glue and code. In code setting the BaseScreen sets the screen to inherit from[…]

Derived Screens as a Levels

The latest version of FlatRedBall, Glue, and the Tiled plugin include features to support a new approach for creating levels – using derived screens. Screen inheritance has been available in Glue for many years, but the latest set of features revive this functionality and make level creation easier than ever. Old vs. New Levels are[…]

02. Creating a GameScreen

Introduction This walk-through creates two screens. The first is a screen called GameScreen which defines what our game has in every level. The second is a screen called Level1 which has files and objects for our first level. GameScreen will be a base class for Level1, and any additional levels will also use GameScreen as a base screen.[…]

Restricting Mouse to Screen Bounds

Introduction Some games benefit from keeping the mouse within the screen bounds. The two common scenarios for keeping the mouse within the screen bounds are: A first person shooter uses the mouse to move around. The mouse should be invisible and not move outside of the window when the window has focus. Real time strategy[…]

SetFullScreen

Introduction SetFullScreen sets the game to run in full screen. This function can change the current resolution of the desktop. Graphics cards only support a certain number of resolution configurations. If SetFullScreen is called with a value not supported by the graphics device, an exception will be thrown. Code Example The following code sets the[…]