I want to create a 2d games on Unity (like Doodle jump) but I don't how I can resize the screen (camera and sprite) for all resolution.
Thanks you in advance.
You need to stretch sprites dynamically depending on the resolution (width and height)
This information you can get from Screen
Imagine you have resolution 1024x768, for these resolution you created sprite 256x128 which looks good, however if you would run it on device with higher resolution - your sprite would looks to small so you need to stretch it proportionally to the new resolution
Here is how I would solve this problem:
imagine resolution 1024x768 = 100% and 256x128 = 100%
If resolution jump to 1280x800 we need to find on how many % it did increase
lets take width for a start:
1024 = 100%
1% = 1024 / 100 = 10.24
1280 / 10.24 (or 1%) = 125%
125% - 100% = 25%
So we need to re-size our sprite width on 25%
in the same way you find % for sprite:
256 = 100%
1% = 256 / 100 = 2.56
2.56 (or 1%) * 25 = 64
125% = 256 + 64 = 280 - this is new width
Repeat the same for the height, or you can find proportion for height depending on sprite size.
Note: Sprite quality might be reduced if you stretch it or shrink it too much, use vector graphic for your sprites.