2D Toolkit Forum

2D Toolkit => Support => Topic started by: hexdump on March 18, 2014, 12:52:00 pm

Title: Do you work in units or pixels with tk2dToolkit?
Post by: hexdump on March 18, 2014, 12:52:00 pm
Hi,

I start this pool because I would like to know how you work with 2dtoolkit in unity and why. Do you setup your cam to let a unit/meter be a pixel? Or do you directly work with units (2dtoolkit default is 20 pixels=1 unit). I found more suitable to use pixels because it is more understable to me. Things like positioning something at this x,y pos in pixels is much better than converting x,y to units based on 2dtoolkit configuration. What do you use? Have you found any problem working with units?

On the other hand has anybody found any problem working with the physic engine in pixels?

Let's vote!
Title: Re: Do you work in units or pixels with tk2dToolkit?
Post by: Finnegan on March 19, 2014, 09:05:48 am
Pixels, because we have many complex menus and lots of animations with pixel-perfect positioning. Also supporting many platforms and resolutions using points will be kind of hard.
Title: Re: Do you work in units or pixels with tk2dToolkit?
Post by: fsadeq on March 19, 2014, 02:34:06 pm
Used to work in 1:1, but recently switched to a different scale. Mainly because it was getting completely absurd working with giant numbers. Keeping GUIs/menus as 1:1, though.
Title: Re: Do you work in units or pixels with tk2dToolkit?
Post by: griden on March 21, 2014, 12:40:13 pm
You'll probably find out that mapping 1 pixel to 1 meter leads to some unexpected behaviour from the 2D Physics system - how gravity affects rigidbodies for example. I think this originates from the fact that Box2D uses meters and the docs recommend setting a ratio that corresponds to your game object sizes -> http://box2d.org/2011/12/pixels/ (http://box2d.org/2011/12/pixels/).