Game Development Community

Units in TXB?

by Ryan Miller · in Torque X 2D · 02/19/2008 (2:54 pm) · 2 replies

I'm working with some pixel art and having trouble with it in TXB. It seems that one TXB unit is 8 or 10 pixels? I'm trying to work with 16x16 tiles, but the tile size parameter of a tilemap only seems to allow whole numbers.

#1
02/19/2008 (4:02 pm)
The pixel-world unit equivalent in TXB will change depending on the size of the camera and the resolution of your game. The default camera is 100 world units wide by 75 world units tall. A resolution of 1024 by 768 will result in 1024 pixels spread across 100 world units and 768 pixels spread out across 75 world units.

Thus, 1024 pixels divided by 100 world units will result with 10.24 pixels per world unit. Therefore, you can adjust the resolution to perhaps get a better ratio of pixels to world units.

if you used 800x600 resolution, then that would mean:

X pixels per world unit = (800/100) => 8
Y pixels per world unit = (600/75) => 8

Using 800x600 would give you a nice solid 2 world units by 2 world units for your tile layers.

Hope this helps.
#2
02/19/2008 (4:04 pm)
It does, thanks!