src code

constructor new Spriteset

new Spriteset(path, spriteWidth, spriteHeight[, callback = null])
  • path (String) – The absolute or relative path of the Image resource to load. A relative path using new will be relative to the current page. To get a resource relative to your game root, use Game#getSpriteset instead.
  • spriteWidth (Number) – The width in pixels of each sprite on the spriteset. If you are loading a single sprite, this should be the width of the image itself.
  • spriteHeight (Number) – The height in pixels of each sprite on the spriteset. If you are loading a single sprite, this should be the height of the image itself.
  • callback (Function) – Optional. A Function to invoke when the image loading process has completed, successfully or not. If an error occured (ex: file not found), an Error object will be passed as the first argument to callback.

To create an instance of a Spriteset, you must first know the relative path of the image file in your game folder, and you must know the width and height of each sprite in pixels on this Spriteset.

Once instantiated, there are no instance methods to call, you just need to pass the Spriteset reference to new Sprites.