Author Topic: Camera + Panel Issues (Noobie question)  (Read 2456 times)

Shemamforash

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
Camera + Panel Issues (Noobie question)
« on: January 27, 2014, 09:09:07 AM »
Hi!

Currently developing a game, and I after lengthy deliberation I decided to go ahead and get NGUI so I didn't have to code my UI. Been at it for ~4.5 hours now, and I just don't seem to be able to understand it! I've watched the tutorial videos but I could not find any explanation on how to 'set up' NGUI initially.

So I start up a new scene -> new GameObject -> add a UIPanel and UIRoot script. I change the scaling style to pixel perfect min = 720, max = 1080.

Next I go -> new GameObject -> add UICamera script -> set projection to Orthographic with size at the default of 5 -> clear flags "depth only".

Finally -> alt + shift + s -> set the anchor to that of the UIRoot and modify it a bit(trying to make a taskbar style thing, so no matter the size of the screen the taskbar will be there).

My issue is that I don't understand how the camera is working, if I anchor the sprite to the bottom of the UIroot, I have to set the top value to target's bottom + 1,000,000 ish to be able to actually see the sprite in the game view.

Short at sweet of it. How do I set up UIRoot, UICamera and UIPanel for a simple UI!? I kinda feel like im missing something really crucial but for the life of me I cannot work out what it is!

Thanks so much

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Camera + Panel Issues (Noobie question)
« Reply #1 on: January 27, 2014, 11:49:21 AM »
You don't need to do any of that. Try this:

1. New scene.
2. Alt+SHIFT+W.

Your UI hierarchy will be created for you.

Shemamforash

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
Re: Camera + Panel Issues (Noobie question)
« Reply #2 on: January 27, 2014, 02:49:41 PM »
Oh man, that's awesome. Thanks!