Hello Guest

Author Topic: Sizing sprites to align with 1 'unity unit'  (Read 3882 times)

dogboydog

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
    • My website
Sizing sprites to align with 1 'unity unit'
« on: March 07, 2014, 08:42:42 pm »
Hi,

I'm starting a new project and trying to set it up to make the code simpler. It's going to be a puzzle game with a grid system, and I'd really like it if I could find a way to line up square sprites to take up 1x1 units of length. I know it'll be a combination of setting the ortho size of a sprite collection and the pixel size of the original sprite files, but I'm not sure how I can easily line the two up. Is there some kind of formula/principle that tells me how to do this?


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sizing sprites to align with 1 'unity unit'
« Reply #1 on: March 08, 2014, 01:42:15 pm »
check how many pixels are in your puzzle piece, then set up pixels per meter to be the dimensions of the texture. EG. if your tile is 32x32 pixels in size, set pixels per meter to 32. 1 world unit will be 1 tile size exactly.

dogboydog

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
    • My website
Re: Sizing sprites to align with 1 'unity unit'
« Reply #2 on: March 08, 2014, 06:52:29 pm »
Thanks a lot. For some reason  I missed that option.