Search code examples
javajava-2dcoordinate

Change coordinates to bottom left corner


How can I change coordinates to bottom left corner?

I know that's in Java the coordinates begin from Top=Left corner, but I'm asking if can someone help me how can I change it to begin (0,0) coordinates from Bottom-Left corner?


Solution

  • getHeight() will get you the size height. so (0, getHeight()) will give you the left-bottom point. But take into consideration the height of the object you want to place. So you may want to use

    (0, getHeight() - heightOfObject)