I design everything for 480x320 and then use scaling factors to work
on larger and smaller screens.

I like to use Y to determine the scale since X tends to be shorter and
longer depending on screen.

Assuming you're in landscape orientation:

float scale2d = viewportWidth / 320f;

That results in a scale of:

480x320 = 1.0
800x480 = 1.5
854x480 = 1.5
320x240 = 0.75

All 2D measurements (like being offset by 10 from the left) are
multiplied by the scale (so for instance, 1.5 on the droid/n1/evo) to
get the actual pixels.  This works great for things like the HUD, but
does not work correctly for actual gameplay areas.  For those, I set
the projection to fit the screen and just let things distort.  It's
the only way I've found to have a consistent gameplay experience
across all screen densities and aspect ratios.  Some people maintain
aspect ratio for the game and change how much you can view.  So long
as all of the important stuff is in view on the smallest screen and
you don't get a huge advantage to having more in view on the large,
wide screens, I wouldn't see a problem with that.

On Jun 26, 12:38 pm, General1337 <[email protected]> wrote:
> Hello,
> We're looking for a method to properly scale our textures and world.
> The current method we're using is having an arbitrary world unit which
> calculates the screen resolution and receives the size of a pixel on
> all resolutions. However is there an easier way of implementing a
> scaling method for game development? We have looked through dip and
> other android native elements but these don't work as well for a
> larger scale on game dev.
> Thanks!

-- 
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

Reply via email to