MonoGame / MonoGame

One framework for creating powerful cross-platform games.
http://www.monogame.net
Other
11.3k stars 2.9k forks source link

Android clip rectangle position is off #2429

Open profK opened 10 years ago

profK commented 10 years ago

Clip rectangle in Android comes up in the wrong place. My experience say that its 20 pixels too far to the left on a 10" android screen. I haven't tested yet to see if its relative to screen pixel size.

Here's an example of my code running on OSX: screen shot 2014-04-25 at 12 37 14 pm

And here is the exact same code running on Android 4.3, 10" WXGA screen shot 2014-04-25 at 12 36 50 pm

tomspilman commented 10 years ago

I can't say I've seen this before.

The aspect ratio of those screens are very different. Also i see more than just clipping issues there... like placement for rendering is off completely.

profK commented 10 years ago

Hi Tom,

I think you are misinterpreting the images.

Both the images and the text in that demo drag freely. The clip is supposed to cut off the image just before the blue frame, and the text just before the value frame.

Look at the OSX image and compare, they really are pixel identical except for the clip.

My fudging the clip over by +20 in the X direction on Android makes them look the same.

I can post an image of that if you like.

JK

On Sat, Apr 26, 2014 at 3:09 PM, Tom Spilman notifications@github.comwrote:

I can't say I've seen this before.

The aspect ratio of those screens are very different. Also i see more than just clipping issues there... like placement for rendering is off completely.

— Reply to this email directly or view it on GitHubhttps://github.com/mono/MonoGame/issues/2429#issuecomment-41477766 .

It's always darkest just before you are eaten by a grue.

profK commented 10 years ago

I should say pixel identical give or take some slop in the scroll positions, since I draggers both manually.

On Sat, Apr 26, 2014 at 4:32 PM, Jeffrey Kesselman jeffpk@gmail.com wrote:

Hi Tom,

I think you are misinterpreting the images.

Both the images and the text in that demo drag freely. The clip is supposed to cut off the image just before the blue frame, and the text just before the value frame.

Look at the OSX image and compare, they really are pixel identical except for the clip.

My fudging the clip over by +20 in the X direction on Android makes them look the same.

I can post an image of that if you like.

JK

On Sat, Apr 26, 2014 at 3:09 PM, Tom Spilman notifications@github.comwrote:

I can't say I've seen this before.

The aspect ratio of those screens are very different. Also i see more than just clipping issues there... like placement for rendering is off completely.

— Reply to this email directly or view it on GitHubhttps://github.com/mono/MonoGame/issues/2429#issuecomment-41477766 .

It's always darkest just before you are eaten by a grue.

It's always darkest just before you are eaten by a grue.

profK commented 10 years ago

Here's the android image with the clip rectangle fudged by +20 in X.

Its perfect. Everything else is positioned exactly right.

screen shot 2014-04-26 at 4 42 16 pm

tomspilman commented 10 years ago

Probably not the issue, but if you swap the X/Y cords in the clip rectangle do things work?

profK commented 10 years ago

Good guess but no. It messes up in other ways and worse.

(I tried both just swapping the position, and swapping the position and the width/height but neither worked)

tomspilman commented 10 years ago

I wonder if the clip isn't relative to the viewport.

danzel commented 10 years ago

Have you tried disabling the title bar? http://stackoverflow.com/questions/2862528/how-to-hide-app-title-in-android

danzel commented 10 years ago

See the bottom of #1748 - There are some mentions of scissor and android there (not sure if that is the same thing, but sounds like it).

profK commented 10 years ago

yup its the same issue, it sounds like.

danzel commented 10 years ago

Did the change mentioned in #1748 fix this for you @profK? (Changing a line in OpenTKGameWindow)

profK commented 10 years ago

I fudged it rather then hang to mess with and rebuild Monogame. Haven't had time to try hacking MG...

On Mon, May 5, 2014 at 1:59 AM, Dave Leaver notifications@github.comwrote:

Did the change mentioned in #1748https://github.com/mono/MonoGame/issues/1748fix this for you @profK https://github.com/profK? (Changing a line in OpenTKGameWindow)

— Reply to this email directly or view it on GitHubhttps://github.com/mono/MonoGame/issues/2429#issuecomment-42160917 .

It's always darkest just before you are eaten by a grue.

danzel commented 10 years ago

I made up a small test case for this and well, it was really broken. Its not off by 20px, its copying part of the menu bar for some reason! https://github.com/danzel/WrapTest/tree/scissor-test

I'll come back to this at the weekend if I get some time.

profK commented 10 years ago

Thanks Dave

On Tue, May 6, 2014 at 6:14 AM, Dave Leaver notifications@github.comwrote:

I made up a small test case for this and well, it was really broken. Its not off by 20px, its copying part of the menu bar for some reason! https://github.com/danzel/WrapTest/tree/scissor-test

I'll come back to this at the weekend if I get some time.

— Reply to this email directly or view it on GitHubhttps://github.com/mono/MonoGame/issues/2429#issuecomment-42285670 .

It's always darkest just before you are eaten by a grue.