Jambutters Posted May 27, 2017 Share Posted May 27, 2017 What are the things that differentiate the two ? Example: let texture = PIXI.loader.resources("player.png).texture; let otherTexture = new PIXI.Texture(PIXI.loader.resources("player.png).texture); I assumed they were the same thing and I don't understand the mechanisms behind the two. Quote Link to comment Share on other sites More sharing options...
xerver Posted May 27, 2017 Share Posted May 27, 2017 The texture you are reading from the loader's resource is a PIXI.Texture instance. When you do new PIXI.Texture and pass in the other texture, it is just creating a new texture instance that uses the same base texture of the first one you passed in. The end result of your code above is two texture instances with the same baseTexture. Not super useful unless you want the same image but different frame values (like in a spritesheet). 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.