PiDraw API
    Preparing search index...

    Class Animate

    Plays the animation of the points of a graph (the option animate): each point goes from the point from to the point to, and the figures built on it follow. It is made with the graph, new Animate(graph), and attaches itself to it; a graph has one. The program calls the methods below, and a page that shows buttons listens to the events (on).

    The events are start (the animation began, or went on after a pause), pause, end (every animation reached its end, and none loops) and stop.

    Hierarchy

    • EventTarget
      • Animate

    Implements

    Index
    • The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.

      MDN Reference

      Parameters

      • type: string
      • callback: EventListenerOrEventListenerObject | null
      • Optionaloptions: boolean | AddEventListenerOptions

      Returns void

    • Whether a point of the graph has an animation. The points are read again unless the animation is running or paused.

      Returns boolean

    • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().

      MDN Reference

      Parameters

      • event: Event

      Returns boolean

    • Forgets the animations of the points that were removed from the graph, and of the points that end at a removed point. If nothing is left to play, a running animation stops.

      Parameters

      • names: string[]

      Returns void

    • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.

      MDN Reference

      Parameters

      • type: string
      • callback: EventListenerOrEventListenerObject | null
      • Optionaloptions: boolean | EventListenerOptions

      Returns void

    • Starts again from the beginning, whether it runs, is paused or is over.

      Returns void

    • Starts the animation from the beginning. After a pause it goes on from where it was, and while it runs it does nothing (see restart). The points are read again when it starts from the beginning.

      Returns void

    • Stops the animation, and puts the points back where the code says (after a short delay, once the last frame is drawn). Does nothing to an animation that is over, except putting the points back. The event stop is sent only if the animation ran or was paused.

      Returns void