FlatRedBall.Input.Keyboard.GetKey

Introduction The GetKey function returns an object which can be used to query information about keys. GetKey can be used in situations where the code is written against a general key, or even a general input object, as the return value from GetKey is of type FlatRedBall.Input.KeyReference, which implements FlatRedBall.Input.IPressableInput.

FlatRedBall.Input.Keyboard.GetStringTyped

Introduction The Keyboard class can be used for text input. Unfortunately, at the time of this writing the keyboard only understands the English keyboard. The GetStringTyped method returns the string that was typed during the last frame. It is possible for multiple keys to be pressed during a frame and the GetStringTyped method also considers[…]

FlatRedBall.Input.Keyboard.KeyPushed

Introduction The KeyPushed method returns whether the argument key was pressed this frame. This value will only return true for one frame when the key is first pushed. Code Example The following code will test to see if the Enter key has been pushed: if(InputManager.Keyboard.KeyPushed(Keys.Space)) { // do something… }

FlatRedBall.Input.Keyboard.Clear

Introduction The Clear method clears out input from the Keyboard. After Clear is called, all Keyboard methods and properties will behave as if there was no keyboard activity this frame. This function is useful when implementing functionality that should consume input, and is commonly used with the IInputReceiver interface.

FlatRedBall.Input.Keyboard.IgnoreKeyForOneFrame

Introduction The IgnoreKeyForOneFrame method marks the argument key as being ignored for the rest of the current frame. This is useful if your project has two live objects which are checking for a particular key, but you only want one of them to receive the key press. Code Example In this example we will consider[…]

FlatRedBall.Input.Keyboard.ControlPositionedObject

Back to Keyboard Introduction The ControlPositionedObject method is a method which can be used to move a PositionedObject with the arrow keys. this code is rarely used in final games, but can be very useful for learning how to use FlatRedBall and for quick prototypes. Code Example For an example, see this example on the[…]

FlatRedBall.Input.Keyboard.KeyDown

Introduction The KeyDown method is a method which returns whether a particular key is being held down. This method will return true if a key is pressed, and will continue to return true until the key has been released. This method can be used to perform every-frame actions such as setting the velocity of a[…]

CurrentChainName

Introduction The CurrentChainName property gets and sets the name of the AnimationChain currently played by the owner of the property. Setting this property is the most common way to change between different animations at runtime, and it can also be set in Glue to control the animation displayed by an IAnimationChainAnimatable (such as a Sprite).[…]

FlatRedBall.Gui.IInputReceiver.ReceiveInput

Introduction The ReceiveInput function is called every frame by the FlatRedBall Engine on the current IInputReceiver. This function can be used by objects implementing the IIputReceiver interface to handle input and to clear it after processing it. ReceiveInput is ultimately called when the Keyboard’s state is updated inside the FlatRedBall Engine. This means that this[…]

Combining CSVs with Entities

Introduction CSVs are a common way to define game data in FlatRedBall games. Examples of game data include the cost, damage, and rarity of weapons or stats of enemies like Orc, Dragon, and Elf. Usually this information is used in game logic to determine information like the maximum speed of a car or how much damage[…]