Sprite functions in NTT

Standard:





Tweaked:

sprite_get_name(sprite)​

Sprites added through sprite_add and alike will have their name set based on file name.

sprite_add(path, subimages, x, y)​

The function had its removeback and smooth arguments removed as those have been scarcely used after GameMaker 7.

sprite_replace(sprite, path, subimages, ?x, ?y)

Similar to above, but also xorigin / yorigin arguments are now optional in case you are replacing a sprite with a same-sized one.

Non-standard:

sprite_add_base64(base64, subimages, x, y)​

Adds a sprite from a base64 string (without the data:image/png;base64 prefix).

This is mostly convenient if your mod consists of one code file and a few sprites and you'd rather pack it all into one file.

sprite_add_weapon(path, xorig, yorig)​

Adds a single-frame weapon sprite and gives it a signature weapon shine animation.

Weapon sprites are most often added this way.

sprite_add_weapon_base64(base64, xorig, yorig)​

sprite_replace_base64(sprite, base64, subimages, ?x, ?y)
sprite_replace_image(sprite, path, subimage, ?x, ?y)

Replaces a single subimage of a sprite. A convenience function.

sprite_replace_image_base64(sprite, base64, subimage, ?x, ?y)
sprite_duplicate_ext(sprite, subimg_start, subimg_count)​

Creates a new sprite that contains copies of specific frames of another sprite.

sprite_restore(sprite)​

Undoes whatever changes made by sprite_replace and alike.

Returns whether there was anything to undo.