Hello Guest

Author Topic: Platform support at multiple resolutions and sprite size  (Read 4622 times)

ortolan

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Platform support at multiple resolutions and sprite size
« on: January 15, 2015, 10:15:39 pm »
Hi,

I've been a user of 2D toolkit for a while, but only now am I playing around with it's support for devices at different resolutions. But I've run into a simple issue which makes me think I've missed something when it comes to creating artwork at 1x 2x and 4x resolutions and the way they affect the look of sprites.

I'm trying to create a puzzle with tiles(sprites) next to one another, these will be clicked on to move the tiles or link to other scenes. However my sprites are increasing in size and overlapping when I change the 'platform' to 2x or 4x in the 2d toolkit prefs. Do I have to change their position via coding if the device is 2x 4x?

I've gone through the manual here; http://www.2dtoolkit.com/docs/latest/advanced/platform_specific_sprite_collections.html
and have setup my sprites and scene with a base resolution at 1x (480 x 320) and added support for 2x (1024 x 768), and 4x (2458 x 1536).
This works OK for one large background image.

My initial setup at 1x with some tiles selected;




What happens when I change the setting to 2x in toolkit prefs;



How my little test scene is setup in hierarchy;


the sprite collection settings;



2d Toolkit camera setup;


2d Toolkit camera overrides;


So what am I doing wrong? Is it to do with the sprites themselves not in pro? Am I going to have to code each position for each sprite so they do not overlap?

I'm using 2D toolkit 2.4.0 and Unity3D 4.5.4

Hope someone can help.


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Platform support at multiple resolutions and sprite size
« Reply #1 on: January 16, 2015, 01:56:36 pm »
As the names suggest, a 2x texture should be 2x the size of a 1x one, and a 4x one should be 4x the size of the 1x texture. This isn't the case in your textures, you've pretty much picked random sizes for your images. This isn't going to work unless you use images with the correct size.

1x (480 x 320) and added support for 2x (1024 x 768), and 4x (2458 x 1536).

ortolan

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Platform support at multiple resolutions and sprite size
« Reply #2 on: January 16, 2015, 08:40:12 pm »
Hi,

Many thanks for the prompt reply.

Yes were right the images should have been multiples. I've now amended my test scenes and everything works really well.

As a ref. for anyone else I chose to go with the following 3 resolutions (the coloured boxes are the corners of the screen which are anchored within the 2d toolkit camera, just to use as a ref. for GUI etc);


1x 512x384;


2x 1024 x 768;


4x 2048 x 1536



Many thanks for your help.