The x and y parameters must be of one of the collision points of the game entity in world space, not in screen space. The number and distribution of collision points depends on gameplay design, it's not a Tilengine specific issue. Screen space depends on layer position set with TLN_SetLayerPosition(), whereas world space is absolute and is where actual gameplay occurs.
If you need per-pixel accurate height -used for example in Sonic irregular terrain-, TLN_TileInfo struct contains xoffset and yoffset members (collision point inside the tile) that you can use to look-up into a heightmap for the given tile id. This is however an advanced topic that shouldn't be atempted unless basic gameplay mechanics are working.
Check out this thread, another user was requesting for a similar question that may help:
http://tilengine.org/forum/showthread.php?tid=536
If you need per-pixel accurate height -used for example in Sonic irregular terrain-, TLN_TileInfo struct contains xoffset and yoffset members (collision point inside the tile) that you can use to look-up into a heightmap for the given tile id. This is however an advanced topic that shouldn't be atempted unless basic gameplay mechanics are working.
Check out this thread, another user was requesting for a similar question that may help:
http://tilengine.org/forum/showthread.php?tid=536