Author Topic: general beginner NGUI questions regarding usage and with my game code  (Read 1281 times)


  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 23
    • View Profile
Hi, I'm relatively new to NGUI, and I have some questions.  I don't think I'm asking for complete implementations, but helpful answers that point me in the right direction will be nice.

I'm making an RPG and I'm attempting to add the following items from NGUI:
1. text input bar (text field)
2. text dialog box (text box)
3. text dialog box #2 (text box)
4. minimap box

The minimap box I will code myself, but I'm not sure of the best way to integrate that code with NGUI.

My questions:
1. should I use the text field and text box prefabs and make modifications, or can/should I create those items from scratch?
2. I attempted to use the prefabs, and I'm having trouble 'anchoring' the items automatically using tables.  any ideas?
3. after I changes the atlas/sprite for the text items, the default text no longer appears on the items.  any ideas?
4. (general Unity question) is there a way to specify the screen dimensions and then query for the screen dimensions programmatically?
5. given the screen dimensions, is there a way to programmatically generate the mentioned items?
6. my 'game' view has its own camera, so there are two cameras (the main camera, and the ngui camera).  initially, the graphics overlapped.  the first workaround I tried was setting the x&y coordinates of UI Root to far away so that the camera items don't overlap.  is there a better way?
7. the text fields appear to have an anchor point of top-left and extend left and down, while ui sprites appear to have an anchor point of center, and extend to the sides left&right and up&down.  is there something else I can/should use besides a sprite for graphics(non-ngui) areas?
8. my current implementation of input for my game uses Unity's input system.  since I'm using NGUI, should I just replace that with NGUI's input system?
9. when I play the game in unity, the ngui ui elements shift upper left -- why would that happen?

Any information will be helpful.

« Last Edit: June 16, 2014, 12:46:07 PM by Fractalbase »