Author Topic: Continuing conversation about 2dtoolkit + ngui on unity forums.  (Read 4851 times)

hexdump

  • Guest
Continuing conversation about 2dtoolkit + ngui on unity forums.
« on: January 21, 2013, 08:56:47 AM »
Hi!,

Sorry for not posting my question here, but I didn't know this forum existed :).

Well, you ansered this on the unity forum:

Quote
Please use the NGUI forum for support: http://www.tasharen.com/forum/index.php?board=1.0

2d toolkit uses raw pixel sizes for transform coordinates, while NGUI uses 2 / Screen.height scaling so that the camera's Orthographic Size remains at 1. Everything underneath the UIRoot in NGUI is in pixels though (as the root is the only thing scaled).


So, is there any solution for easy positioning? I know this is not a ngui problem, but I have a lot of work done with 2dtoolkit and it is really a lot less work to try to adapt ngui to all the work I have done with 2dtoolkit than the other way around.

On the other hand, what about the question about ngui units not fitting 2d toolkit ones? My question was:

Quote
2) At the previous resolution (480x320) if I set the sprite position manually (editing transform component position in the inspector) to -240 it isn't positioned at the correct position. I expect it to be half part in the screen and half outside it (anchor is in the center), but it is positioned around 50-100 pixels from the left border.

Sorry if i'm a bit picky about this, but I really need to have this working as soon as possible :/.

Thanks in advance for your hard work and amazing UI solution.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Continuing conversation about 2dtoolkit + ngui on unity forums.
« Reply #1 on: January 21, 2013, 11:27:59 AM »
You can have the same camera draw both 2D toolkit and NGUI stuff and the two can exist happily side by side. You will want to basically get rid of the NGUI camera and UIRoot.

hexdump

  • Guest
Re: Continuing conversation about 2dtoolkit + ngui on unity forums.
« Reply #2 on: January 21, 2013, 11:50:24 AM »
Hi again!,

THanks a lot for the fast feedback.

If I get rid of this two components wouldn't I lose important functionality like authomatic rescaling for different platforms?.

Thanks in advance.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Continuing conversation about 2dtoolkit + ngui on unity forums.
« Reply #3 on: January 21, 2013, 12:40:45 PM »
You'll lose pixel-perfection, but you will greatly simplify your workflow -- and it sounds like it'll be a worthy tradeoff in this case.