Cocos2d utility functions convertToGL and convertToUI allow for easy conversions between points in the UIKit coordinate system and the OpenGL ES coordinate system. You will use these functions when trying to get the location of a touch event,converting it from UIKit to OpenGL ES coordinates.(UIKit coordinate system has the orign(0,0) at the upper left of the screen)
Images Files
Your characters start out as images on the flash storage of the iphone/ipad.The format of files is typically PNG or JPEG .Once the images are loaded into memory, they are stored in an uncompressed texture format.PNG is the preferred format for images on the IOS devices.
Texture
The image file of your character has to be decompressed and possibly converted into a format that the iphone and ipad GPU can understand and loaded into RAM before it can be used. The loaded image in RAM is referred to as a texture. The GPU can natively handle a few compressed formats such as PVRTC;others have to be stored as uncompression of your images data.This is what OpenGL ES draws on the screen. The decompression of your images is why a PNG image may be small in flash storage but in memory takes up much more as it is stored uncompressed.
(下面的引自 子龙山人)默认情况下,当你在cocos2d里加载一张图片的时候,对于每个像素点使用4个byte来表示——red、green、blue和alpha。这个就简称RGBA8888。
默认像素格式来 加载图片的话,图像宽度(width)* 图像高度(height)*每一个像素的位数(bytes per pixel) = 内存大小
此时,如果有一张512*512的图片,那么当你使用默认的像素格式去加载它的话,将耗512*512*4=1MB