understanding image size in screen size ,

understanding image size in screen size ,
0.0 0


i have basic misunderstanding i guess on screen and images sizes for example:
i working on windows and set the screen size in main.cpp to eglView~~>setFrameSize;
to test iPhone resolution.
now i have 35X35 pixels size CCSprite and i want it to be placed 10 pixels from the right
so i set where gemSize is the CCSprite 35X35 pixels size CCSprite image:
Gem *thisGem = new Gem;
int leftPadding = 10 ;
int topPadding = 90;
float x = leftPadding ;
float y = topPadding ;

now the Gem CCSprite is positioned not 10 units to the left . only when i set the leftPadding to 30 , it move ( and i don’t know how mach to the right ) so what is this size unit if not pixels ?


you need to that eglView->setFrameSize(320,480) is just the size of window frame on PC-build. and it has nothing in common with the size in points (units) of your ingame frame, which is usually been set with CCEGLView::sharedOpenGLView()->setDesignResolutionSize(). read about this last meethod in cocos doc’s. also as you test your build on PC you need to know about CCDirector::sharedDirector()->setContentScaleFactor() mechanism.

hope this helps.