pixelScale?

Richard Gaskin ambassador at fourthworld.com
Sat Sep 29 09:45:47 EDT 2012


Monte Goulding wrote:

 > Google assumes we are all working in java where the density is
 > abstracted into 4 common plus a couple of less common density groups.
 > LiveCode doesn't do that abstraction for us so we get the actual
 > pixels on screen.
 >
 > The DisplayMetrics class has a density property which gives you the
 > abstracted density that a java dev might want. However it also has
 > xdpi and ydpi if you need it (which we do).

I don't think the usefulness of accurate screen metrics is specific to 
any given language.

Instead it seems that offering both pixel-accurate density and more 
general categories of density simply allows developers to choose 
different ways of solving layout issues.

If all we had were those categories, our layouts could be "good enough".

If we had pixel-accurate density, our layouts could be "close to 
perfect" (well, at least in proportion to the level of effort we're 
willing to put into to take advantage of it).

But the absence of either seems mystifying to me, since the diversity of 
devices makes it essential.

And given the reams of posts here on the subject this was especially 
mystifying:

 > Is it in as a feature request?

I submitted this in March of this year:
<http://quality.runrev.com/show_bug.cgi?id=10121>

How did we get almost two years into Android development without this?

The page you linked to provides everything RunRev needs to add a wrapper 
around those structures so we can get, at a minimum, the xdpi and ydpi 
of any device:

<http://developer.android.com/reference/android/util/DisplayMetrics.html>

If they want to go further to provide an array containing all of the 
values there that might also be useful, but the pixel density is so 
absolutely essential to Android development - and becoming so on other 
platforms like Win8, Mac, and iOS - that it seems reasonable to expect 
that the relatively modest effort needed to provide this at least for 
Android where it's most critical would be done in the very next release.

If there's some technical reason this is especially difficult to provide 
that I'm overlooking, or some other means of deriving this metrics info 
already provided in the engine that we've all overlooked, it would be 
helpful to have guidance from the mother ship.

But as it is, given the number of posts here and in the forums on this 
the scope of the need seems self-evident, and the API seems straightforward.

What am I not understanding?

--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  Follow me on Twitter:  http://twitter.com/FourthWorldSys




More information about the use-livecode mailing list