Keyboard key sprite generator

In VALA we support keyboard/mouse and game controllers, and allow rebinding of controls.
That means that when we have text like "Press [X] to activate your shield", we need to swap out [x] for the right controller or keyboard button image based on their binding.
Controllers only have a few buttons so it isn't a problem to make the sprites, but keyboards have 110 bindable keys.

I know it is a really niche case, but maybe someone else will find this useful. I made a quick (read: crappy) little app that takes a text list of keys and generates a transparent PNG for each one using a small and medium key template you provide. You can select font size and stuff, and it'll also adjust the font size slightly for each key to fit in.

https://github.com/roguecode/Keyboard-Key-Sprite-Generator

image

Comments

  • Thanks for sharing! This could be very handy!
    Thanked by 1roguecode
  • this is really cool @roguecode thanks for this !
  • edited
    That is very cool. I might have to something like this in the near future. But why not just use a textfield instead (on top of the keyboard sprite)? That way it can be localised as well ;)
    Thanked by 1critic
  • That is very cool. I might have to something like this in the near future. But why not just use a textfield instead (on top of the keyboard sprite)? That way it can be localised as well ;)
    In some cases it's easier to just have it as one image. If you are putting this inline with text in Unity, then it's easier to just have to embed an image, unless you want to pre-layout everything. It also means you're doing less stuff at runtime which I'm always a fan of doing. Finally, it means we use one generic solution for controller icons and keyboard icons, instead of using your suggestion for keyboard, but static icons for controller.

  • This is so cool. The fact you are making your tooling available (like keyboard sprite generator and that awesome subtitle timing thing) that all game devs need to make games, is wonderful. Thanks for sharing this. You show you care about our community and want to contribute. I tip my hat to you sir! Thanks! :D
    Thanked by 2Sash roguecode
Sign In or Register to comment.