Hello Guest

Author Topic: platform specific compression swap  (Read 4623 times)

sebastian

  • Newbie
  • *
  • Posts: 17
    • View Profile
platform specific compression swap
« on: August 20, 2014, 08:47:25 pm »
Hi Unikron--

Thanks agin for your awesome toolset.  Apologies for my latest string of questions-- I'm implementing platforms and want to make sure I get it right.

I've had success implementing @2x and @1x platform sprites starting with a @4x default.  However I have some sprite sets where the quality is just too poor to use smaller sprites.  I had a thought that maybe I could use the same sized artwork for my @2x and @1x platform sets, but then change the compression setting of the atlas texture afterwards to still get some platform specific mb savings.

When I tried this, the @2x and @1x sprites were out of alignment in gameplay.  It seems that tk2d is automatically resizing/reposition platform sprites even if the artwork is actually the same size?

If this is the case, is there a way to accomplish what I'm trying to do-- have an identically sized atlas for a different platform that is just set to a different compression setting?

The goal would be to load the platform specific compressed atlas at startup to save on mb for those older devices.

Thanks for any thoughts!
Sebastian

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: platform specific compression swap
« Reply #1 on: August 21, 2014, 06:02:53 pm »
1x, 2x and 4x need to be that ratio in size. The hint is in the names...

If you want to add more platforms - its officially unsuported, but you can do so in tk2dSystem.cs,
Code: [Select]
public tk2dAssetPlatform[] assetPlatforms = new tk2dAssetPlatform[] {
new tk2dAssetPlatform("1x", 1.0f),
new tk2dAssetPlatform("2x", 2.0f),
new tk2dAssetPlatform("4x", 4.0f),
};
Add another 2x_NoCompression or something like that. The 2.0f refers to the relative scale, so 2x_NoCompression should be 2.0f.

sebastian

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: platform specific compression swap
« Reply #2 on: August 21, 2014, 06:15:33 pm »
Okay thank you-- that is definitely helpful!

That is the only place where the scale is set at a master level, correct?

I had been wrestling with the idea of trying to make all my sprites start with default @1x when I currently have everything sized properly to start with @4x.

However seeing this, it seems I could keep all my sprite scaling in my game, replace my tk2d default sprites with the @1x assets, and then make the scale of the @1x .25f for instance.  Then @2x would be .5f and @4x would be @1f.

You think that could work to swap @1x and @4x default sprites?

Thank you!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: platform specific compression swap
« Reply #3 on: August 21, 2014, 08:00:02 pm »
It probably will work, but if you run into issues you're on your own - this isn't officially supported :)
I wouldn't use 0.25 / 0.5, etc. Keep it in whole numbers - the numbers are relative.