Rewired Glyphs Docs Rewired Glyphs Docs
Rewired Glyphs Docs Rewired Glyphs Docs
Rewired Glyphs

Search Results for

    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.

    Usually positive unless it is an axis action such as Move Left in a Move Horizontal action.

    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 forceAxis is false, only checks for single axis inputs such that it will only look for "Move Left" with Pole.Negative and "Move Right" with Pole.Positive and thus never checking "Move Horizontal" as an axis itself.

    When true, explicitly request for the Input Glyph system to evaluate this glyph as the full axis ("Move Horizontal" in the example case) so we can represent it properly for axis inputs.

    TL;DR: For axis actions: True represents the axis itself "Move Horizontal". False represents negative pole "Move Left" and positive pole "Move Right". In most cases should be false.

    SymbolPreference? joystickSymbols

    Determines the symbol type used to represent joystick glyphs.

    When null (default): Use the PreferredSymbols for representing 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. !!!
    		}
    }
    Docs generated for Rewired-Glyphs Unity Package. Package distributed under MIT license.