Skip to main content

A python animation library

Project description

Nanim

An animation library designed from the ground up for a intuitive and easy to use interface. Made in python.

Installation

Use the package manager pip to install nanim.

pip install nanim

The dependenices are pycairo and ffmpeg, which pip should install automatically.

Usage

Firstly make an animation file, in which build your animation,

Sample animation file

s = Scene();
rect = s.add(Rectange(x=0,y=0,width=100,height=100, color=Color.RGB(255,0,0)));
rect.fadeIn().move_to(x=100, y=100).wait(3).fade_out()

s.run_animation();

To render your animation:

  • run with nanim <file-name> for example nanim animation.py where file name is the file name of your animation file
  • running nanim -h will give you a list of options

List of all functions callable on objects

   """Fade Out
    Parameters:
    duration (float): duration of animation in seconds
    blocking (bool): whether this animation should stop other animations until its done
   """
    def fade_out(duration=0.5, blocking=True):

   """Fade In
    Parameters:
    duration (float): duration of animation in seconds
    blocking (bool): whether this animation should stop other animations until its done
   """
    def fade_in(duration=0.5, starting_time="not_set", blocking=True):


   """Rotate
    Parameters:
    angle (float): the angle to rotate, either in degrees or radians set by pi mode.
    duration (float): duration of animation in seconds
    blocking (bool): whether this animation should stop other animations until its done
    around (Point): a point to rotate around, default is the center of the object
    pi_mode (bool): whetor the angle is in degrees or radians
   """
    def rotate(angle, duration=0.5, blocking=True, around="not_set", pi_mode=False):

   """Makes object wait
   Parameters:
    duration (float): duration of animation in seconds
   """
    def wait(duration=0.5):

   """Translate
    Parameters:
    duration (float): duration of animation in seconds
    x (int): how much to translate in the x direction
    y (int):  how much to translate in the y direction
   """
    def translate(self, x=0, y=0, duration=0.5"):

   """Set color
    Parameters:
    color (color): the color to turn too
    duration (float): duration of animation in seconds
    blocking (bool): whether this animation should stop other animations until its done
   """
    def set_color(self, color, duration=0.5, blocking=True):

   """Move to 
    Parameters:
    point (Point): the location to move to (should be a point such as Point(x=0,y=0)
    duration (float): duration of animation in seconds
   """
    def move_to(point, duration=0.5):

Contributing

Pull requests are welcome.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nanim-0.0.3.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

nanim-0.0.3-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file nanim-0.0.3.tar.gz.

File metadata

  • Download URL: nanim-0.0.3.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.21.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.24.0 CPython/3.7.1

File hashes

Hashes for nanim-0.0.3.tar.gz
Algorithm Hash digest
SHA256 5d6bae4ae1e2fe3ac801b5b9b21184bae5b413af8b21405ccbbc3eaf8d1f306c
MD5 7917db517e9d08716092c7aa02124da8
BLAKE2b-256 87eb73a043467d761430f475569b6daa1f24c41af357de26962ee72ad14d405a

See more details on using hashes here.

File details

Details for the file nanim-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: nanim-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.21.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.24.0 CPython/3.7.1

File hashes

Hashes for nanim-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ef00d8df564faefb95a5ab35d5e84c25f6c65f09dfa72416cebebb3414be097a
MD5 a9528b9366fc5f1970219fe71b99a0ba
BLAKE2b-256 cf16153845825cf45ae6ab866dc19fd3936623e82dff6d11e6d4306d8e95067a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page