Evening, Im using simplemaps to create a sort of scavanger hunt, where spawners
adds pins to a map for the next location. The spawners are all duped and are
somewhat advanced in the way that they check for a map that has the same pin
location as the location of the spawner.
The problem im having though is that there seems to be a strange offset to the pins.
Even though they're set with a specefic XY, the pin location they recieve get an offset
thats between 5 to 12 points wrong in both XY.
Anyway to combat this?
are you sure that you are looking at the actual pin insertion location and not the location of the pinhead which will be shifted up and to the right by about that much?
I have a spawner that sets the NewPin property.
and the location spawners checks the CurrentPin
ok, it is because of a basic limitation on the way in which pin coordinates are stored on maps in general.
They are stored in map pixel coordinates (actual x,y location on the map itself) rather than in world coordinates (the x,y location that you specify). Because the maps are lower resolution, you lose some precision in placement.
For example, if you put a pin at (200,300) in world coordinates, for a 400x400 pixel map it internally scales it down to (15,29) which is the equivalent location in map coordinates, and stores that as the pin location. When it converts it back up to world coordinates (for example when you check the PinLocation property), it comes back as (191,296).
If you put it at (202,302), it will also come back as (191,296) because of the precision loss.
The loss in precision is a function of the physical map size (Width, Height) with bigger maps = more precision.
I will look at ways of getting around that by maintaining an explicit woordcoord list instead of using the standard map coord conversion system that mapitems use.
hm, a way around it would perhaps to add a attachment to the map with the
correct co-ordinates.
yes, that would also work.