LoadSpriteset

From Spheriki

Jump to: navigation, search

Loads a Spriteset from a file.


Contents

Usage

Spriteset LoadSpriteset(filename);
  • filename string. The path to the file to load.
  • Spriteset is returned, loaded from the given file.


Examples

To load the spriteset bob.rss in the spritesets directory and assign it to a person named "Bob":

var ss = LoadSpriteset("bob.rss");
SetPersonSpriteset("Bob", ss);

That's all there is to it!


Notes

  • If Sphere can't open the file, the engine will give an error message and exit.
  • This function follows the same rules as other file-based functions. It allows loading from other places in the game directory using the ../ path prefix, as well as from /common/ to load from the Sphere common directory.
  • If you're setting people on a map, and you expect their spritesets to remain the same, you should set the spritesets while editing the map instead of using this. Use this function to dynamically load spritesets when the default is unknown or needs to be changed.


See also

Personal tools