You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I essentially wanted to migrate some assets from the github repo to an external source (Azure Blob Storage), and found that there's no way to set the base url to just affect the pack file (seems like adding a baseURL to the json/trying out on listeners also doesn't work). Adding https:// to the filepack json also doesn't seem to do anything, it uses the baseURL (localhost:3000/local url). setBaseURL also inevitably changes the baseURL for local assets as well, as shown in the reproduction below. Is there any way that's been exposed by phaser to properly load both remote and local assets in the preloader? I also found that the types for pack function to be incorrect, it only allows url, when it also allows the pack object which is what I need to use as I cannot just use a url due to nuxt/phaser path resolution conflicts and also code style reasons.
Please ignore CORS errors and check the console, it will load (200 OK) for all the remote resources currently, but not work for local asset (a google image) as setBaseURL as overriden the local url.
Additional Information
The text was updated successfully, but these errors were encountered:
In the sandbox, a file pack section has baseURLhttps://cdn.phaser.io/sandbox/ and a file with urlsquare-earth.png. It should be downloaded from https://cdn.phaser.io/sandbox/square-earth.png but instead it's downloaded from https://phasersandbox.com/square-earth.png.
I think the cause is that addPack() sets the loader's baseURL temporarily while adding files from a pack section, but for File files the loader actually applies baseURL when the file starts loading. (path is applied to a File URL when added, however, so setting path in a file pack section will work as expected.) MultiFile files may work differently, I'm not sure.
Version
Description
Existing forum discussion: https://phaser.discourse.group/t/how-to-load-packfile-with-remote-assets-and-local-assets-in-preload/15141/7
So I essentially wanted to migrate some assets from the github repo to an external source (Azure Blob Storage), and found that there's no way to set the base url to just affect the pack file (seems like adding a baseURL to the json/trying out on listeners also doesn't work). Adding
https://
to the filepack json also doesn't seem to do anything, it uses the baseURL (localhost:3000/local url).setBaseURL
also inevitably changes thebaseURL
for local assets as well, as shown in the reproduction below. Is there any way that's been exposed by phaser to properly load both remote and local assets in the preloader? I also found that the types forpack
function to be incorrect, it only allows url, when it also allows the pack object which is what I need to use as I cannot just use a url due to nuxt/phaser path resolution conflicts and also code style reasons.Example Test Code
https://stackblitz.com/edit/github-gzbuzr-udsq5dxy?file=models%2FStartScene.ts
Please ignore CORS errors and check the console, it will load (200 OK) for all the remote resources currently, but not work for local asset (a google image) as
setBaseURL
as overriden the local url.Additional Information
The text was updated successfully, but these errors were encountered: