Retri Posted April 27, 2015 Share Posted April 27, 2015 I'm using GSAP with PIXI and if I want to tween scale and position I have to make specific tweens for each. Fx.tl.to(player_1, 0.6, {y:"+=200"}, "label");tl.to(player_1.scale, 0.6, {y:1}, "label"); This forces me to make needless code, such as adding labels to make the animation sync up. Is there a chance you'll add scaleX and scaleY instead/along side of scale.x and scale.y? Quote Link to comment Share on other sites More sharing options...
xerver Posted April 27, 2015 Share Posted April 27, 2015 Probably not, but there is no reason you can't: Object.defineProperties(PIXI.Sprite.prototype, { scaleX: { get: function () { return this.scale.x; }, set: function (v) { this.scale.x = v; } }, scaleY: { get: function () { return this.scale.y; }, set: function (v) { this.scale.y = v; } } }); hannyajin 1 Quote Link to comment Share on other sites More sharing options...
Bolko Posted April 27, 2015 Share Posted April 27, 2015 Same problem here.I´d love to have sprite.scale just for scaling equally, I usually don´t scale only x or only y.so scale, scaleX and scaleY would be perfect Retri 1 Quote Link to comment Share on other sites More sharing options...
xerver Posted April 28, 2015 Share Posted April 28, 2015 Nothing stopping anyone from pasting the code above into their project Bolko and Retri 2 Quote Link to comment Share on other sites More sharing options...
Retri Posted May 2, 2015 Author Share Posted May 2, 2015 Oh. That's very nice Xerver, I'll def. do that. Thanks! Quote Link to comment Share on other sites More sharing options...
kmfdm Posted September 21, 2015 Share Posted September 21, 2015 Hi, When i add Object.defineProperties(PIXI.Sprite.prototype, {scaleX: { get: function () { return this.scale.x; }, set: function (v) { this.scale.x = v; }},scaleY: { get: function () { return this.scale.y; }, set: function (v) { this.scale.y = v; }}}); into the same area of the code where the getters and setters for width and height are everything works great. Just one problem and that is I would prefer to add this after the fact so that i can use the CDN version of the JS file. We are producing banners and the ad servers wont count pixiJS to or KB size if we do it this way. But im stuck i can't figure out how do to this. Any chance you could give me / us a tip. Thanks Greg Quote Link to comment Share on other sites More sharing options...
xerver Posted September 27, 2015 Share Posted September 27, 2015 Just include pixi on your page before the script tag that has the code I posted. Copy-pasting the code exactly as I wrote it should be perfectly fine to add it after the fact. You need to include the files in this order: 1) Pixi.js 2) The patch I posted 3) Your application. Quote Link to comment Share on other sites More sharing options...
thierrymichel Posted November 14, 2017 Share Posted November 14, 2017 Works like a charm… Quote Link to comment Share on other sites More sharing options...
OSUblake Posted November 19, 2017 Share Posted November 19, 2017 You can use scale, scaleX, and scaleY with the PixiPlugin. ivan.popelyshev and keel 2 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.