Skip to content

GaryTsang/haxe-pixi

 
 

Repository files navigation

haxe-pixi Haxelib Version Build Status Built with Grunt

haxe pixi logo

Externs of pixi.js (v2.2.5) for Haxe - 2D webGL renderer with canvas fallback.

![Gitter](https://badges.gitter.im/Join Chat.svg)

Installation

haxelib install pixijs

API Documentation

Click here for API documentation. YUIDoc API similar to pixi.js docs also available.

Issues

Found any bug? Please create a new issue.

Demos

Ported from pixi.js

New Demos

Look at the samples folder for the source code of above examples.

Usage

package ;

import pixi.renderers.IRenderer;
import pixi.display.Sprite;
import pixi.display.Stage;
import pixi.textures.Texture;
import pixi.utils.Detector;
import js.Browser;

class Main {

	var _bunny:Sprite;
    var _renderer:IRenderer;
    var _stage:Stage;

	public function new() {
		_stage = new Stage(0x00FF00);
		
		// Rendering options usage sample
		var options:RenderingOptions = {};
		options.antialias = true;
		options.resolution = 1;
		options.transparent = true;
		
        _renderer = Detector.autoDetectRenderer(800, 600, options);
        Browser.document.body.appendChild(_renderer.view);
        
        _bunny = new Sprite(Texture.fromImage("assets/basics/bunny.png"));
        _bunny.anchor.set(0.5, 0.5);
        _bunny.scale.set(2, 2);
        _bunny.position.set(400, 300);
        
        _stage.addChild(_bunny);
        
        Browser.window.requestAnimationFrame(cast animate);
	}

	function animate() {
        Browser.window.requestAnimationFrame(cast animate);
        _bunny.rotation += 0.1;  
        _renderer.render(_stage);
    }

	static function main() {
		new Main();
	}
}

Licensing Information

MIT license

This content is released under the MIT License.

pixi.js is made by goodboy and licensed under the MIT License.

Contributor Code of Conduct

Code of Conduct is adapted from Contributor Covenant

About

Externs of pixi.js for Haxe

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Haxe 99.4%
  • JavaScript 0.6%