nima 1.0.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 78

Nima-Flutter

Flutter runtime written in Dart with SKIA based rendering.

Installation

Add nima as a dependency in your pubspec.yaml file.

Exporting for Flutter

Export from Nima with the Export to Engine menu. In the Engine drop down, choose Generic.

Adding Assets

Once you've exported your character file. Add the .nima file and and the .png atlas files to your project's Flutter assets.

Make sure the .png files are at the same level as the.nima file. If you renamed your .nima file, make sure to rename your assets accordingly.

In the future we may opt to package the images into the .nima file as we do for WebGL. Let us know if you're in favor of this!

Example

Take a look at the provided example application for how to use the NimaActor widget with an exported Nima character.

Usage

The easiest way to get started is by using the provided NimaActor widget. This is a stateless Flutter widget that allows for one Nima character with one active animation playing. You can change the currently playing animation by changing the animation property's name. You can also specify the mixSeconds to determine how long it takes for the animation to interpolate from the previous one. A value of 0 means that it will just pop to the new animation. A value of 0.5 will mean it takes half of a second to fully mix the new animation on top of the old one.

import 'package:nima/nima_actor.dart';
class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return new NimaActor("assets/Hop", alignment:Alignment.center, fit:BoxFit.contain, animation:"idle");
  }
}

Advanced Usage

For more advanced usage such as creating views with multiple Nima characters, multiple active animations, and controllers, please refer to the internals of nima_actor.dart to get acquainted with the API. We'll be posting more detailed tutorials and documentation regarding the inner workings of the API soon.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request.

License

See the LICENSE file for license rights and limitations (MIT).

[1.0.0] - 5/5/2018

  • Initial release with an example NimaActor widget that implements a LeafRenderObjectWidget that can render a Nima actor. Alignment is done based on the setup axis aligned bounding box.

Use this package as a library

1. Depend on it

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


dependencies:
  nima: ^1.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:nima/nima.dart';
  
Version Uploaded Documentation Archive
1.0.1 Aug 11, 2018 Go to the documentation of nima 1.0.1 Download nima 1.0.1 archive
1.0.0 May 6, 2018 Go to the documentation of nima 1.0.0 Download nima 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
75
Health:
Code health derived from static analysis. [more]
82
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
78
Learn more about scoring.

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

  • Dart: 2.0.0
  • pana: 0.12.3
  • Flutter: 0.8.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Issues and suggestions

Fix lib/nima/animation/keyframe.dart.

Analysis of lib/nima/animation/keyframe.dart reported 1 warning:

line 210 col 5: Missing case clause for 'Progression'.

Fix lib/nima/animation/value_time_curve_interpolator.dart.

Analysis of lib/nima/animation/value_time_curve_interpolator.dart reported 2 warnings, 4 hints, including:

line 68 col 5: Missing case clause for 'Linear'.

line 68 col 5: Missing case clause for 'Progression'.

line 92 col 10: The value of the field '_y0' isn't used.

line 95 col 10: The value of the field '_y1' isn't used.

line 98 col 10: The value of the field '_y2' isn't used.

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.

Fix lib/nima.dart.

Analysis of lib/nima.dart reported 1 hint:

line 105 col 9: The value of the local variable 'uvOffset' isn't used.

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use nima.dart.

Fix additional 32 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/nima/actor.dart (Run flutter format to format lib/nima/actor.dart.)
  • lib/nima/actor_axis_constraint.dart (Run flutter format to format lib/nima/actor_axis_constraint.dart.)
  • lib/nima/actor_bone.dart (Run flutter format to format lib/nima/actor_bone.dart.)
  • lib/nima/actor_bone_base.dart (Run flutter format to format lib/nima/actor_bone_base.dart.)
  • lib/nima/actor_component.dart (Run flutter format to format lib/nima/actor_component.dart.)
  • lib/nima/actor_constraint.dart (Run flutter format to format lib/nima/actor_constraint.dart.)
  • lib/nima/actor_distance_constraint.dart (Run flutter format to format lib/nima/actor_distance_constraint.dart.)
  • lib/nima/actor_event.dart (Run flutter format to format lib/nima/actor_event.dart.)
  • lib/nima/actor_ik_constraint.dart (Run flutter format to format lib/nima/actor_ik_constraint.dart.)
  • lib/nima/actor_image.dart (Run flutter format to format lib/nima/actor_image.dart.)
  • lib/nima/actor_jelly_bone.dart (Run flutter format to format lib/nima/actor_jelly_bone.dart.)
  • lib/nima/actor_loader.dart (1 hint)
  • lib/nima/actor_node.dart (Run flutter format to format lib/nima/actor_node.dart.)
  • lib/nima/actor_node_solo.dart (Run flutter format to format lib/nima/actor_node_solo.dart.)
  • lib/nima/actor_root_bone.dart (Run flutter format to format lib/nima/actor_root_bone.dart.)
  • lib/nima/actor_rotation_constraint.dart (Run flutter format to format lib/nima/actor_rotation_constraint.dart.)
  • lib/nima/actor_scale_constraint.dart (Run flutter format to format lib/nima/actor_scale_constraint.dart.)
  • lib/nima/actor_targeted_constraint.dart (Run flutter format to format lib/nima/actor_targeted_constraint.dart.)
  • lib/nima/actor_transform_constraint.dart (Run flutter format to format lib/nima/actor_transform_constraint.dart.)
  • lib/nima/actor_translation_constraint.dart (Run flutter format to format lib/nima/actor_translation_constraint.dart.)
  • lib/nima/animation/actor_animation.dart (1 hint)
  • lib/nima/animation/property_types.dart (Run flutter format to format lib/nima/animation/property_types.dart.)
  • lib/nima/binary_reader.dart (Run flutter format to format lib/nima/binary_reader.dart.)
  • lib/nima/block_reader.dart (Run flutter format to format lib/nima/block_reader.dart.)
  • lib/nima/dependency_sorter.dart (Run flutter format to format lib/nima/dependency_sorter.dart.)
  • lib/nima/jelly_component.dart (Run flutter format to format lib/nima/jelly_component.dart.)
  • lib/nima/math/aabb.dart (Run flutter format to format lib/nima/math/aabb.dart.)
  • lib/nima/math/mat2d.dart (Run flutter format to format lib/nima/math/mat2d.dart.)
  • lib/nima/math/transform_components.dart (Run flutter format to format lib/nima/math/transform_components.dart.)
  • lib/nima/math/vec2d.dart (Run flutter format to format lib/nima/math/vec2d.dart.)
  • lib/nima/transform_space.dart (Run flutter format to format lib/nima/transform_space.dart.)
  • lib/nima_actor.dart (1 hint)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
test ^0.12.0