Overview

HTTPS SSH

Rainbow codecov

Rainbow is a fast, scriptable, cross-platform, 2D game engine written in modern C++.

Copyright © 2010-present Bifrost Entertainment AS and Tommy Nguyen.

Distributed under the MIT License (see accompanying file LICENSE or copy at https://opensource.org/licenses/MIT). Licenses for third-party software can be found in file THIRDPARTY.

Features

Cross-platform

Rainbow runs on most popular operating systems:

Android iOS Linux/macOS Windows
Linux build Status<br />*nix build status Windows build status

Audio

Rainbow integrates FMOD Studio, giving you access to the same professional tools that AAA studios use. There is also an open source alternative built on OpenAL. Audio format support depends on the platform. Typically, MP3 and Ogg Vorbis on Android, and AAC, ALAC, and MP3 on iOS and macOS.

Graphics

Rainbow is mostly built on OpenGL ES 2.0 and features:

  • Sprites-based rendering with explicit batching
  • Animation with traditional sprite sheets, or…
  • Skeletal animation imported directly from Spine
  • Text rendering (supports TrueType and OpenType via FreeType)
  • Texture atlas (DDS, PNG, PVRTC, and SVG)

Input

  • Accelerometer (Android and iOS)
  • Keyboard and mouse (Linux/macOS/Windows)
  • Microphone (Android and iOS)
  • Touch (Android and iOS)

And more…

  • Lua scripting language with debugging console and hot reloading
  • 2d rigid body physics provided by Box2D

Structure

build/  # Build related files
demos/  # Lua demos
doc/    # Documentation
lib/    # Third party libraries Rainbow depend on
lua/    # Lua convenience libraries
src/    # Rainbow source code
tools/  # Tools such as the build script

Building

First of all, clone the repository:

git clone --recursive https://bitbucket.org/tido/rainbow.git

The repository only includes some of the libraries required to build Rainbow. The remaining requisites are listed in each platform's section below. They must be installed or copied into the repository before you can start building Rainbow.

More details can be found in the documentation.

On Linux/macOS

Easiest way to build Rainbow is to use the provided build scripts:

mkdir rainbow-build
cd rainbow-build
/path/to/rainbow/tools/build.sh [platform] [options]

Run build.sh help to get an overview of options and configurations. platform can be omitted if compiling a native build (i.e. not cross-compiling).

If you have problems running build.sh, please make sure it has execution permission:

chmod +x /path/to/rainbow/tools/build.sh

On Windows

Run the PowerShell script tools\make.ps1 (right-click on it and select Run with PowerShell). It will take you through the steps.

Learning

Check out the documentation here or under doc, and the demos under demos. Note: In order to run a demo, you'll need to copy some files from lua into the folder of the demo you want to run. It's easier to copy all even if you won't need everything.

Some demos may use resources that (unfortunately) cannot be distributed with Rainbow.

Once you've copied all the necessary files, run rainbow inside the folder:

cd /path/to/demo
rainbow

Or with the path as argument:

rainbow /path/to/demo