Coder Social home page Coder Social logo

flutterkit / zerker Goto Github PK

View Code? Open in Web Editor NEW
679.0 21.0 62.0 1.19 MB

Zerker is a lightweight and powerful flutter graphic animation library

Home Page: https://flutterkit.github.io/zerkerdocs/

License: MIT License

Dart 96.68% HTML 3.32%
canvas flutter fluttercanvas fluttergame flutter-games flutter-game flutter-graphic

zerker's Introduction


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:

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

Getting started

Import the package

import 'package:zerker/zerker.dart';

Useage

Create a zerker widget

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
        ),
        body: Center(
          child: Zerker(app: MyZKApp(), clip: true, interactive: true, width: 350, height: 350),
        ));
  }
}

Create your Zerker class inherited from ZKApp

class MyZKApp extends ZKApp {

  @override
  init() {
    super.init();
    /// init zerker scene
  }

  @override
  update(int time) {
    super.update(time);
    sprite.position.x++;
  }
}

Initialize the scene and create elements in the init function

/// Create a zerker sprite
ZKSprite bigboy = ZKSprite(key: "bigboy")
  ..animator.make("front", [0, 1, 2, 3, 4])
  ..animator.make("left", ['5-9'])
  ..animator.make("after", ['10-14'])
  ..animator.make("right", ['15-19'])
  ..onTapDown = (event) {
    bigboy.animator.play("right", 8, true);
  };
stage.addChild(bigboy);

/// Create a zerker text
ZKText text = ZKText()
  ..setPosition(100, 100)
  ..text = "hello world"
  ..setStyle(color: Colors.blueGrey, backgroundColor: Colors.red[50]);
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

zerker's People

Contributors

drawcall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zerker's Issues

onTouchMove not working

Hi, Can not seem to get the onTouchMove callback working. Awesome library, Keep up the good work!

How to dispose zerker?

class _MyHomePageState extends State<MyHomePage> {
  Zerker a;
  MyZKApp app = MyZKApp();
  @override
  void initState() {
    super.initState();
    a = Zerker(
        app: app, clip: true, interactive: true, width: 350, height: 350);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
          actions: [
            InkWell(
              child: Text('dispose'),
              onTap: () {
                a = null;
                app.dispose();
                setState(() {});
              },
            )
          ],
        ),
        body: Center(
          child: a,
        ));
  }
}

I used the example with some modifications.

image

My computer is a poorly performing device, but my cell phone is worse. If the zerker is not dispose, the performance of the cell phone is very poor.
This cannot be solved with super.dispose.

Please provide me a solution.

scene transitions

In the description of this great package, it states we can make custom scene transitions. I would love to see an example or a code snippet to make a custom scene transition from one page to another. Something like Instagram/Snapchat story dismissing by swiping down and page being clipped down to a circle avatar in the first page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.