Method GetGlyphSet
GetGlyphSet(Player, int, Pole, List<(Glyph, AxisRange)>, bool, SymbolPreference?, string)
Get a list of all glyphs that could represent a particular action.
Declaration
public static GlyphSetQueryResult GetGlyphSet(this Player player, int actionID, Pole pole, List<(Glyph, AxisRange)> output, bool forceAxis = false, SymbolPreference? joystickSymbols = null, string collectionKey = null)
Parameters
Type | Name | Description |
---|---|---|
Player | player | The player to check the input map of |
int | actionID | The identifier of the action to represent |
Pole | pole | The direction of the action to represent.
|
List<(Glyph, AxisRange)> | output | A list storing the output results of this function that is defined by the calling type. The list is cleared when this method is called and will contain the results after the method executes. Must not be a null value. |
bool | forceAxis | Usually the Input Glyph system, when |
SymbolPreference? | joystickSymbols | Determines the symbol type used to represent joystick glyphs. |
string | collectionKey | Optionally used for getting glyphs from a non-default glyph collection. Should match the value of Key |
Returns
Type | Description |
---|---|
GlyphSetQueryResult | The resulting GlyphSetQueryResult informing the caller of if the query was successful or why it was unsuccessful if it wasn't |
Remarks
By design does not filter by controller type since you may decide to filter the output
list yourself using the glyph ControllerType.
The results list will not include any NullGlyph, UninitializedGlyph, or UnboundGlyph.
It is your responsibility to decide whether you'd like to show these glyphs depending on the returned GlyphSetQueryResult or output list values.
Examples
Primitive example of how to call this method.
// Defining the list outside of the method is highly encouraged so we don't generate garbage memory every method call
private List<(Glyph, AxisRange)> output = new List<(Glyph, AxisRange)>();
private void SetGlyphs()
{
// !!! Specify `playerID`, `actionID`, and `pole` based on what you want to represent. !!!
Player player = ReInput.players.GetPlayer(playerID);
player.GetGlyphSet(actionID, pole, output);
foreach ((Glyph, AxisRange) result in output)
{
// !!! Your functionality here. Use result.Item1 and glyph.Item2. !!!
}
}