Author Topic: Using NGUI as "Engine" to make 2D Games best pratices.  (Read 4402 times)

badawe

  • Jr. Member
  • **
  • Thank You
  • -Given: 8
  • -Receive: 7
  • Posts: 70
    • View Profile
Using NGUI as "Engine" to make 2D Games best pratices.
« on: March 14, 2013, 03:45:03 PM »
Hey guys!

Here at Monster Juice, we love NGUI and use it everywhere, we even have done a entire game in NGUI:

But now, we are starting another project, and is 2D Platform game in Unity, and we are really liking the idea of making another game entirely in NGUI.

But the first problem is, what we should do about the Physics?

Look at this simple example:
Using default unity camera


And here is the same scene
using NGUI Camera


I made another test, using the NGUI Panel, but with a regular camera with ortographic size of 384 but everything get really slow because the size of things.

I can't figure out, what is the best way. Do you guys have one idea? Or I should give up NGUI for make the entirely game.

Majicpanda

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 83
    • View Profile
Re: Using NGUI as "Engine" to make 2D Games best pratices.
« Reply #1 on: March 14, 2013, 03:48:55 PM »
As for your "world" I still stick with a normal ortho Camera for my 2d game with the UICamera script attached to it so it easily uses NGUI's input detection.  One camera with the GUI and another for my tk2d sprites.  Not sure as to your gravity problem, that's interesting ;)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Using NGUI as "Engine" to make 2D Games best pratices.
« Reply #2 on: March 14, 2013, 04:02:17 PM »
Keep your Ortho camera size around 10, and the UIRoot scale of 20 / Screen.height. That should give you a decent size for physics. Basically my suggestion is -- if you dont want to mess with default physics, just scale the ortho camera size and UIRoot until you get what you want.