O1Library Docs
Fall 2023
Docs API

# Animation

o1.gui.Animation
See the Animation companion object
final class Animation(frames: Iterable[Pic], val frameRate: Double, val terminateOnClose: Boolean, val atEnd: AtEnd)

An `Animation` object has an iterable sequence of Pics which it can show in a separate window (a simple View).

## Parameters

atEnd

  what should happen once the animation reaches the final Pic

frameRate

  a target speed (in Pics per second), which the `Animation` will roughly observe if possible

frames

  the Pics that the animation consists of, in order; they should be identical in size

terminateOnClose

  whether the entire application should exit when the animation window is closed

## Attributes

Companion
  object
Graph
Supertypes
  class Object
  trait Matchable
  class Any
Self type
  Animation

## Members list

### Value members

#### Concrete methods

def frameStream: LazyList[Pic]

Returns the frames of this animation as a `LazyList`. If atEnd is set to Animation.Loop, this will be a repeating, infinite list. Otherwise, it just contains each frame once, as set by the constructor parameter.

Returns the frames of this animation as a `LazyList`. If atEnd is set to Animation.Loop, this will be a repeating, infinite list. Otherwise, it just contains each frame once, as set by the constructor parameter.

## Attributes

def hide(): Unit

Closes the view that displays the animation.

Closes the view that displays the animation.

## Attributes

See also

  show, View.start

def show(): Unit

Starts a view that displays the animation.

Starts a view that displays the animation.

## Attributes

See also

  hide, ViewFrame.start

#### Concrete fields

val atEnd: AtEnd
val frameRate: Double
val terminateOnClose: Boolean