Author Topic: Virtual keyboard prefab for controller input?  (Read 4182 times)

Paul

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 22
    • View Profile
Virtual keyboard prefab for controller input?
« on: August 03, 2015, 08:46:22 PM »
I'm working on a PC game that supports both keyboard/mouse & controller input.

I've got a high score leaderboard that allows the user to type in their name via a UIInput component with the keyboard. This works great, however, if they are playing with just a controller I'd like a way for them to enter their name without having to use a keyboard.

Option 1: Create a "virtual" keyboard prefab via several UIButton and UIKeyNavigation components, but I was wondering if NGUI (or anyone/the community) has such a prefab.

Option 2: Modify UIInput so that it would also support controller input (perhaps up/down on the controller would scroll or "spin" the current letter, then UISubmit would move to the next character until the user entered each letter manually). The advantage here is UIInput would still work with a normal keyboard/mouse setup; no need to switch/toggle based on input device.

Does this make sense? Should I be going about this a different way or is there an easier approach?

Thanks! Paul
« Last Edit: August 03, 2015, 08:56:51 PM by Paul »

Paul

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 22
    • View Profile
Re: Virtual keyboard prefab for controller input?
« Reply #1 on: August 05, 2015, 03:21:51 AM »
Alright, well I needed something in a pinch so I whipped up a simple prefab that programatically generates '0'-'9' and 'A'-'Z' with UIKeyNavigation components sorted under a UIGrid.

If anyone is interested, I can cleanup & share the components since they're pretty generic. Otherwise, I hope this post gives someone else an idea if they run into the same situation!



The following was my "inspiration" LOL