Wynell Posted January 26, 2021 Share Posted January 26, 2021 (edited) Hello! When I load a texture using app.loader.add() or PIXI.Texture.from(), it's saved in the Texture Cache so the next time the client won't make a request to get the image. This is all I know. > So instead of saving a texture into a variable, is it a good idea to call PIXI.Texture.from() every time as it will take it from the cache further times anyway? Or check PIXI.utils.TextureCache? Or what else way is good? > If I change the texture properties (width, defaultAnchor etc.), what will this affect other than exactly this instance of the texture obtained with PIXI.Texture.from()? (For example, I loaded a texture, increased its width and what will be its width the next time I load it using PIXI.Texture.from()?) > If I change the texture.baseTexture properties, what will this affect other than ex > How baseTextures work in the Cache at all? > What if I want to reload the image from the server when it's already saved in the cache? Edited January 26, 2021 by Wynell ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 27, 2021 Share Posted January 27, 2021 (edited) PIXI.utils.TextureCache has no special logic. If it doesnt work for you - you have to search it through pixi source code and figure out. Because, honestly, every time I have problems with it - I do exactly that, its not possible to remember, its a business-logic-like thing. Some people empty the cache every time and use their own storage. Its possible to use purely "PIXI.Loader" without any caching. Even "caching" here means not GPU cache or something like that - no, its just a MAP that stores TEXTURE_NAME->TEXTURE pairs, same for basetexture. Entries are not immutable, you change one field - it will stay changed like that, you have to create another Texture with same BaseTexture and "frame" if you want to change something Edited January 27, 2021 by ivan.popelyshev 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.