Coder Social home page Coder Social logo

boyquotes / godot-action-icon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kobewi/godot-action-icon

0.0 0.0 0.0 1.15 MB

GUI node for Godot that displays the key associated with input action.

Home Page: https://godotengine.org/asset-library/asset/1431

License: MIT License

GDScript 100.00%

godot-action-icon's Introduction

Godot Action Icon

Action Icon is a TextureRect-based custom GUI node that you can put on a scene and it will display the associated action. Just activate the plugin and add ActionIcon to your scene. Note that in-editor preview is limited.

It has a couple of display modes to configure:

  • Action Name: the name of the action from project's Input Map
  • Joypad Mode: whether the action should display keyboard key or joypad button. If set to "Adaptive", the icon will automatically change when it detects keyboard or joypad input. Only relevant to actions that have both assigned.

You can define a custom action, by going to ActionIcon.gd script and editing the CUSTOM_ACTIONS constant. By default there is a "move" action that displays WSAD/Left Stick. Some device sets include extra buttons that can be used for custom actions.

  • Joypad Model: model of the joypad to display. Supported are: Xbox, Xbox360, DualShock 3, DualShock 4, DualSense, Joy-Con. If set to Auto, the script will try to auto-detect the controller based on the device id of joypad events and joy name returned by Godot. "Any Device" option will default to the first joypad. Fallbacks to Xbox if detection fails. All auto-model icons are refreshed when new device is connected, so icons will auto-update if joypad changes.
  • Favor Mouse: if an action has a keyboard and mouse button configured, favor_mouse set to true will display the mouse button
  • Fit Mode: Node = the icon will use whatever size you set. Match Width = the icon minimum width will match its height. Useful e.g. inside HBoxContainer. Match Height = same, but matches height to width.

If you change your input mappings in-game, you can use get_tree().call_group(&"action_icons", &"refresh") to refresh all visible icons to match the newly assigned input.

You can customize the appearance of buttons by going to 'addons/ActionIcon` and relevant button folders. By default the Action Icon comes with keyboad, mouse and XBox buttons from xelu's CC0 input icons pack.


You can find all my addons on my profile page.

Buy Me a Coffee at ko-fi.com

godot-action-icon's People

Contributors

kobewi avatar bytezz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.