anim2 1.0.5

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 39

anim2

A basic 2D html5 animation library. Very basic.

Usage

A simple usage example (see example\anim2_example.dart for the Circle implementation):

    import 'dart:html';
    import 'dart:math';

    import 'package:anim2/anim2.dart';
    import 'package:generic_vector_tools/generic_vector_tools.dart';

    // Create the animation controller, pass it a reference to the CanvasElement you are animating on
    // and the framerate of animation
    Controller controller = new Controller(querySelector('#canvas1') as CanvasElement, new Duration(milliseconds: 16));

    main() {
      // The example will move a circle to the clicked location, and change it to a random colour
      controller.canvas.onClick.listen(mainOnClick);

      //  create and register the object -  a circle at position (10,10)
      controller.registerObject(new Circle("testCircle", new V2(10.0,10.0)));

      // Create and immediately compound an animation to change the colour to a random colour,
      // and move to the clicked location
      controller.compoundAnimation(controller.changeColourTo("testCircle", new Colour.random(), 30));
      controller.compoundAnimation(controller.moveTo("testCircle", clickPosition, 30));
    }

Features and bugs

Please file feature requests and bugs at the issue tracker.

Changelog

0.0.1

  • Initial version, created by Stagehand.

1.0.0

  • Barebones implementation, arguably suitable for inclusion in barebones projects.

1.0.1

  • Queueable animation groups.

1.0.2

  • dart2js freindliness

1.0.3

  • Unit tests pass in checked mode.

1.0.4

  • Added some animations support custom velocity functions.
  • Added AnimMoveAt to move an object at an input velocity function (function of animation frame).
  • Added AnimChangeScale to change the scale of an object.
  • Added ScaleObject abstract class for objects which can have their scale changed.

1.0.5

  • AnimChangeScale can move a ScaleObject relative to the focus of scaling.

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  anim2: "^1.0.5"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:anim2/anim2.dart';
        
Version Uploaded Documentation Archive
1.0.5 Jul 11, 2016 Go to the documentation of anim2 1.0.5 Download anim2 1.0.5 archive
1.0.4 Jul 10, 2016 Go to the documentation of anim2 1.0.4 Download anim2 1.0.4 archive
1.0.3 Apr 7, 2016 Go to the documentation of anim2 1.0.3 Download anim2 1.0.3 archive
1.0.1 Apr 2, 2016 Go to the documentation of anim2 1.0.1 Download anim2 1.0.1 archive
1.0.0 Mar 31, 2016 Go to the documentation of anim2 1.0.0 Download anim2 1.0.0 archive

Analysis

We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
14 / 100
Health:
Code health derived from static analysis. [more]
94 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
21 / 100
Overall score:
Weighted score of the above. [more]
39
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:anim2/anim2.dart.

Suggestions

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 2 errors 5 hints.

    Strong-mode analysis of lib/src/anim_change_colour.dart failed with the following error:

    line: 12 col: 3
    Invalid override. The type of 'AnimChangeColour.target=' ('(ColourObject) → void') isn't a subtype of 'AnimationBase.target=' ('(AnimObject) → void').

    Strong-mode analysis of lib/src/anim_change_scale.dart failed with the following error:

    line: 11 col: 3
    Invalid override. The type of 'AnimChangeScale.target=' ('(ScaleObject) → void') isn't a subtype of 'AnimationBase.target=' ('(AnimObject) → void').

    Similar analysis of the following files failed:

    • lib/src/animation_group.dart (hint)
    • lib/src/colour.dart (hint)
    • lib/src/scale_object.dart (hint)
  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0
generic_vector_tools >=1.0.5 <1.1.0 1.0.7
Dev dependencies
test >=0.12.0 <0.13.0