[email protected] Posted April 3, 2019 Share Posted April 3, 2019 def Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 3, 2019 Share Posted April 3, 2019 new PIXI.Sprite(someTexture) is a constructor call PIXI.Sprite.from is static function call, and somewhere inside "new PIXI.Sprite(texture)" is called: https://github.com/pixijs/pixi.js/blob/dev/packages/sprite/src/Sprite.js#L493 Quote Link to comment Share on other sites More sharing options...
[email protected] Posted April 3, 2019 Author Share Posted April 3, 2019 def Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 3, 2019 Share Posted April 3, 2019 Best practice is to understand both solutiont and choose one that you like, and that's true for many pixi cases. And you dont need `new` if you call a static function, it doesn't matter Quote Link to comment Share on other sites More sharing options...
[email protected] Posted April 3, 2019 Author Share Posted April 3, 2019 def 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.