d13 Posted June 2, 2014 Share Posted June 2, 2014 Hello! Sprites have both a `texture` property and a `setTexture` property that both do the same thing. Which one is better to use? Quote Link to comment Share on other sites More sharing options...
hashi Posted June 2, 2014 Share Posted June 2, 2014 Definetly using setTexture is better method, because it does a few more things than just replacing texture variable. Check this out here: http://www.goodboydigital.com/pixijs/docs/files/src_pixi_display_Sprite.js.html#l127 this method notices when old and new textures(just a region definitions on real texture?) has different baseTexture(real texture). I think it is necessary cause WebGL need to switch baseTexture currently in use and it takes some gpu. So if baseTexture are the same, we don't need to do this. d13 1 Quote Link to comment Share on other sites More sharing options...
d13 Posted June 3, 2014 Author Share Posted June 3, 2014 Thank you very much for explaining that! 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.