Animated Guide to Asset Scaling and Multi-Resolution using Cocos2d-x

Animated Guide to Asset Scaling and Multi-Resolution using Cocos2d-x
0

I wrote an animated guide to do proper asset scaling and multi-resolution in Cocos2d-x. I am hoping it to be very clear on how to approach the problem, and how to solve it. After the post, a Cocos2d-x user reminded me this is one of the most discussed topics on the forum. So I decided I should post it here.

http://blog.6x13.com/2d-asset-scaling-resolution/

We, as 6x13 Games, released 4 mobile titles using the described method, and I know many others use similar approach. So, do not hesitate to use it in production. Good luck!

5 Likes

Awesome, would you mind if I use any details to update our documentation?

Not at all. As long as proper credit given to the original source, I am all for seeing the Cocos2d-x docs improved.

I also wrote a new post for people trying to deal with multiple resolutions:

http://blog.6x13.com/multi-resolution-asset-automation/

It mostly concentrates on an Inkscape extension to automate the multi-resolution export.

1 Like

Hi,

Great post.

What is difference between ResolutionPolicy::SHOW_ALL and condition: “condition ? ResolutionPolicy::FIXED_WIDTH : ResolutionPolicy::FIXED_HEIGHT”.
For me it seem it will be exactly the same.

glview->setDesignResolutionSize(
 x13_data.gfx.safe.x,
 x13_data.gfx.safe.y,
 ( 1.5f > ( frame_size.width / frame_size.height ) )
  ? ResolutionPolicy::FIXED_WIDTH
  : ResolutionPolicy::FIXED_HEIGHT );

Regards,
Chp

Thank you!

The difference will present itself if you check out the implementation of GLView::updateDesignResolutionSize().

The FIXED_HEIGHT and FIXED_WIDTH policies each recalculate design resolution accordingly. SHOW_ALL does not. Therefore, you will see black border due to clipping with SHOW_ALL, while you will see beautiful art in above version. :slight_smile:

You are absolutely right that scaling is exactly the same, though the outcome will still be different.

@6x13, the website can not be visited? I am blocked.

1 Like

Sorry for that. I am leaving the current hosting service. I will move the blog to a github page solution in a week or so. :slight_smile:

:wink: thank you ~

If someone is interested into this topic (and the new blog isn’t available), you can find the original post in the internet archive.