Hmm... This got me interested in the topic, so before I go to bed, I'll post a simple 2D crosshair function here and in the codebase.
It will follow the mouse position, however it could be changed to a different co-ordinate source such as an object's screen position.
sync on : sync rate 60
do
cls
Draw_Crosshair( mouseX(), mouseY(), 25, 25, 15, 15, 15, 2 )
sync
loop
`===================================================== www.binarymodular.com===============================
` x = Left position, y = Top position (Set both as 0, 0 to put in the middle of the screen
` horizontalSize and verticalSize control how far out the lines go from the middle
` horizontalMargin and verticalMargin control how far from the middle the lines start
` circle radius parameters do nothing if set to zero, otherwise a circle will be drawn at that size
function Draw_Crosshair( x, y, horizontalSize, verticalSize, horizontalMargin, verticalMargin, circleRadius1, circleRadius2 )
line x - horizontalMargin, y, x - horizontalSize - horizontalMargin, y : line x + horizontalMargin, y, x + horizontalSize + horizontalMargin, y
line x, y + verticalMargin, x, y + verticalSize + verticalMargin : line x, y - verticalMargin, x, y - verticalSize - verticalMargin
if circleRadius1 : circle x, y, circleRadius1 : endif : if circleRadius2 : circle x, y, circleRadius2 : endif
endfunction