Overview

HTTPS SSH

Rainbow

Code coverage Build status macOS/Linux/Android/iOS build status macOS build status

Rainbow is a fast, scriptable, cross-platform, 2D game engine written in modern C++. Games can be written in both C++ and JavaScript (but you really should make your life easier and try TypeScript). Check out the examples below.

[Documentation] Get started. It's a good place to start learning what you can do with Rainbow.

[Forum] Get answers, or even better, share your awesome work!

[Roadmap] Find planned features and future directions.

Rainbow currently runs on the following platforms:

  • [x] Windows
  • [x] macOS
  • [x] Linux
  • [x] Android
  • [x] iOS

We even have a prototype that runs in your browser. Give it a try!

Examples

Label

const label = new Rainbow.Label();
label.setAlignment(Rainbow.TextAlignment.Center);
label.setFont("OpenSans-Light.ttf");
label.setFontSize(60);
label.setPosition({ x: screenWidth * 0.5, y: screenHeight * 0.55 });
label.setText("Hello\nWorld");

Rainbow.RenderQueue.add(label);

Sprite Sheet Animation

const texture = new Rainbow.Texture("monkey.png");
const frames = [
  texture.addRegion(400, 724, 104, 149);
  texture.addRegion(504, 724, 104, 149);
  texture.addRegion(608, 724, 104, 149);
  texture.addRegion(712, 724, 104, 149);
  texture.addRegion(816, 724, 104, 149);
  texture.addRegion(920, 724, 104, 149);
];

const batch = new Rainbow.SpriteBatch(1);
batch.setTexture(texture);

const sprite = batch.createSprite(104, 149);
sprite.setPosition({ x: screenWidth * 0.5, y: screenHeight * 0.5 });

const animation = new Rainbow.Animation(sprite, frames, 6, 0);
animation.start();

Rainbow.RenderQueue.add(batch);
Rainbow.RenderQueue.add(animation);

Structure

rainbow
├── build    # Build related files
├── doc      # Documentation
├── include  # Public Rainbow headers
├── js       # JavaScript playground
├── lib      # Third party dependencies
├── src      # Rainbow source code
└── tools    # Build scripts, JS bindings generator, and other tools...

Contribute

Dependencies

License

Copyright (c) 2010-present Bifrost Entertainment AS and Tommy Nguyen.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.