These are the descriptions from the wiki.
The problem is as I learnt the global coordinate also known as world coordinate is an initial untransformed coordinate, the local coordinate is a transformed coordinate. In a 2D world the global coordinate is usually the window coordinate, so the most top left position is 0, 0 in this coordinate.love.graphics.transformPoint
Converts the given 2D position from global coordinates into screen-space.
Converts the given 2D position from screen-space into global coordinates.
This effectively converts the given position from global coordinates into the local coordinate space of the Transform.
This effectively converts the given position from the local coordinate space of the Transform into global coordinates.
So the transformPoint method is converting a point from local to world. Correct me if I'm wrong.
Code: Select all
local t = love.math.newTransform(100, 100, 10) local globalX, globalY = 0, 0 local localX, localY = t:transformPoint(globalX, globalY) -- Result: 100, 100