locked
Get x ,y coordinates during animation RRS feed

  • Question

  • graphicswindow.height = 700
    graphicswindow.width = 700
    
    circle = shapes.addellipse(10,10)
    
    timer.interval = 500
    timer.tick = move
    
    sub move
      x = math.getrandomnumber(700)
      y = math.getrandomnumber(700)
      shapes.move(circle,x,y,500)
    endsub

    So here I have a circle that moves to a random position every 500 milliseconds. Right now I can get the coordinates of the circle every 500 ms.

    Is there a way to obtain coordinates every, say, 10 milliseconds? i.e in the middle of animation, while  it's moving?

    Something like 

    x2 = shapes.shapeX(circle)

    y2 = shapes.shapeY(circle)

    Tuesday, July 3, 2012 8:24 AM

Answers

  • There's actually the Shapes.GetLeft(shape) command to get the x position of your shape, and the Shapes.GetTop(shape) command for the y position.
    • Marked as answer by thariqfahry Tuesday, July 3, 2012 9:03 AM
    Tuesday, July 3, 2012 8:42 AM