Scene Preload an Image

command format: Example:this.load.image("key", "path");
Description:Use this in the scene.preload function. .png are the default images. You can also set the "base URL"
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
// ============ // Example 3.4: Additional Phaser Properties begins // ============ // remote URL to game assets // Cross-origin resource sharing (CORS) this.load.setCORS = 'anonymous'; // Setting base URL path this.load.setBaseURL(''); // Preload a gfx asset this.load.image("face", "face.png");
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus