Hello,
I tracked the behaviour of the different screen sizes when I increased
the position of a graphic by 10 pixel. Unfortunately happened what I
already thought. When the display is bigger, I'm able move a graphic a
lot of times more to get to the bottom of the screen. So the ratio
between the graphic and its environment is not correct anymore (so not
10 pixel as on normal screen) although the change of the graphic on
the different screens looks correct (On big screen it is bigger, on
small screens it is smaller). When I move the graphic from the top of
the screen to the bottom, I can move that on 480x800 about 65 times,
on 480x854 70 times, and on the 320x480 screen only about 25 times. So
the target must be to calculate the right ratio so that 10 pixels on
the small screen are 17 pixel (or sth. similar) on big screens. What
approaches do I have to do that? I already thought about getting the
value of res.getConfiguration().screenLayout to know if I have a
small, normal, or big size to be able to calculate anyhow the right
ratio, but this both seems to be pretty cumbersome and moreover I get
values from res.getConfiguration().screenLayout I can't explain. I
launched 6 emulator instances and got the following values from
res.getConfiguration().screenLayout:

240x320 QVGA low density: 17
320x480 HVGA medium density: 18
480x854 WVGA high density: 34
480x800 WVGA high density: 34
240x400 WQVGA low density: 34
240x432 WQVGA low density: 266435490 (yes, I really get this value!)

This approach seems to be useless because I cannot even distinguish
between 480x854 and 480x800, much less of the last value which seems
to be corrupt.

How can I solve it to move a graphic on the different screens with the
right ratio? How do game developers solve this when they support all
screens?


Regards.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to