Makes a sprite based on the image with the initial contents from the Image
A destructor is present on this object, but not explicitly documented in the source.
Call this when you're ready to get rid of it
Draws the image on the specified painter at the specified point. The point is the upper-left point where the image will be drawn.
Copies the sprite's current state into a TrueColorImage.
Be warned: this can be a very slow operation
On X11, this corresponds to an XPixmap. On Windows, it still uses a bitmap, though I'm not sure that's ideal and the implementation might change.
You create one by giving a window and an image. It optimizes for that window, and copies the image into it to use as the initial picture. Creating a sprite can be quite slow (especially over a network connection) so you should do it as little as possible and just hold on to your sprite handles after making them. simpledisplay does try to do its best though, using the XSHM extension if available, but you should still write your code as if it will always be slow.
Then you can use sprite.drawAt(painter, point); to draw it, which should be a fast operation - much faster than drawing the Image itself every time.
Sprite represents a scarce resource which should be freed when you are done with it. Use the dispose method to do this. Do not use a Sprite after it has been disposed. If you are unsure about this, don't take chances, just let the garbage collector do it for you. But ideally, you can manage its lifetime more efficiently.
Update: on April 23, 2021, I finally added alpha blending support. You must opt in by setting the enableAlpha = true in the constructor.
Sprites are optimized for fast drawing on the screen, but slow for direct pixel access. They are best for drawing a relatively unchanging image repeatedly on the screen.