Dynamic Input Switching

JmannDX - 9月 28, 2020

Switch UI elements in real-time with this library and BP set.

  • 支持的平台
  • 支持的引擎版本
    4.25
  • 下载类型
    资源包
    此产品包含各种虚幻引擎资源,可以选择性导入现有的项目。

Update 1

Complete overhaul of how the library assigns the Slate Brushes of the icon images. It now utilizes a struct with a set of Slate Brush arrays so adding Gamepad Types and replacing Icons is much easier and more straightforward. No changes were made to implementation.


This asset is a library and player controller that allows you to automatically detect the input method being used by the player, and display the appropriate icons in your HUD and UI widgets. No ticks or timers required. You can also set up multiple Gamepad Styles, so the player can select the style of icon to display without the need to hardcode the logic into individual Widgets.


See the asset in action here: https://www.youtube.com/watch?v=lDrssV_4FDw


A Sample HUD is included to show how to use the new library functions inside a widget to create dynamically updating images.

All Gamepad icons are set inside a single struct for easy image management.

I recommend adding a setting into your Options Menu to swap between Icon sets.

Every blueprint is commented with detailed explanations of the functionality.


Integration into existing projects is simple! Just add to your project and parent your current player controller to the "CustomPlayerController" included in this pack. Then you can access all library functions from anywhere. You can also just use the included player controller as-is.


For any questions, issues, feedback, or suggestions, don't hesitate to email me at jmannmarketplace@gmail.com

技术细节

Features:

  •  Update images and icons in real-time based on the player's detected input method.
  •  Everything you need is included in a single library (and 2 sets of enums)
  •  Fully commented for ease of use.
  • Enables switching HUD and UI icons between Keyboard/Mouse and Gamepad.
  • Enables switching between different Gamepad Icon Sets in-game in real-time.
  • Includes sample icon styles for Keyboard Keys, Xbox, Playstation, and Switch.
  • Icon Slate Brushes are set inside the library, so there's no need to hardcode any icons inside your widgets.
  • Simple Integration to existing projects.


Number of Blueprints: 4

Input: Keyboard and Mouse, Gamepad

Network Replicated: No

Supported Development Platforms:

Windows: Yes

Mac: Yes

Documentation: https://docs.google.com/document/d/177G9WHGRJeRDKzsdeqrPpVVRgv5GJS2sHCPIvVaUyvU/

Important/Additional Notes:

This asset does *not* automatically detect the type of gamepad being used by the player (ie. Xbox One Controller, DualShock 4 controller, etc.) Instead, it allows developers to quickly add multiple icon sets that the player can select during the game.


The included Icons are under Public Domain/CC0 license. But definitely check out Xelu's work over on OpenGameArt!