blackfire553
2011-07-01 15:19:21
My problem is that when i convert a tile of a TGroundItem to mainscreen coordinates, it is never accurate. When i do not use offsets, it is typically a little bit to the lower right of the item. Using offsets in the x and y for the Mouse function makes it more accurate, but i feel this is a temporary solution for a larger problem.
The code i use is this:
I want to be able to convert the MS point back into a tile to get the item again and check the ID, but it doesnt work because i cant get the proper coordinates anyways.
Another thing i noticed is that the ItemsOnGround[j].height is usually between -800 and -900.
The code i use is this:
ItemsOnGround := GetItemsNear(Players[CurrentPlayer].Integers[0]);
For j := 0 to high(ItemsOnGround) do
begin
ItemPoints[j] := TileToMS(ItemsOnGround[j].Tile,0)
end;
SortTPAFrom(ItemPoints,GetMyPos);
Mouse(ItemPoints[i].x, ItemPoints[i].y, 0, 0, false); I want to be able to convert the MS point back into a tile to get the item again and check the ID, but it doesnt work because i cant get the proper coordinates anyways.
Another thing i noticed is that the ItemsOnGround[j].height is usually between -800 and -900.