wonlab Posted February 17, 2015 Share Posted February 17, 2015 i have character classes which refer PIXI.texture. i wanted to each character classes have texture instance. but when i create texture PIXI.js refer texturecache. so when i use texture.setframe, other character classes's frame changed. can anyone give me an advice? Quote Link to comment Share on other sites More sharing options...
xerver Posted February 17, 2015 Share Posted February 17, 2015 Sounds like you are using something like Texture.fromImage(). Instead, create the texture directly (new Texture(baseTexture)). Quote Link to comment Share on other sites More sharing options...
wonlab Posted February 18, 2015 Author Share Posted February 18, 2015 id like to create only one texture and use several frame. is it possible? Quote Link to comment Share on other sites More sharing options...
xerver Posted February 18, 2015 Share Posted February 18, 2015 A BaseTexture represents an Image, a Texture is the frame into that image. Like I said, create the base Texture from an image, then pass it into the ctor for however many Textures you want. 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.