Method ReplaceGlyphTagsWithSpriteTags
ReplaceGlyphTagsWithSpriteTags(string, bool, string, string)
Replace glyph rich text such as <glyph "Jump"> in the provided text
with a sprite or description for its corresponding Glyph in the Rewired Glyph system.
Syntax Rules:
- The glyph tag begins with verbatim
<glyph
and ends at any>
character. - The first argument must always represent the action to represent as either an integer for the action ID or a string for the action name if and only if it does not contain any spaces.
- Following the action argument all arguments may appear in any order.
- Arguments are delimited by any occurrence of the space character, even if the space is contained within quotes.
- Additional arguments that are string based are case-insensitive such that "TYPE=JOYSTICK" and "type=joystick" are equivalent inputs.
Additional Arguments:
Following the action argument you may optionally include the following arguments to control the output glyph. - Player ID
player={int}
(Default: 0)
Specify the player you'd like to show glyph for usingplayer=2
where 2 can be any int. If an integer is alone without any specifier it is interpret as player id, such as<glyph Jump 2>
where 2 is player id - Polarity
pole={value}
(Default: Positive)
Specify the expected axis or pole input for the action such as positive for "Move Right" and negative for "Move Left" on a Move Horizontal action usingpole=Positive
,pole=Negative
, orpole=FullAxis
. You may excludepole
specifier from your input. - Controller Type
type={type}
(Default: Current)
Specify the controller type to show symbols for usingtype=Joystick
. Valid values aretype=Current
,type=Keyboard
,type=Mouse
, andtype=Joystick
.
Warning: Specifying a controller that the runtime device doesn't have connected (such as Joystick) will show theUNBOUND
symbol until they connect that controller type.
Warning: Specifying a controller that does not have the specified action bound to that specific controller will show theUNBOUND
symbol without falling back to another controller. - Symbol Preference
symbol={type}
(Default: PreferredSymbols)
Specify the symbols to use forJoystick
glyphs. Valid values aresymbol=auto
,symbol=xbox
,symbol=ps
, orsymbol=switch
. - Collection
set={value}
(Default:null
, using default collection)
Specify the collection to target for glyph queries using its Key. Only necessary when not using default collection. Example values areset=xelu
,set=dark
, orset=light
. - Hide Keyboard and Mouse
hideKBM
(Default: false)
When argument is provided will not show glyphs for theKeyboard
andMouse
device. Valid value ishideKBM
. - Hide Invalid
hideInvalid
(Default: false)
When argument is provided will not show invalid glyphs such asUnbound
,Null
, andUninitialized
Valid value ishideInvalid
.
Declaration
public static string ReplaceGlyphTagsWithSpriteTags(string text, bool useSpritesWhenAvailable = true, string descriptionFormat = "[{0}]", string spriteFormat = "{0}")
Parameters
Type | Name | Description |
---|---|---|
string | text | |
bool | useSpritesWhenAvailable | |
string | descriptionFormat | |
string | spriteFormat |
Returns
Type | Description |
---|---|
string |
Remarks
Does not mutate the provided string.