Source Academy Modules
    Preparing search index...

    Function create_sprite

    • Creates a GameObject that contains a Sprite image reference. Source Academy assets can be used by specifying path without the prepend. Source Academy assets can be found at https://source-academy-assets.s3-ap-southeast-1.amazonaws.com/ with Ctrl+f '.png'. Phaser assets can be found at https://labs.phaser.io/assets/. If Phaser assets are unavailable, go to https://github.com/photonstorm/phaser3-examples/tree/master/public/assets to get the asset path and append it to https://labs.phaser.io/assets/. Assets from other websites can also be used if they support Cross-Origin Resource Sharing (CORS), but the full path must be specified.

      Parameters

      • image_url: string

        The image URL of the sprite

      Returns SpriteGameObject

      const shortpath = create_sprite('objects/cmr/splendall.png');
      const fullpath = create_sprite('https://source-academy-assets.s3-ap-southeast-1.amazonaws.com/objects/cmr/splendall.png');