OrbTk extensions for 2D game development.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Florian Blasius e952805c20 Create camera builder and write tests. 3 months ago
.vscode [example] start with game menu of dungeon example. 8 months ago
crates Create camera builder and write tests. 3 months ago
examples OrbTk update. 3 months ago
src Add sub crates api, utils, widgets. 3 months ago
.gitignore [update] initial step of the orbtk next port 8 months ago
.gitlab-ci.yml Restart on OrbTk next. 9 months ago
Cargo.lock Start with tilemap widget. 3 months ago
Cargo.toml Add sub crates api, utils, widgets. 3 months ago
LICENSE Initial commit. 1 year ago
README.md Start with tilemap widget. 3 months ago

README.md

OrbGame

OrbTk extensions for 2D game development. Compatible with Redox and SDL2.

Build status MIT licensed

Usage

To include orbgame in your project, just add the dependency line to your Cargo.toml file:

orbgame = { git = "https://gitlab.redox-os.org/redox-os/orbgame.git" }

However you also need to have the SDL2 libraries installed on your system. The best way to do this is documented by the SDL2 crate.

Minimal Example

use orbgame::prelude::*;

fn main() {
    Game::new()
        .window(|ctx| {
            Window::create()
                .title("OrbGame - minimal example")
                .position((100.0, 100.0))
                .size(420.0, 730.0)
                .child(TextBlock::create().text("OrbGame").build(ctx))
                .build(ctx)
        })
        .run();
}

Additional Examples

You find the examples in the examples/ directory.

You can start the widgets example by executing the following command:

cargo run --example dungeon --release

Additional Examples on Web

To run the examples on a browser you have to install

cargo install -f cargo-web

Run

You can start the dungeon example by executing the following command:

  • Compile to WebAssembly using Rust’s native WebAssembly backend:
cargo web start --target=wasm32-unknown-unknown --auto-reload --example dungeon
  • Compile to asm.js using Emscripten:
$ cargo web start --target=asmjs-unknown-emscripten --auto-reload --example dungeon
  • Compile to WebAssembly using Emscripten:
$ cargo web start --target=wasm32-unknown-emscripten --auto-reload --example dungeon

Build and run documentation

You can build and run the latest documentation y executing the following command:

cargo doc --no-deps --open

Sub Crates

  • api: additional game elements
  • utils: Game helper structs and traits
  • widgets: Game widget library

## Credits