Jump to content

scale.x and scaleX, specificially for GSAP


Retri
 Share

Recommended Posts

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?

Link to comment
Share on other sites

  • 4 months later...

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

Link to comment
Share on other sites

  • 2 years later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...