Tilengine is an open source, cross-platform 2D graphics engine for creating classic/retro games with tile maps, sprites and palettes. Its unique scanline-based rendering algorithm makes raster effects a core feature, a technique used by many games running on real 2D graphics chips. It integrates inside the RetroArch emulator (https://www.retroarch.com/) and loads games written in lua (http://www.lua.org/).
This version has the same exact functionality than standard Tilengine, but removing the built-in window support, and adding Retroarch integration
- tilengine_libretro - The 2D retro graphics engine core for libretro
- Contents
- Features
- Minimal game template
- Running the game (Windows)
- Documentation
- Written in portable C (C99)
- MPL 2.0 license: free for any project, including commercial ones, allows console development
- Cross platform: available builds for Windows (32/64), Linux PC(32/64), Mac OS X and Raspberry Pi
- Streamlined, easy to learn API that requires very little lines of code
- Loads assets from open standard standard file formats
- Create or modify graphic assets procedurally at run time
- True raster effects: modify render parameters between scanlines
- Background layer scaling and rotation
- Sprite scaling
- Several blending modes for layers and sprites
- Pixel accurate sprite vs sprite and sprite vs layer collision detection
- Special effects: per-column offset, mosaic, per-pixel displacement, CRT emulation...
- Supports packaged assets with optional AES-128 encryption
Use this lua template for your own games:
-- required dependencies
require("tilengine_libretro")
local ffi = require("ffi")
local tln = ffi.load 'tilengine_libretro'
-- tilengine sample configuration
config = {
hres = 320,
vres = 240,
numlayers = 2,
numsprites = 80,
numanimations = 32
}
-- called once at the beginning: load game assets and init
function game_load()
end
-- called once every frame: do game logic and update visuals
function game_loop(frame)
end
-- called once at end: release resources
function game_unload()
end-- check if player 1 is pressing left input
if tln.CheckRetroInput(tln.PLAYER1, tln.INPUT_LEFT) then
end-- your custom raster function is called every scanline
function my_rasters(line)
end
-- register your raster function
tln.SetRasterCallbackName("my_rasters")To run the game, RetroArch emulator must be installed and accessible in %path%. Open a command terminal inside lua_game folder and type:
retroarch -L tilengine_libretro.dll
For extended help and examples refer to the main Tilengine project online documentation:
