X

Sign in

Forgotten your password?

... or login with Facebook:

Don't have an AndroidPIT account yet? Sign up
Android Forum » Android Developer Forum » Android Developer Forum » Landscape mode where y = 0 mean the top of the screen??

Landscape mode where y = 0 mean the top of the screen??

Landscape mode where y = 0 mean the top of the screen??
created on Jan 30, 2012 2:30:11 AM
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

I put the above statement in my Activity. But I was surprised to find out that x/y coordinates where y = 0 is actually represent the top of the screen and y = screen height actually represent the bottom of the screen. This is a bit counter-intutive because I throught y = 0 should means the bottom of the screen.

Is this the correct y axis representation in landscape mode, or I might have missed some important setup or coding?
Reply with quote Reply Link ±0     (0 votes)
RE: Landscape mode where y = 0 mean the top of the screen??
created on Feb 1, 2012 4:33:30 AM
Y = 0 is the top of the screen, in landscape or portrait mode. I know its awkward for someone coming from a geometric Cartesian coordinate system, which has 0 at the bottom. But almost all computer language all the way back from GW-Basic have put 0 at the top.
Reply with quote Reply Link ±0     (0 votes)