volkipp / haxe-pixi

Externs of pixi.js for Haxe

Home Page:http://www.pixijs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

haxe-pixi Build Status Built with Grunt ![Gitter](https://badges.gitter.im/Join Chat.svg)

haxe pixi logo

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

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. Analytics

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

About

Externs of pixi.js for Haxe

http://www.pixijs.com

License:MIT License


Languages

Language:Haxe 99.3%Language:JavaScript 0.7%