Hello Guest

Author Topic: Sprite Size Variation In Resolutions  (Read 4828 times)

largePek

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 18
    • View Profile
Sprite Size Variation In Resolutions
« on: May 15, 2013, 10:35:34 pm »
Hey Guys,

I've got a thin sprite (16x500) with a gradient on it that I'm scaling by a large number on the x axis (55) to use as a scrim. It's flush with another sprite that's not being scaled at all. When I align the stretched sprite with the normal sprite in HD and then play the game it looks great, but when I switch to SD, the stretched sprite overlaps the normal sprite by a few pixels. They both have alpha channels so this overlap is obvious and not very pretty. If I align them in SD, then there's a small gap between the two in HD.

Another thing I noticed was a difference in the gap/overlap size when playing the scene on the PC versus different iOS devices.

I've tried a lot of different things to try figure out what's going on. I've tried changing the resolution of the thin sprite. I tried using a slice sprite instead of just a regular sprite that's scaled. I tried scaling the stretched sprite in different locations (sprite inspector, game object transform, atlas inspector). I've tried playing with padding, trimming, and other atlas settings. Any ideas for how I can fix this problem or what might be wrong?

Happy to provide any extra information if needed.

Any help would be appreciated,
Pek

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite Size Variation In Resolutions
« Reply #1 on: May 15, 2013, 11:02:38 pm »
What is the anchor on the atlas set to?
What size textures is your base resolution in the sprite collection?

The geometry should (will) be identical on PC vs iOS but... the texture could be different. Is your texture being downscaled by Unity on these devices? Is compression on?
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,612.0.html

largePek

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Sprite Size Variation In Resolutions
« Reply #2 on: May 15, 2013, 11:30:23 pm »
Thanks for getting back to me so fast!

Currently the the anchor on the texture in the atlas is "Middle Center". Is there an overall atlas anchor I should be looking for?

The native resolution on the 2dtoolkit camera is 1024x768 and we use "Wildcard Override" set to "Auto Scale = Fit Visible".

I'm not aware of our texture being downscaled by unity on these devices. The atlas setting for "Compression = Uncompressed".

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite Size Variation In Resolutions
« Reply #3 on: May 16, 2013, 09:56:13 am »
If you can, create a repro case for me and send it to support at unikronsoftware.com.
I started typing out a long list of things to check, but it'll be quicker to just do the above.

largePek

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Sprite Size Variation In Resolutions
« Reply #4 on: May 22, 2013, 07:27:59 pm »
OK, the stripping down helped me figure out the problem. Thanks for the suggestion! It turns out, I was flipping between SD and HD at Start instead of Awake. I switch the code to work at Awake and it fixed it.