compass 0.0.5

Introduction

A 2D rendering engine that uses WebGL

Features

  • WebGL renderer
  • Super easy to use API
  • Support for texture atlases
  • Asset loader / sprite sheet loade
  • Mouse interaction
  • Keyboard state

Installing via Pub

Using http://pub.dartlang.org/packages/compass

dependencies:
  compass: any

Usage


void main() {
  CanvasElement canvas = query('#container');
  
  Director.init(canvas);
  director.background = Color.parse(Color.Green);
  director.replace(new SimpleTest());
}

class SimpleTest extends Scene {
  enter() {
    var rng = new Random();
    for(var i = 0; i < 10000; i++) {
      var sprite = new Sprite();
      sprite.fill = Color.random();
      sprite.width = rng.nextDouble() * 50;
      sprite.height = rng.nextDouble() * 50;
      sprite.x = rng.nextDouble() * director.width;
      sprite.y = rng.nextDouble() * director.height;
      addChild(sprite);
    }
  }
}
    

Thanks

About

1. Depend on it

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

dependencies:
  compass: "^0.0.5"

2. Install it

You can install packages from the command line:

$ pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:compass/compass.dart';

Platforms

Web

About

A 2D rendering engine that uses WebGL

Author

Email valorzhong@gmail.com Valor Zhong

Homepage

github.com/valorzhong/compass

Documentation

www.dartdocs.org/documentation/compass/0.0.5/

Source code (hyperlinked)

www.crossdart.info/p/compass/0.0.5/

Uploader

valorzhong@gmail.com

License

BSD

Published

Jul 19, 2013

Share