Skip to main content

Adding Actions to Components

Demystifying GameGlass Capabilities & Interactivity

Written by Michel Boudreau

GameGlass provides numerous actions (macros) at your disposal to be able to interact with your game or app in some creative ways.

However, these can get complicated since there's so many options and interactions possible. This support article will hopefully help your understanding of the Actions system - if any questions are not answered here, please contact support to help you.

Accessing the Action Editor

Be aware that not all components are actionable (capable of having actions assigned) - Buttons and Toggles are actionable, while Panels and Decorations are not. To access the Action Editor, add one of the actionable components on the canvas and make sure it's selected. A context menu should display and the first item there (the "A" in a box) is the Action Editor button. You can also double click any component on the canvas to open the Action Editor as a shortcut.


The Action Editor

Now that you've got it open, you'll notice the actions on the left side that can be added to any number of interaction types displayed as tabs at the top. The interaction types can change depending on the component selected - the below example is based on a Button.


Simply add an action to an interaction type by clicking on it to add it to the list. All actions are run sequentially when the interaction type is triggered.

Interaction Events

These events are only triggered when a user interacts with the component directly. They will not be triggered if their states are changed via an action like Set State - for that, look at State Events below.

On Tap

This is triggered when a user presses a component, however, it might be delayed slightly if there are On Double Tap actions also available on this component - the amount of time can be specified in the On Double Tap tab. This is to make sure the user doesn't press the component twice in that time-span. If there are no On Double Tap actions, the On Tap actions are executed immediately.

On Double Tap

As mentioned above, it waits for the user to press the component twice within the time specified (defaults to 250ms). If they do, then the On Double Tap actions are executed and the On Tap actions are ignored.

On Hold

When you hold down a component, actions can be executed after a specified amount of time held down (defaults to 1000ms). This is great for adding a third interaction on a component - it is often used to 'reset' the state of a component if for instance a command wasn't accepted by the game, this is already the default behavior for all Toggle components. It is recommended that you keep the On Hold delay time to be greater than the Double Tap time if you have actions on both as it might have unintended consequences.

Using the On Hold interaction, you can also create what we call a "Continuous Press" - actions that run continually as you press the button and will stop once you release them. If this is the only interaction on a component, you can reduce the On Hold delay to 0ms so that it gets triggered immediately.

State Events - GameGlass Pro members only

State event actions are executed when the state of the component changes, after a user interaction or if an action changes the state. These events make components much more powerful and useful, especially when testing out a shard in the editor.

On Active State / On State

Actions are triggered when the component changes to the Active/On state. This can be used to set the state of other components (like how a button or tab group works) and set the visibility of other components.

On Idle State / Off State

Actions are triggered when the component changes to the Idle/Off state. Using the button group example above, you can hide components when the button is not activated.


Actions

Any number of actions can be added to the events above and combined in some creative way.

Inputs

Keybind

Emulates a string of keybinds, up to 2 modifiers with the primary key.

Mouse Click

Emulates a mouse click of your choosing: Left, Right, or Center.

Mouse Move

Move your mouse to an absolute or relative position on your screen. Absolute positioning is based on the top-left corner of your primary screen as being 0,0. Relative positioning simply adds the x,y to the current position of the mouse pointer.

Mouse Wheel

Emulates the Mouse Scroll Wheel. Enter the number of wheel clicks to perform, then select the direction of the scroll as either Up or Down.

Write Text

Anything you type in this field will be typed out character by character when pressing the button. This may be useful to write certain phrases in a chat box.

Functions

Delay

Adding a delay between actions - this can be useful if you need to wait for a UI transition in game, or if you want to add a specific amount of time between a press and release action.

Continuous Press (On Hold only)

Pauses the execution of actions while the button is actively pressed. All actions before it are executed, pauses at the Continuous Press action until its release, which then executes all the actions after it.

Show/Hide

Hide or show any component in your shard.

Set State

You can set the state of a different component to Idle/Active by selecting the intended components from the list.

Toggle State

Toggles the state of the current component, setting it to Active if Idle and vice versa.

Take Screenshot

Takes a screenshot of your primary PC screen and saves it to your screenshots folder that's specified in GameGlass Hub settings.

Audio

Sound Effect

Play a sound on your PC to add a layer of interactivity to your shard, or to confirm a button press.

Navigation

Go to URL

Navigate to a specific website on your device using your browser. Perfect for linking to game guides, walkthroughs, maps, and more.

Go to Shard

Navigates the user to a different shard, this is useful if you want to have separate shards for different goals or tasks.

GG Navigation

Mimics the settings from the GG menu button in order to return to different main menus within the GG app.




Did this answer your question?