Sprite size and resolution

Sprite size and resolution
0.0 0

#1

Hi there!
I;m trying to understand the difference between resolution and sprite size. For example, I created an image 1000X1000 px and load this image to the project as sprite (this is background for playing field).
I’m using Size designResolutionSize = cocos2d::Size(1000, 1000) but my image too small.
How can i fix it?


#2

Hi, a very “simple” answer just for clarification, is assume you have a device with resolution 1000X1000,
and your designResolutionSize is 500X500,
and your sprite image size is 100X100.
then you “see” your sprite in 200X200.
(size of sprite you see= size of sprite in real image * deviceResolution / designResolutionSize)


#3

Thanks for your answer! And how i can calculate the coords of the playing field??? If background sprite 1000X1000 px and playing chips 100X100 (i have 10 playing chips in row). How can i move this chips correctly?


#4

Your sprite movement based on design resolution ( not sprite real size on pixels). That means if your design resolution is 500X500 then set position of sprite to 250 , 250. Now your sprite is in the middle of screen.


#5

Thank you so much!!!