Look at this.
gui.register( function()
camX = memory.readword(0xffee00) -- x position of the camera
camY = memory.readword(0xffee04) -- y position of the camera
p1x = memory.readwordunsigned(0xffb008) -- x position of sonic
p1y = memory.readwordunsigned(0xffb00c) -- y position of sonic
p2x = memory.readwordunsigned(0xffb048) -- x position of tails
p2y = memory.readwordunsigned(0xffb04c) -- y position of tails
xposvisual1 = p1x - camX
yposvisual1 = p1y - camY
xposvisual2 = p2x - camX
yposvisual2 = p2y - camY
gui.box(xposvisual1 - 16, yposvisual1 - 16, xposvisual1 + 16, yposvisual1 + 16, {0, 0, 255, 128}, "blue")
gui.box(xposvisual2 - 16, yposvisual2 - 16, xposvisual2 + 16, yposvisual2 + 16, {255, 127, 0, 128}, {255, 127, 0})
gui.line(xposvisual1, yposvisual1, xposvisual2, yposvisual2 , "white")
x = math.abs(xposvisual2 - xposvisual1)
y = math.abs(yposvisual2 - yposvisual1)
distance = (x^2+y^2)^(1/2)
message = string.format("%d px.", distance)
gui.text(xposvisual1 - 10, yposvisual1 - 25, message, "white", "black")
end)
It is a small LUA I wrote that has the function of: Highlight Sonic with a blue square and with an orange to Tails. They are united with a white line, on to Sonic is written the distance (in pixels) between Sonic and Tails.