pixi 0.1.0 copy "pixi: ^0.1.0" to clipboard
pixi: ^0.1.0 copied to clipboard

outdatedDart 1 only

Port of the pixi.js library for 2D graphics using WebGL where available and the canvas where not.

pixi.dart #

A Dart port of pixi.js.

Work in Progress #

Implemented so far:

  • Canvas renderer
  • WebGL renderer (with automatic batching)
  • Full scene graph
  • Asset loader / sprite sheet loader
  • Text
  • BitmapFont text
  • Multiline text
  • Primitive drawing
  • Interaction (mouse and touch events)

Usage #

import 'dart:html';
import 'package:pixi/pixi.dart';


class BunnyExample
{
	var renderer	= new CanvasRenderer(400, 300);
	var stage		= new Stage(new Colour.fromHtml('#6f9'));
	var bunny		= new Sprite.fromImage("bunny.png");


	BunnyExample()
	{
		document.body.append(this.renderer.view);

		this.bunny.anchor 	= new Point(0.5, 0.5);
		this.bunny.position	= new Point(200, 150);

		this.stage.children.add(this.bunny);

		window.requestAnimationFrame(this._animate);
	}


	void _animate(var num)
	{
		window.requestAnimationFrame(this._animate);

		this.bunny.rotation += 0.1;

		this.renderer.render(this.stage);
	}
}


void main()
{
	new BunnyExample();
}
2
likes
0
pub points
12%
popularity

Publisher

unverified uploader

Port of the pixi.js library for 2D graphics using WebGL where available and the canvas where not.

Repository
View/report issues

License

unknown (LICENSE)

Dependencies

browser, js

More

Packages that depend on pixi