There is a problem with scale9 sprites and logical xN resolution. Imagine I have a 30x30 pixels sprite that I would like to use as scale9 sprite with 10 pixel margins from all sides. I lay everything out in 1x resolution, which results in 4 corner images of 10x10 pixels which won’t be scaled in any direction.
Now for x2 and x3 resolutions I assumed I will simply create 60x60 and 90x90 versions of the image, like I do with regular images, and will use 20 and 30 pixel margins for them correspondingly. Unfortunately, that doesn’t seem to work: when cocos finds my x3 version of the image, it doesn’t scale down 30x30 corners to fit them into 10x10 points of the x1 design resolution - it keeps them as 30x30, which consequentially makes the smallest corner side it can do - 30x30. The alternative, of course, would be not to have x2 and x3 versions of the sprite at all and only use x1 version, however, that means I will have to use lower resolution corners on higher resolution devices:
x-x |#| - x1 resolution x-x xxx---xxx xxx---xxx xxx---xxx |||###||| |||###||| - x3 resolution |||###||| xxx---xxx xxx---xxx xxx---xxx
Parts represented by x don’t scale in any direction by scale9 processing, however, there are 9 times more pixels on x3 in their spot than there is on the design resolution x1.
How can I provide a higher resolution equivalents of the scale9 images that would still behave correctly with respect to the x1 design resolution?