Author Topic: Ngui as 2d game.  (Read 10156 times)

Lautaro

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 44
    • View Profile
Ngui as 2d game.
« on: December 04, 2013, 12:33:05 PM »
When creating 2D game is it wise to add the game itself on the same panel as the gui? Could in fact the whole game be made with NGUI components and tools?

Would that illiminate the need to convert between screen space and world space?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Ngui as 2d game.
« Reply #1 on: December 04, 2013, 03:17:19 PM »
Could you? Yes, but NGUI was meant for user interfaces, not 2D games. I'd suggest you use the 2D features instead that shipped with 4.3. They're only going to get better in 4.5, and NGUI can use them as well (UI2DSprite).

UncleAcid

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 51
    • View Profile
Re: Ngui as 2d game.
« Reply #2 on: December 04, 2013, 03:28:02 PM »
I have used NGUI solely for full 2D games at this point, I'm interested to see how using Unity 2D with NGUI will compare (hopefully on a not too distant project).

zazery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 26
    • View Profile
Re: Ngui as 2d game.
« Reply #3 on: December 04, 2013, 04:16:18 PM »
I've been using NGUI to create card games and it's worked quite well. I wouldn't use it for a game with a lot of moving/animating sprites though. The main advantage of using NGUI over the new 2D system is it's a unified way to combine sprites, labels (including embedded symbols), and input (UICamera) while reducing drawcalls. This was my thinking before UI2DSprite was added, however a mixture of UILabel and UI2DSprites would create a lot of drawcalls.

Neither system has a good way to adjust the depth a group of sprites such that no sprites can be drawn between them. Pushing a group of sprites to the front or back isn't always what you want, sometimes it needs to be just one depth ahead of another group of sprites. That feature would also be useful for games where the player character is composed of multiple sprites and walks in front or behind other characters.

Lautaro

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 44
    • View Profile
Re: Ngui as 2d game.
« Reply #4 on: December 04, 2013, 04:49:41 PM »
Could you? Yes, but NGUI was meant for user interfaces, not 2D games. I'd suggest you use the 2D features instead that shipped with 4.3. They're only going to get better in 4.5, and NGUI can use them as well (UI2DSprite).

Ok thank you! How about your awesome tools like the Atlas builder and the Ngui events, OnPress, OnDrag, OnDoubbleClick and so on. I guess they can be used?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Ngui as 2d game.
« Reply #5 on: December 04, 2013, 05:27:53 PM »
Yes, of course.