Raptisha Posted February 21, 2017 Share Posted February 21, 2017 Hello boys and girls! Is it possible to access local files, images in particular, upload them, and use in the game as a sprite? For example, player clicks a button, opens up a file dialog, chooses an images and uploads it. Later that image is going to used a background or something like that. Link to comment Share on other sites More sharing options...
16patsle Posted February 21, 2017 Share Posted February 21, 2017 You could use a file input element in HTML and get the selected file as a blob. You should be able to create a new entry in the Phaser Cache, but I suppose you would need to use some private methods and manually create a PIXI.Texture from the blob. Link to comment Share on other sites More sharing options...
16patsle Posted February 21, 2017 Share Posted February 21, 2017 Alternatively you could upload the files to a server and download them with the usual Phaser.Loader with the url to the image. In that case you would need to do som server side stuff. Link to comment Share on other sites More sharing options...
samme Posted February 21, 2017 Share Posted February 21, 2017 https://developer.mozilla.org/en-US/docs/Web/API/File Link to comment Share on other sites More sharing options...
Recommended Posts