Jump to content

Loading image assets from CDN


zakhov
 Share

Recommended Posts

Hi,
I'm a bit a new to Panda.JS. 
is there a way to load up image assets stored on a CDN?  e.g Amazon

 

In Phaser it's something like this:

Remove the next 2 lines if running locally            this.load.baseURL = 'http://files.phaser.io.s3.amazonaws.com/codingtips/issue008/';            this.load.crossOrigin = 'anonymous';            this.load.image('alien', 'assets/ufo.png');

Is there a similar way to achieve this with Panda.js?

 

Thanks

Link to comment
Share on other sites

Hi!

 

This will be possible on Panda Engine 2, like this:

game.addAsset('http://files.phaser.io.s3.amazonaws.com/codingtips/issue008/assets/ufo.png', 'ufo');game.createScene('Main', {    init: function() {        var sprite = new game.Sprite('ufo');        sprite.addTo(this.stage);    }});
Link to comment
Share on other sites

Thanks for the reply. Tested it and loading assets from CDN indeed works great with the Panda 2 Engine.

I suppose there's no harm in me using this as our base engine in it's current state.

 

On a side note,

If I were to use a source code of a game made with pre-2.0 engine as a starting in learning Panda, do I have to make a lot of changes to the code?

 

Keep up the good work!  :)

Link to comment
Share on other sites

  • 3 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...