Skip to content

Commit

Permalink
Explain FlxG singletons in input util docs (#2411)
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli committed Sep 22, 2021
1 parent d3a162c commit 4464962
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions flixel/input/FlxKeyManager.hx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import flixel.FlxG;
import flixel.input.FlxInput.FlxInputState;
import flixel.input.keyboard.FlxKey;

/**
* Keeps track of what keys are pressed and how with handy Bools or strings.
* Automatically instatiated by flixel as a `FlxKeyboard` and accessed via `FlxG.keys`
* or `FlxAndroidKeys` with `FlxG.android`.
* Example: `FlxG.keys.justPressed.A`
*/
class FlxKeyManager<Key:Int, KeyList:FlxBaseKeyList> implements IFlxInputManager
{
/**
Expand Down
1 change: 1 addition & 0 deletions flixel/input/keyboard/FlxKeyboard.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import flixel.system.replay.CodeValuePair;

/**
* Keeps track of what keys are pressed and how with handy Bools or strings.
* Normally accessed via `FlxG.keys`. Example: `FlxG.keys.justPressed.A`
*/
class FlxKeyboard extends FlxKeyManager<FlxKey, FlxKeyList>
{
Expand Down
1 change: 1 addition & 0 deletions flixel/input/mouse/FlxMouse.hx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ private class GraphicCursor extends BitmapData {}
/**
* This class helps contain and track the mouse pointer in your game.
* Automatically accounts for parallax scrolling, etc.
* Normally accessed via `FlxG.mouse`.
*/
class FlxMouse extends FlxPointer implements IFlxInputManager
{
Expand Down

0 comments on commit 4464962

Please sign in to comment.