Cocos2d-iphone tips/tricks/notes

I keep reading things that I want to remember later and so I’m going to use this page to save them.

• Textures & sprites and padding to avoid gaps between and jaggies on edges.

Info here and here:

There are two primary issues.

  1. If you are using a tilemap, then you want the tiles to flow through to each other with no gaps.
    –> Solution is to double the outer row of pixels in your image, all the way around.
  2. if you have a free floating sprite that is rotated, then the lack of edge aliasing on iPhone.
    –> Solution is to put a row of transparent pixels as the outside edge of the texture content inside the texture rectangle, then double that on the outside if you are rotating them next to others.

Note that if you are using mip-maping you may need more than one row of padding (either outside or inside).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: