Skip to main content

SMGF

A small framework to make crossplatform 2D games in Lua.

Code once

Games are written in Lua and can be run on macOS, Linux, Windows and on the web.

Easy to use

Minimal set of APIs to handle drawing, playing audio, handling user input (mouse, keyboard, gamepads) and file I/O in a sandboxed environment.

Free

Open source under the zlib license, which means you can use it and distribute your games freely and free of charge.

Examples

Display an image on screen
function smgf.init()
my_texture = smgf.graphics.new("my_image.png")
end

function smgf.draw()
smgf.graphics.clear()
smgf.graphics.draw(my_texture, 5, 5)
end
Play a sound on key press
function smgf.init()
sound = smgf.audio.new("sfx.wav")
end

function smgf.key_down(key)
if key == "return" then
sound:play()
end
end