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

  • Replies:1
Stephen Kong
  • Forum posts: 17

Jan 30, 2012, 2:30:11 AM via Website

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
Jeremiah
  • Forum posts: 775

Feb 1, 2012, 4:33:30 AM via Website

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