Firefly Zero
The official C SDK for making Firefly Zero apps.
Loading...
Searching...
No Matches
DPad8 Struct Reference

8-directional DPad-like representation of the Pad. More...

#include <firefly.h>

Public Attributes

bool left
 If the left segment of the Pad is pressed.
bool right
 If the right segment of the Pad is pressed.
bool up
 If the upper segment of the Pad is pressed.
bool down
 If the lower segment of the Pad is pressed.

Detailed Description

8-directional DPad-like representation of the Pad.

Constructed with Pad.toDPad8. Useful for simple games and ports. The middle of the pad is a "dead zone" pressing which will not activate any direction.

Implements all the same methods as DPad4.

Invariant: it's not possible for opposite directions (left and right, or down and up) to be active at the same time. However, it's possible for heighboring directions (like up and right) to be active at the same time if the player presses a diagonal.

For completeness, here is the full list of possible states:

  • right
  • right and up
  • up
  • left and up
  • left
  • left and down
  • down
  • right and down
  • none

The documentation for this struct was generated from the following file: