How would you properly size sprites?

How would you properly size sprites?
0

Basically, how do i properly size a sprite with pixel sizes so like (16,16) in pixels or (32,32) instead of having to scale the sprite?

You need to think about your design resolution. I always tend to scale mine based upon my own math.

Not sure the real question here, it can be interpreted a few ways.

If you mean the asset itself: use some image editing software like Photoshop, Gimp, etc.
If you mean in game: scale the asset uniformly to the desired size…
For example (assuming a content scale factor of 1):
Desired size = 32x32 pixels.

sprite->setScale(32.0f/sprite->getContentSize().height));
Be sure to use contentSize and not BoundingBox size, as bounding box is relative not absolute.

If you mean to resize the image itself, you can find some more info around the forum probably.
It would probably go somewhat as: create a render texture, scale the original content to desired size (using the methodology shown above), get the sprite from the render texture…

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Yes this was exactly what i was looking for, Thanks!