Screenshots (click to enlarge)
Default startup window
This is the default window which is shown if Scrupp is executed without arguments. It is defined in the file main.slua whose code is printed below. No plugins are used, therefore the images that contain the texts have to be generated manually.
local width, height = 640, 480
scrupp.init("Scrupp", width, height, 32, false)
-- loading fonts
Fonts = {
scrupp.addFont("fonts/Vera.ttf", 28),
scrupp.addFont("fonts/Winks.ttf", 150),
}
-- generating images
Images = {
Fonts[1]:generateImage{"Welcome to"},
Fonts[2]:generateImage{"Scrupp", color={190,0,0}},
Fonts[1]:generateImage{"Just change 'main.slua' to suit your needs!"}
}
main = {
render = function(dt)
Images[1]:render((width-Images[1]:getWidth())/2,80)
Images[2]:render((width-Images[2]:getWidth())/2,150)
Images[3]:render((width-Images[3]:getWidth())/2,350)
end,
keypressed = function(k)
if k == "ESCAPE" then
scrupp.exit()
end
end
}
Cairo support
These are screenshots from the sample scripts of the Cairo binding lua-oocairo. The scripts were modified to output the result to a Scrupp window. The script files of these examples are part of the Scrupp distribution.
Movie support
Scrupp supports the playback of MPEG-1 movies. The second screenshot shows the hardware accelerated scaled, rotated and transparent rendering of the same movie.
The movie is (c) copyright Blender Foundation | www.bigbuckbunny.org
Platform independence and error box
If an error occurs in one of the Lua scripts, a message box shows up containing the error message, the location and a traceback. This helps to find the faulty piece of code in no time. The screenshots show examples of such an error box on Linux, Mac OS X and Windows.
Full UTF-8 support
Scrupp has full support for utf-8 encoded text. The only requirement is a truetype font which supports the needed glyphs. In this example the excellent DejaVuSans.ttf from the DejaVu project has been used. This font is not part of the Scrupp package.
Examples
These are two example programs written by Michal Kolodziejczyk. The first one is a paddle game (well, not hard to guess). The second one is a viewer for maps from the OpenStreetMap project. It's using LuaSocket to download the image files. Consider it work in progress.