Author Topic: Custom Keyboard using buttons  (Read 3314 times)

JACLEMGO

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Custom Keyboard using buttons
« on: March 02, 2014, 02:59:05 PM »
Busy with an mobile educational game, which requires a custom keyboard (custom swipe keyboards cant be used in the game)

Im new to NGUI, came over from Daikon Froge

I want to create a keyboard using standard NGUI buttons, the buttons will be in 3 rows:
Row 1: QWERTYUIOP
Row 2: ASDFGHJKL
Row 3: ZXCVBNM

(As a normal keyboard, excluding the number/functions/etc)

Each row should be in the middle of the screen
Should scale to ANY device size (FixedSizeOnMobile)

I can position these manually in a widget, and make the screen fixed size, but it wont look good on all devices.

Any advice on how to do this with NGUI?

Much appreciated!
Jacques

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Custom Keyboard using buttons
« Reply #1 on: March 02, 2014, 09:20:11 PM »
If you want everything to look completely crisp on all devices then you will need to use sliced sprites for the buttons. The fixed size UIRoot will give you the easiest solution, but the sprites will obviously not adjust themselves based on different pixel density.

If constrained by the "must be pixel perfect" clause, I would create and position them them via code simply because of the variety of different screen sizes and pixel densities.

However if I was doing it, I'd still use a fixed size UIRoot. To make things crisp on higher density devices I'd use the reference atlas feature, where I'd load a higher-res atlas on higher-res devices, thus maintaining crispness even with a fixed size UIRoot.