Freyja Button Prompts
Freyja Button Prompts are visual indicators that guide players on which buttons to press for specific actions (e.g., "Press A to Jump" or "Press E to Interact").
Requirements
Unity 2021.3.22.f1 or later
Odin Inspector 3.1.14.3
Dependencies
com.freyja.input-system
1.0.0
com.freyja.data-asset
1.0.0
com.freyja.logger
1.0.0
com.unity.textmeshpro
3.0.9
Installation
Install from Unity Package Manager -> (
Window -> Package Manager -> Add package from git URL
)

Copy and Paste this URL link https://github.com/winartodev/Freyja-Button-Prompts.git
Example Usage
Creating Button Prompt
Step 1: Create Button Prompt Data Asset


Navigate to the Create Menu in the Unity Editor.
Go to Freyja > UI > Button Prompts.
Select Button Prompt to create a new Button Prompt Data Asset.
Configure the Prompt Data in the Inspector by setting the appropriate fields (e.g.,
Prompt Name
,Input Device Type
,Prompt Icon
)
Step 2: Set Up the UI Layout

Create a New Empty Game Object in your scene
Right-click in the Hierarchy and select Create Empty.
Add Required UI Components:
Horizontal Layout Group: Ensures the button prompts are aligned horizontally.
Set
Child Alignment
toMiddle Center
.Adjust
Spacing
as needed.
Content Size Fitter: Automatically resizes the container to fit its children.
Set
Horizontal Fit
andVertical Fit
toPreferred Size
Button Prompt Component: Add the custom
Button Prompt
script to the Game Object.
Step 3 : Assign Button Prompt Data Asset

In the Inspector, locate the Button Prompt component.
Drag and drop the Button Prompt Data Asset you created earlier into the
Data Asset
field'
Step 4: Verify Result

The UI should now display the button prompts based on the configured data asset.
Create Button Prompt Text
Step 1: Set Up Text Mesh Pro
Install Text Mesh Pro (if not already installed)
Step 2: Create Button Prompt Data Asset

Navigate to the Create Menu in the Unity Editor.
Go to Freyja > UI > Button Prompts.
Select Button Prompt Text to create a new Button Prompt Text Data Asset.
Configure the Prompt Data in the Inspector by setting the appropriate fields
Step 3: Set Up the UI for Button Prompt Text

Create a New Empty Game Object in your scene
Right-click in the Hierarchy and select Create Empty.
Add the Button Prompt Text component to this Game Object.
Assign the Button Prompt Text Data Asset to the component in the Inspector.
Step 4: Verify and Test
Once the Button Prompt Text component and its associated Button Prompt Data Asset are configured, the button prompt text should appear in the scene, displaying the assigned text and icons. To dynamically display specific prompts, you can use the <prompt="<prompt_name>">
tag in your text, where prompt_name
references a prompt defined in the Button Prompt Data Asset.
How to Use <prompt>
Tag
<prompt>
TagReference Prompts in Text:
In the text field of your Button Prompt Text component, use the
<prompt="<prompt_name>">
tag to reference a specific prompt defined in the Button Prompt Data Asset.For example:
Press <prompt="Jump"> to jump and <prompt="Attack"> to attack.
Jump
andAttack
areprompt_name
values that correspond to entries in the Button Prompt Data Asset.
Ensure Prompt Names Match:
The
prompt_name
used in the<prompt>
tag must exactly match the name of a prompt defined in the Button Prompt Data Asset. This ensures the correct icon or text is displayed.
Last updated