RealDocs

UKismetSystemLibrary::GetGamepadButtonGlyph

function Engine Blueprint Since 4.0
#include "Kismet/KismetSystemLibrary.h"
Access: public Specifiers: staticBlueprintPure

Description

Returns the platform-provided icon texture for a given gamepad button, for use in on-screen button prompts. iOS and tvOS only.

Caveats & Gotchas

  • iOS and tvOS only — returns nullptr on every other platform.
  • Also returns nullptr if ButtonKey doesn't match a recognized button or no gamepad is assigned to ControllerIndex — always null-check before assigning the result to a UI image.
  • ButtonKey values correspond to the MFi/GameController framework's button identifiers, not Unreal's own input action names.

Signature

static ENGINE_API UTexture2D* GetGamepadButtonGlyph(const FString& ButtonKey, int32 ControllerIndex)

Parameters

Name Type Description Default
ButtonKey const FString& Identifier for the gamepad button whose glyph icon to fetch.
ControllerIndex int32 The player controller index to query, in case different players have different gamepad hardware.

Return Type

UTexture2D*

Example

Fetch a button glyph for a UI prompt C++
if (UTexture2D* Glyph = UKismetSystemLibrary::GetGamepadButtonGlyph(TEXT("A"), 0))
{
    ButtonPromptImage->SetBrushFromTexture(Glyph);
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.