Skip to content

Latest commit

 

History

History
68 lines (45 loc) · 1.31 KB

README.md

File metadata and controls

68 lines (45 loc) · 1.31 KB

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