project 2D to 3D has problem with (full)screen

Started by Darai, October 23, 2014, 09:55:01 AM

Previous topic - Next topic

Darai

SOLVED

Hi guys,

To say this in more words, there is a difference in the result I get from Interact2D.reproject2D3DWS() depending on my screen status (with/without the system lines).

In the case I have full screen with full immersive, the resulting vector hits precisely under my touch
In the case I have the system trail and buttons visible, the result is like 5mm down (+y)  from the actual touch point

Do you have the same problem? How do you deal with it?

Thanks for all the help,
Darai.

The solution: Something I found on stackowerflow.com

public int getStatusBarHeight() {
            int result = 0;
            int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
            if (resourceId > 0) {
                result = getResources().getDimensionPixelSize(resourceId);
            }
            return result;
        }

Extracts the statusbar height from the applet R file.

EgonOlsen

That's because touch- and frame buffer coordinates don't match in that case (the frame buffer always starts at the top but the touch coordinates start below the top elements). You have to take the size of these overlapping areas into account. There are some methods in Android to get those, but i can't remember them ATM. We also had this topic a few times in the forum, maybe you can find something here too.

Darai

Thanks,

I tried to find relevant topics, but had no luck yet... since now I know it is here somewhere I'll try again and more thoroughly.

EgonOlsen

I had the same problem...otherwise i had posted the relevant link. But it has to be here somewhere...if you can't find it, Google for something like Android title insets or similar.

Darai

I found it....

it is following link:
http://www.jpct.net/forum2/index.php/topic,95.msg324.html#msg324

And the short message is: Insets is = wind.getInsets(); where wind is I expet the view or frame or something like that and the Insets object than contains the required values.