Rob Gordon Posted November 11, 2020 Share Posted November 11, 2020 This is really more of a comment than a question since I needed a solution for version-controlling a spritesheet and couldn't see a straightforward way of doing it. To version-control the json file, I do this: var file = [{name:"ui", url:"ui.json?v=1"}] Now, the PIXI Loader will automatically load the image file and internally append "_image" to its name...but it will *not* carry over the "?v=1" part to the url. A solution to this problem is to use the 'pre' middleware to modify the url of the file, as follows: Loader .add(file) .pre(preProcessor) .load(); function preProcessor(resource, next) { if (resource.name == "ui_image") { resource.url = resource.url.split("?")[0] + "?v=1"; } next(); } I'll leave this here for further comment or as an example of a working solution to this kind of problem. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 11, 2020 Share Posted November 11, 2020 Yeah, ewhen we intgrate resource-loader v4 there will be special "url resolver" thingy for it Quote Link to comment Share on other sites More sharing options...
Rob Gordon Posted November 12, 2020 Author Share Posted November 12, 2020 Good to know! Is that a 5.4 feature or a v6 feature? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 12, 2020 Share Posted November 12, 2020 5.5 probably. 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.