Hello Guest

Author Topic: Old school game with sprite scaling  (Read 3641 times)

zeteginara

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
Old school game with sprite scaling
« on: February 18, 2014, 04:00:23 am »
So I'm making an old-style game, with 16-bit sprites and such.  The resolution for the SNES was 256x224.  However, obviously, if I made the game that resolution it would be tiny, so I need to scale everything up.  :)

What's the easiest way for 2D toolkit to do this?  I've heard stuff about differing the camera resolution from the native resolution, but I don't quite get it yet.  Can someone explain it to me please?  And thank you.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Old school game with sprite scaling
« Reply #1 on: February 18, 2014, 10:28:28 am »
Set up the tk2dCamera with the native resolution to 256x224. Add a wildcard override, set to fit visible. Your resolution should be stretched to fit the screen. If you want blocky graphics you should probably also set your sprite collections to point filtering.

zeteginara

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Old school game with sprite scaling
« Reply #2 on: March 13, 2014, 03:18:09 am »
So I did this, and set my sprite collections to point filtering.  However, the pixels are uneven.  Is this a limitation of Unity or 2DToolkit? 

I've attached a screenshot.  You can look at the diagonal and see that some pixels are oblong horizontally, and some vertically, and they alternate as such.  My universal pixels per meter is 20 (the default), and I'm not sure if that has something to do with it.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Old school game with sprite scaling
« Reply #3 on: March 13, 2014, 11:57:20 am »
If you're stretching to screen and the multiple isn't perfectly 2x then you'll obviously get non-square pixels. Eg. if you're scaling 2x2 pixels to 3x3, then one of those 2 pixels will need to be doubled. You might want to use one of the pixel perfect modes to avoid that, but you will need to deal with letterboxing the results.