hubx=view_xview[0]+(view_wview[0]/2) huby=view_yview[0]+(view_hview[0]*0.9) angle=-5 dX = x-hubx; dY = y-huby; COS = cos(degtorad(angle)); SIN = -sin(degtorad(angle)); x = (dX*COS-dY*SIN+hubx) y = (dY*COS+dX*SIN+huby)
The problem with this is that if the view moves so does the circle, and therefore it makes the distance and angle change between the point and the circle. I need to find out a way to make the circle stay always 50 pixels (variable "spoke") from the point, and make sure the angle doesn't change.
Update: I found out a way to make the object keep its distance the same using this code:
dist=point_distance(hubx,huby, x,y)
dir=point_direction(hubx,huby, x,y)
if dist<spoke or dist>spoke and dist>0
{
xx=(x-hubx)/dist
yy=(y-huby)/dist
x=hubx + xx * spoke
y=huby + yy * spoke
}
But I still cant keep the angle the same. Please help!












