rolyataylor2 Posted May 14, 2014 Share Posted May 14, 2014 Ok so like 12 koopas on screen each is the same image but a different frame. I do koopa001.texture = new PIXI.Texture.fromImage('koopa.png');koopa001.texture.setFrame(new PIXI.Rectangle(0,0,32,32));then i dokoopa002.texture = new PIXI.Texture.fromImage('koopa.png');koopa002.texture.setFrame(new PIXI.Rectangle(32,0,32,32));the problem is that koopa001.texture === koopa002.texture and when i set koopa002.texture's frame it changes koopa001.texture's frame I need 2 seperate textures from the same image..... Quote Link to comment Share on other sites More sharing options...
xerver Posted May 14, 2014 Share Posted May 14, 2014 Correct, because they are cached. You are looking to reuse the same base texture, with different frames. You are looking for this:koopa001.texture = new PIXI.Texture(PIXI.BaseTexture.fromImage('koopa.png'));Note that the .fromImage methods are not constructors, so you do not use the "new" keyword with them. Quote Link to comment Share on other sites More sharing options...
rolyataylor2 Posted May 14, 2014 Author Share Posted May 14, 2014 Thanks that helps 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.