clark Posted January 18, 2014 Share Posted January 18, 2014 Hey everyone Mat, loving the effort you have made on PIXI. As an AS3 developer, I have been waiting for a while to try it. I have no interest in working with Javascript directly, and so I have been hoping to go the TypeScript route. I am currently trying to create the definitions. Thanks for the great documentation Lets take something simple like the Point class. declare module PIXIexport class AlphaMaskFilter{....blah}export class Point { //properties x: number; y: number; //constructor constructor(x: number, y: number); //methods clone(): Point; }But what is holding me back is these other things:The PolyK modules and the PIXI.PixiShader class. I have no idea how to implement these into the definition. I am not sure what it means when a class has a prefix. Why does PIXI.PIXI.PixiShader exist and not just PIXI.PixiShader like all other PIXI module classes? My knowledge in JS is limited.EDIT: PIXI.PolyK.Triangulate So in Javascript, is the method name "PolyK.Triangulate()". Also, for the PolyK modules, should I put these in a different definition starting: declare module PolyKexport class InteractionData {.... blahIf you understand what I am talking about, please respond Quote Link to comment Share on other sites More sharing options...
clark Posted January 18, 2014 Author Share Posted January 18, 2014 So I know that PIXI is the module. The PolyK... object? Class? Is part of the PIXI module? How do you write a definition for that? Can it be as simple as adding the function call to the existing PIXI module?This:declare module PIXIexport class Point{....export class InteractionData { //properties global: Point; originalEvent: any; target: Sprite; //constructor constructor(); //methods getLocalPosition(displayObject:DisplayObject):Point; }?I get confused behind the scenes. Quote Link to comment Share on other sites More sharing options...
clark Posted February 28, 2014 Author Share Posted February 28, 2014 https://github.com/clark-stevenson/phaser/blob/dev/build/phaser.d.ts I want to get the PIXI definition out of my phaser definition file. Starting at line 74. If anyone can help me:1) I still have no idea how events work. You can see that I extend EventTarget which is almost certainly wrong. 2) I still cannot figure out the PIXI.polyK.InteractionData. Like a module inside a namespace or what ever this is, but I have no idea how to define it. Quote Link to comment Share on other sites More sharing options...
Ezelia Posted February 28, 2014 Share Posted February 28, 2014 there are some good contributed Pixi definitions on the web, why are you trying to reinvent the wheel ? try those ones :https://github.com/xperiments/Pulsar https://github.com/natelong/pixi-ts-def Quote Link to comment Share on other sites More sharing options...
clark Posted February 28, 2014 Author Share Posted February 28, 2014 I never knew about that second one thanks ,The rest of them that I found are outdated to the point of being a nightmare. Is there no chance of getting this second one merged into pixi build directory anyone?? Quote Link to comment Share on other sites More sharing options...
Ezelia Posted February 28, 2014 Share Posted February 28, 2014 there was a pull request to add TS definitions to official repo, but was refused cause they are not supposed to maintain it. Quote Link to comment Share on other sites More sharing options...
kuuuurija Posted March 5, 2014 Share Posted March 5, 2014 did you check this? https://github.com/borisyankov/DefinitelyTyped/blob/master/pixi/pixi.d.tsbut it still uses v 1.3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.