Mobile Support (Android & iOS)
Since version 3.2.0, Input Icons supports displaying specific sprites on mobile devices, with some differences compared to keyboard and gamepad support.
Key Differences
The main difference is that displayed sprites on mobile are not derived from actual bindings within an Input Action Asset. The displayed sprites are fixed and will not adapt to rebound input actions. For most mobile games, this isn’t an issue as users rarely rebind touch inputs.
Mobile Icon Sets
Instead of referencing an input action in your components, you’ll use strings defined in your mobile Icon Set:
- Find the default mobile Icon Set at “Assets/InputIcons/IconSet_Mobile_Grey”
- Use the Custom Context list to define mobile actions you want to display
- Recommended: Duplicate this asset and replace sprites with your own
After customizing your Icon Set:
- Open the Setup Window (Tools – Input Icons - Input Icons Setup)
- Navigate to the Customization section
- Replace the default Icon Set with your own
- Re-create the sprite asset containing your mobile sprites
Mobile Support Components
To display mobile icons, you need both a base prompt component and a corresponding mobile override component:
Base Component | Mobile Override | Purpose |
---|---|---|
II_SpritePrompt | II_SpritePromptMobileOverride | Override sprites for SpriteRenderers |
II_ImagePrompt | II_ImagePromptMobileOverride | Override sprites for UI Images |
II_TextPrompt | II_TextPromptMobileOverride | Replace <inputaction> tags with mobile sprites |
How It Works
When the Base Prompt Component updates displayed sprites, it fires an event. The Mobile Support Component reacts by overriding sprites or <inputaction>
tags with mobile-specific versions.
Example Setup for Sprite Renderer
- Add both
II_SpritePrompt
andII_SpritePromptMobileOverride
to a GameObject - Configure the
II_SpritePrompt
component normally - In the
II_SpritePromptMobileOverride
:- Click “Add Sprite Override”
- Reference the same SpriteRenderer used in
II_SpritePrompt
- Select which mobile sprite to display
Example Setup for TextMeshPro
- Add both
II_TextPrompt
andII_TextPromptMobileOverride
to a GameObject - Configure the
II_TextPrompt
component normally - In the
II_TextPromptMobileOverride
:- Add mobile override entries
- Each entry can replace a single
<inputaction>
tag with one or more mobile sprites