项目作者: flutterkit

项目描述 :
Zerker is a lightweight and powerful flutter graphic animation library
高级语言: Dart
项目地址: git://github.com/flutterkit/zerker.git
创建时间: 2019-08-22T09:07:15Z
项目社区:https://github.com/flutterkit/zerker

开源协议:MIT License

下载







pub package
Made-with-Flutter
Made-with-Dart

What is Zerker

Zerker is a flexible and lightweight flutter canvas graphic animation library.

With Zerker, you can create a lot of seemingly cumbersome animation effects, such as animated animations, pop-up animations, scene transitions, icon effects, and more.

At the same time, you can create a lot of simple games with Zerker. Zerker contains elements such as sprites, scrolling backgrounds, and atlases, making it easy to create game worlds with them.

➤ More detailed documentation about Zerker is here https://flutterkit.github.io/zerkerdocs/

An image

Installation

Add this to your package’s pubspec.yaml file, And execute the commandflutter pub get:

  1. dependencies:
  2. zerker: <latest_version_here>
More detailed installation steps, you can refer to here. https://pub.dev/packages/zerker/install

Getting started

Import the package

  1. import 'package:zerker/zerker.dart';

Useage

Create a zerker widget

  1. class _MyHomePageState extends State<MyHomePage> {
  2. @override
  3. Widget build(BuildContext context) {
  4. return Scaffold(
  5. appBar: AppBar(
  6. title: Text(widget.title),
  7. ),
  8. body: Center(
  9. child: Zerker(app: MyZKApp(), clip: true, interactive: true, width: 350, height: 350),
  10. ));
  11. }
  12. }

Create your Zerker class inherited from ZKApp

  1. class MyZKApp extends ZKApp {
  2. @override
  3. init() {
  4. super.init();
  5. /// init zerker scene
  6. }
  7. @override
  8. update(int time) {
  9. super.update(time);
  10. sprite.position.x++;
  11. }
  12. }

Initialize the scene and create elements in the init function

  1. /// Create a zerker sprite
  2. ZKSprite bigboy = ZKSprite(key: "bigboy")
  3. ..animator.make("front", [0, 1, 2, 3, 4])
  4. ..animator.make("left", ['5-9'])
  5. ..animator.make("after", ['10-14'])
  6. ..animator.make("right", ['15-19'])
  7. ..onTapDown = (event) {
  8. bigboy.animator.play("right", 8, true);
  9. };
  10. stage.addChild(bigboy);
  11. /// Create a zerker text
  12. ZKText text = ZKText()
  13. ..setPosition(100, 100)
  14. ..text = "hello world"
  15. ..setStyle(color: Colors.blueGrey, backgroundColor: Colors.red[50]);
  16. stage.addChild(_text);

More cases

You can quickly start learning an example here. https://flutterkit.github.io/zerkerdocs/guide/tutorial.html

More zerker examples you can view here https://github.com/flutterkit/zerker-samples. If you have any questions about Zerker, please let me know by email, thank you very much!

img img img

License

Zerker is licensed under MIT license. View license. https://github.com/flutterkit/zerker/blob/master/LICENSE