2D Toolkit Forum

2D Toolkit => Support => Topic started by: mutenfuzz on March 21, 2015, 04:48:40 pm

Title: Platform specific x1 and x2 assets
Post by: mutenfuzz on March 21, 2015, 04:48:40 pm
Hi,

I'm trying to get to grips with platform specific collections and how multiple device resolutions are handled, so I've setup a simple project to do some testing. I've created a sprite collection with some placeholder images:

blockA.png  (128x128)
blockB.png  (128x128) <--- x1 SD

blockA@2x.png (256x256) <-- x2 HD

Please note that only blockA.png has a 2x counterpart.

If I select 1x on 2dToolkit->Preferences everything looks as expected. When I select 2x I can see  blockA is now displayed with the higher quality image (2x) while maintaining the same size on screen as before. The problem here is that blockB is no longer the same size as blockA (now it's half its former size). I'm under the assumption that since there's no 2x asset for blockB, TK defaults to the x1 asset. I was expecting blockB to be scaled up automatically though. Is this the expected behaviour? If not, is there any workaround or am I somehow missing the point here?

Of course I would normally supply 2x assets for all my images, so this should not be a concern - it's just that I would like to understand the ins and outs of this stuff.

Thanks!









Title: Re: Platform specific x1 and x2 assets
Post by: unikronsoftware on March 21, 2015, 11:42:25 pm
Hi, that is expected. You're expected to provide 1x and 2x assets, if it doesn't find it it reuses the original texture, but the size will be incorrect as it has scale to compensate for the platform. It should probably not scale it, but I've abused this feature more than once...