Been awhile since I made that, hmm... let me see?
OK, think I remember, here it goes:
type Struct_Crosshair
iMinrad as integer `the inner radius where the crosshair starts
iMaxrad as integer `the scaled maximun size of the crosshair
iLinelength as integer `the indervidual lengths of the the crosslines
iPosX as integer `position x of crosshair
iPosY as integer `position y of crosshair
fScale as float `scale that added to position x/y
fSpeed as float `the speed at which is scaled
bActive as boolean `if the crosshair is active
bCentrpoint as boolean `to enable/disable the center point of the crosshair
dColor as dword `color of the crosshair
endtype
sync on : sync rate 60
global G_bActorMoveStatus as boolean
Init.Crosshair()
do
if keystate(17)>0 or keystate(31)>0 or keystate(30)>0 or keystate(32)>0
G_bActorMoveStatus = 1 `or true
else
G_bActorMoveStatus = 0
endif
Update.DynCrosshair()
sync
loop
function Init.Crosshair()
global G_DynCrosshair as Struct_Crosshair
`Setup.DynCrosshair()
Setup.DynCrosshair(6,12,4,1.0,1,RGB(255, 0, 0))
endfunction
function Setup.DynCrosshair(iMinRad,iMaxRad,iLinelength,fSpeed as float,bCentrpoint as boolean,dColor as dword)
G_DynCrosshair.iMinrad = iMinRad
G_DynCrosshair.iMaxRad = iMaxRad
`for saftey reasons
if G_DynCrosshair.iMaxRad < G_DynCrosshair.iMinrad
G_DynCrosshair.iMaxRad = G_DynCrosshair.iMinrad
endif
G_DynCrosshair.iLinelength = iLinelength
G_DynCrosshair.iPosX = screen width()/2
G_DynCrosshair.iPosY = screen height()/2
G_DynCrosshair.fSpeed = fSpeed
G_DynCrosshair.bCentrpoint = bCentrpoint
G_DynCrosshair.fScale = G_DynCrosshair.iMinRad
G_DynCrosshair.dColor = dColor
endfunction
function Update.DynCrosshair()
`crosshair increase
if G_bActorMoveStatus = 1
if G_DynCrosshair.fScale < G_DynCrosshair.iMaxRad
inc G_DynCrosshair.fScale , G_DynCrosshair.fSpeed
endif
endif
`crosshair decrease
if G_bActorMoveStatus = 0
if G_DynCrosshair.fScale > G_DynCrosshair.iMinrad
dec G_DynCrosshair.fScale , G_DynCrosshair.fSpeed
endif
endif
`add color to the crosshair
ink G_DynCrosshair.dColor , 0
`center point
if G_DynCrosshair.bCentrpoint = true then dot G_DynCrosshair.iPosX , G_DynCrosshair.iPosY
`left line
lx1 = G_DynCrosshair.iPosX - G_DynCrosshair.fScale - G_DynCrosshair.iLinelength
ly1 = G_DynCrosshair.iPosY
lx2 = G_DynCrosshair.iPosX - G_DynCrosshair.fScale
ly2 = G_DynCrosshair.iPosY
line lx1 , ly1 , lx2 , ly2
`right line
rx1 = ( G_DynCrosshair.iPosX + 0 ) + G_DynCrosshair.fScale
ry1 = G_DynCrosshair.iPosY
rx2 = ( G_DynCrosshair.iPosX + 0 ) + G_DynCrosshair.fScale + G_DynCrosshair.iLinelength
ry2 = G_DynCrosshair.iPosY
line rx1 , ry1 , rx2 , ry2
`up line
ux1 = G_DynCrosshair.iPosX
uy1 = G_DynCrosshair.iPosY - G_DynCrosshair.fScale - G_DynCrosshair.iLinelength
ux2 = G_DynCrosshair.iPosX
uy2 = G_DynCrosshair.iPosY - G_DynCrosshair.fScale
line ux1 , uy1 , ux2 , uy2
`down line
dx1 = G_DynCrosshair.iPosX
dy1 = ( G_DynCrosshair.iPosY + 1 ) + G_DynCrosshair.fScale
dx2 = G_DynCrosshair.iPosX
dy2 = ( G_DynCrosshair.iPosY + 1 ) + G_DynCrosshair.fScale + G_DynCrosshair.iLinelength
line dx1 , dy1 , dx2 , dy2
`reset ink back to white
ink RGB(255,255,255) , 0
endfunction
That should work fine I think, give it a try.
A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.