MouseEvents and ApplicationDPI

Software: Away3D 4.x

Sandra, Newbie
Posted: 12 September 2012 11:27 AM   Total Posts: 3

We’ve got a quite annoying issue with mouse events in a mobile flex project. The application has a fixed applicationDPI-setting of 160 and the problem occurs on all devices that have a screenDPI other than 160.

Example (see image):
We’ve got a phone with 320 dpi and a full resolution of 1280 * 800. If we’ve got a view3D that is 640*400, it fills half of the screen and is positioned in the upper left corner. Everything as expected. We want to listen on click events on the red object, which is rendered in the center of the view (green circle), but to trigger such events, we need to actually click right into the center of the screen (red circle).
Thus, it seems that although the view is rendered according to the screen’s dpi of 320, mouse event coordinates are handled according to the set applicationDPI of 160.

We resolved this issue for now by scaling the coordinates used for picking in Mouse3DManager using a factor derived from screenDPI/applicationDPI, but maybe there is a smarter (and maybe too obvious) solution?

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X