natelong / pixi-ts-def Goto Github PK
View Code? Open in Web Editor NEWPIXI Typescript Definition File
PIXI Typescript Definition File
the lastest version is 1.5.1
Hi, thanks for this useful definition file. I just had a minor issue using it that I thought I'd share.
I'm using pixel art in my game, and I'm setting the scaleMode with this line at the beginning of my application:
PIXI.scaleModes.DEFAULT = PIXI.scaleModes.NEAREST;
This makes NEAREST the default for all textures. It seems that because the definition uses enum, it's impossible to set later.
For now I'm using the trick of creating an untyped alias:
var PIXI_alias: any = PIXI;
PIXI_alias.scaleModes.DEFAULT = PIXI.scaleModes.NEAREST;
I'm still just getting the hang of TypeScript, so I'm not sure what the solution is right now. If I figure it out I'll let you know.
Thanks again :)
-Lee
https://github.com/clark-stevenson/PIXI.d.ts
this guys file seems to be up to date. although completion differs in places between your and his version :)
autoDetectRenderer params transparent and antialias are in the wrong order
in pixi.d.ts
export function autoDetectRenderer(width: number, height: number, view?: HTMLCanvasElement, antialias?, transparent?): IPixiRenderer;
in pixi.js
PIXI.autoDetectRenderer = function(width, height, view, transparent, antialias)
also touchmove is missing from export class DisplayObject
Hi again. I just noticed that you are defining matrix as number[], but in the current version it is a class like this:
PIXI.Matrix = function()
{
this.a = 1;
this.b = 0;
this.c = 0;
this.d = 1;
this.tx = 0;
this.ty = 0;
};
http://www.goodboydigital.com/pixijs/docs/files/src_pixi_core_Matrix.js.html
I quickly hacked around it for now, but if I make a proper definition I'll send it through. I just thought I'd mention it to you in the meantime.
I am not sure about this.
https://github.com/GoodBoyDigital/pixi.js/blob/dev/src/pixi/filters/AbstractFilter.js
The public properties listed here are only dirty and padding.
Does anyone know if private properties belong in a TypeScript definition?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.