Here is a function I've just added to position lense flare using four images (provided).
It uses sparky's collision for ray casting but could be edited easily for other systems.
function flare(Sprite1,Sprite2,Sprite3,Sprite4,Sun)
`check if visible
SW=screen width()
SH=screen height()
camx#=camera position x()
camy#=camera position y()
camz#=camera position z()
objx#=object position x(Sun)
objy#=object position y(Sun)
objz#=object position z(Sun)
sx=object screen x(Sun)
sy=object screen y(Sun)
visible = SC_rayCast(0, camx#,camy#,camz#, objx#,objy#,objz#, 0)
`show/hide flare
if visible = Sun
`check "sun" position
inscreen = OBJECT IN SCREEN(Sun)
if sx>=0 and sy>=0 and sx<=SW and sy<=SH and inscreen = 1
paste sprite Sprite1, sx-64, sy-64
paste sprite Sprite2, SW-sx-64, SH-sy-64
paste sprite Sprite3, ((SW/2-sx)/4+SW/2)-32,((SH/2-sy)/4+SH/2)-32
paste sprite Sprite4, (-(SW/2-sx)/2+SW/2)-32,(-(SH/2-sy)/2+SH/2)-32
endif
endif
endfunction