cpu_sam Posted May 26, 2019 Share Posted May 26, 2019 how can I extends the AnimatedSprite from pixi 4.8.7? I'm not able to do this in vscode because it says that the constructor of base class (AnimatedSprite) should be 0 args but got 2. Why this? Se my code: import 'pixi.js'; export class Animation extends PIXI.extras.AnimatedSprite { constructor (name:string, textures:PIXI.Texture[], loop:boolean=true) { super(textures,loop); this.name = name; this.anchor.set(0.5); } } I'm using typescript. At the line with the super give error in vscode, and the this.name and anchor it like if not exist. What should I do? Quote Link to comment Share on other sites More sharing options...
cpu_sam Posted May 26, 2019 Author Share Posted May 26, 2019 Sorry for this... but I HATE TYPESCRIPT!!!! Oh my god, almost I had a 'piripaque' here. Solved, I will to javascript, never in this life I want to program in typescript again! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 26, 2019 Share Posted May 26, 2019 Are you sure you've got the correct typings for your pixijs version? In v5 animatedsprite is moved from extras to PIXI namespace, and those typings have only stub class. Well, if you dont understand how to fix typings or you cant wait for answer you should use JS. In that case i recommend to clone pixijs repo to your computer because docs can wrong you too. There's a rumor that certain parts of PixiJS will be moved to typescript this year *insert evil laugh here*. cpu_sam 1 Quote Link to comment Share on other sites More sharing options...
cpu_sam Posted May 26, 2019 Author Share Posted May 26, 2019 Hahaha man, I can't express myself here cause of my limitation with English. But, you are a great person @ivan.popelyshev, I started to follow your work with Pixi some time ago and I see that you have MANY will to help people. So, apart this. I never will go back to typescript, never in my life I had so close to have a heart attack because of a language. Well, I came from using Phaser 2 with typescript and many problems happened, configure a simple project was hard as hell. C++ is so far easily than typescript and you not wast time configuring vscode. And yes, I configured the Pixi properly like it should be, and even had problems. I'm using this language for some months and had many, many problems. So to keep my health and sanity, I give up of this lang. I will use javascript... only when I take a piece of cake and drink some coffee at morning. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 26, 2019 Share Posted May 26, 2019 Russian english here. Thank you! I just had a trip through Sochi, Barselona, Ibiza and Palma visiting major pixijs users and helping them for food I'll board plane to Moscow in a hour. hm, looks like CoffeeScript is the thing that you need ? CakeScript doesnt exist, unfortunately. TS is good for people who came from Java/C#/ActionScript3. However it adds complexity for all the tools and plugins. I use TS only with namespaces and simple concatenation with "tsc" tool. I copy "ts.d" files into separate dir to know for sure that typings that i use correspond to the version. It really helps if you have like 50k or 1m lines of code. Yes, you need balance between configs and language. People prefere very difficult configs and tools right now, I'm stick to basics. "references.ts", "tsconfig" and "ts.d" files are analogues to makefile, configure and includes. And webpack is piece of .. js tech. cpu_sam 1 Quote Link to comment Share on other sites More sharing options...
lloydevans Posted May 26, 2019 Share Posted May 26, 2019 +1 for Typescript. Webpack/Rollup are actually pretty easily configurable and versatile module bundlers. The web moves fast and it's about enabling you to use the latest and greatest tech while still supporting outdated targets as painlessly as possible. Large projects written in plain ES5 with file concatenation are usually a nightmare to maintain and work on unless they are beautifully written and documented by skilled and knowledgable people. Code editors don't know anything about the project unless you configure them to and they have complex JS analysis features. Even then it doesn't work particularly well a lot of the time. ES5 JS + namespaces look so dated and a chore to read and write at this point. Some of the Grunt/Gulp configs I've seen and worked on are far from simple too btw. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
lloydevans Posted May 26, 2019 Share Posted May 26, 2019 P.s. thank you very much for your amazing work, @ivan.popelyshev. I've been using your pixi-projection plugin recently and it's awesome! ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
cpu_sam Posted May 26, 2019 Author Share Posted May 26, 2019 5 hours ago, ivan.popelyshev said: Russian english here. Thank you! I just had a trip through Sochi, Barselona, Ibiza and Palma visiting major pixijs users and helping them for food I'll board plane to Moscow in a hour. hm, looks like CoffeeScript is the thing that you need ? CakeScript doesnt exist, unfortunately. Hahaha I cryed of laught here. I will change to javascript and wait not have so many troubles as with typescript. Thank you. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
Exca Posted May 27, 2019 Share Posted May 27, 2019 Haxe is awesome for people who dont like typescript Though with that there's no proper externs for v5 yet. Quote Link to comment Share on other sites More sharing options...
cpu_sam Posted May 28, 2019 Author Share Posted May 28, 2019 @Exca thanks for your advice, I'll take a look at the Haxe. 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.