# nodesnim/core/animation

Dark Mode

Search:
Group by:

# Types

    AnimationObj[T] = object
      frame*: int
      speed*, current*: float
      name*: string
      frames*: seq[T]

    AnimationRef[T] = ref AnimationObj[T]

    AnimationArray[T] = seq[AnimationRef[T]]

# Procs

    proc Animation[T](name: string; speed: float = 1.0'f32): AnimationRef[T]

  Creates a new Animation object.

  Arguments:

  - `name` is an animation name.
  - `speed` is an animation speed.

  Examples:

      var anim = Animation[int]("animation", 10.0'f32)

    proc addFrame[T](anim: AnimationRef[T]; frame: T)

  Adds a new frame in the animation.

    proc `==`[T](x, y: AnimationRef[T]): bool

    proc `[]`[T](arr: AnimationArray[T]; index: string): AnimationRef[T]

    proc contains[T](arr: AnimationArray[T]; animation: AnimationRef[T]): bool

    proc contains[T](arr: AnimationArray[T]; name: string): bool