LuaSprite Reference
LuaSprite is an environment that allows you to run Lua programs with support for graphics operations.
Currently LuaSprite runs with support for SDL which is the Simple Direct Media Layer.
LuaSprite uses double buffering to allow drawing complicated images without flickering.
All drawing operations occur in the offscreen buffer, which is copied to the display buffer, onscreen, using
the SpRender call.
- SpNumString - This draws a string and number, and is useful as a debugging method.
- SpSetForeColor - This sets the foreground color for use by drawing operations.
- SpSetBackColor - This sets the background color or use by drawing operations.
- SpPutPixel - This sets a single pixel to the foreground color.
- SpDrawLine - This draws a line in the foreground color.
- SpDrawRect - This draws a rectangle boundary in the foreground color.
- SpFillRect - This fills a rectangle with the foreground color.
- SpEraseRect - This clears a rectangle, filling it with the background color.
- SpDrawCircle - This draws a circle in the foreground color.
- SpRender - Update the display buffer with the offscreen double buffer. This causes all drawing operations since the last
call to SpRender to take effect.
- SpStringWidth - Calculate the display width of a string of characters in the supported font.
- SpDrawString - Draw a string at the specified location.
- SpMilliSleep - Sleep for a specific number of milliseconds.
- SpLoadGraphicsBuffer - Load RGBA 32-bit image data from a file into new offscreen buffer. The returned buffer must be released with SpReleaseGraphicsBuffer.
- SpReleaseGraphicsBuffer - Release a buffer created with SpLoadGraphicsBuffer.
- SpDrawGraphicsBuffer - Draw an graphics buffer, such as created by SpLoadGraphicsBuffer, to the double buffer.
- SpPollEvent - Poll for an event from the keyboard or mouse.
- SpScreenSize - Get the dimensions of the display. This is the size of the window SDL is using if not operating in fullscreen mode.