Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sin cos using SUB SumLocate (x,y,l)
#4
probably want to use x, y output by orbit to serve as the center of a label instead of the top left corner of the text.

update:
Code: (Select All)
_Title "label demo with orbit" ' b+ 2024-05-08
Screen _NewImage(800, 600, 32)

time = 3 ' due East degrees = 0
radius = 200
xo = _Width / 2
yo = _Height / 2
For angle = 0 To 359 Step 30
    orbit xo, yo, radius, angle, x, y
    Circle (x, y), 10, &HFF0000FF
    label x, y, _Trim$(Str$(time)) ' don't forget to remove left hand space with _trim$
    time = time + 1
    If time = 13 Then time = 1
Next

Sub orbit (x0rigin, yOrigin, radius, degrees, xOut, yOut) ' all default single  should be ok
    xOut = x0rigin + radius * Cos(_D2R(degrees))
    yOut = yOrigin + radius * Sin(_D2R(degrees))
End Sub

Sub label (xc, yc, text$)
    th2 = _FontHeight / 2
    pw2 = _PrintWidth(text$) / 2
    _PrintString (xc - pw2 + 1.25, yc - th2 + .5), text$
End Sub


Attached Files Image(s)
   
b = b + ...
Reply


Messages In This Thread
sin cos using SUB SumLocate (x,y,l) - by pmackay - 05-08-2024, 06:53 AM
RE: sin cos using SUB SumLocate (x,y,l) - by bplus - 05-08-2024, 11:10 AM



Users browsing this thread: 12 Guest(s)