Class which holds information for images and animations.
This class stores images and information about how SGE is to use those images.
What image formats are supported depends on the implementation of SGE, but image formats that are generally a good choice are PNG and JPEG. See the implementation-specific information for a full list of supported formats.
Attributes:
Read-Only Attributes:
Create a new Sprite object.
Arguments:
name – The base name of the image files, used to find all individual image files that make up the sprite’s animation in the paths specified in sge.image_directories. One of the following rules will be used to find the images:
If none of the above rules can be used, IOError is raised.
id – The unique identifier of the sprite. If set to None, name will be used, modified by SGE if it is already the unique identifier of another sprite.
All other arguments set the respective initial attributes of the sprite. See the documentation for Sprite for more information.
Draw a single-pixel dot on the sprite.
Arguments:
Draw a line segment on the sprite.
Arguments:
Draw a rectangle on the sprite.
Arguments:
Draw an ellipse on the sprite.
Arguments:
Draw a circle on the sprite.
Arguments:
Draw another sprite on the sprite.
Arguments:
Draw text on the sprite.
Arguments:
Erase everything from the sprite.
Arguments:
Save the sprite to an image file.
Arguments:
If the sprite has multiple frames, the image file saved will be a horizontal reel of each of the frames from left to right with no space in between the frames.
Return the current display on the screen as a sprite.
Arguments:
If you only wish to save a screenshot (of the entire screen) to a file, the easiest way to do that is::
sge.Sprite.from_screenshot().save(“foo.png”)