i want to make a app wich should run on a phone and on tablets.
I have a canvas with shows the World. In this canvas are many image sprites witch show the player color who leads in this land.
On the first step i size the canvas with pixels. It works fine on phone. But on Tablet its to small.
On the next step i change the canvas with percent. Now the canvas on phone and tablet is ok, but now the image sprite are not on the right position.
How can i fixed this problem?
Thanks for help
--
Store your pre-cooked sprite locations as fractions of canvas height and width,
--
and multiply by actual canvas height and width when it's time to position the
sprites on the canvas.
Hi Abraham,
--
thats perfect.
Its a good thing to zoom the canvas and sprites.
Is it possible to ask/read the phone or tablet what the size is, so i can zoom automatic?
Is it possible to ask/read the phone or tablet what the size is, so i can zoom automatic?If you left your canvas visible when you packaged the app, the height and width attributes should be available in the Screen.Initialize event, or soon after.
thanks a lot
--
댓글 없음:
댓글 쓰기