aidangrabe / 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

haxe pixi logo

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

If you are looking for pixi.js (v1.6.1) externs, you can get them from https://github.com/adireddy/haxe-pixi/releases/tag/v1.6.1-e0.1.3

Installation

haxelib install pixijs

API Documentation

Click here for API documentation.

Issues

Found any bug? Please create an issue on GitHub.

https://github.com/adireddy/haxe-pixi/issues

Demos

Look at the demos folder for the source code of above examples ported from pixi.js.

Usage

package ;

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:Dynamic;
    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.x = 400;
        _bunny.position.y = 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();
	}
}

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


Languages

Language:JavaScript 87.0%Language:Haxe 13.0%