egui-tetra is a library that helps integrate egui

Overview

egui-tetra

crates.io | docs

egui-tetra is a library that helps integrate egui, an immediate mode GUI library, with Tetra, a 2D game framework.

Basic example

Result<(), Box > { tetra::ContextBuilder::new("example", 800, 600) .build()? .run(|_| Ok(egui_tetra::StateWrapper::new(MainState))) } ">
use std::error::Error;

struct MainState;

impl egui_tetra::State<Box<dyn Error>> for MainState {
	fn ui(
		&mut self,
		ctx: &mut tetra::Context,
		egui_ctx: &egui::CtxRef,
	) -> Result<(), Box<dyn Error>> {
		egui::Window::new("hi!").show(egui_ctx, |ui| {
			ui.label("Hello world!");
		});
		Ok(())
	}
}

fn main() -> Result<(), Box<dyn Error>> {
	tetra::ContextBuilder::new("example", 800, 600)
		.build()?
		.run(|_| Ok(egui_tetra::StateWrapper::new(MainState)))
}

License

This project is licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in time by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

You might also like...
A Rust wrapper and bindings of Allegro 5 game programming library

RustAllegro A thin Rust wrapper of Allegro 5. Game loop example extern crate allegro; extern crate allegro_font; use allegro::*; use allegro_font::*;

High performance Rust ECS library
High performance Rust ECS library

Legion aims to be a feature rich high performance Entity component system (ECS) library for Rust game projects with minimal boilerplate. Getting Start

Rust library to create a Good Game Easily

ggez What is this? ggez is a Rust library to create a Good Game Easily. The current version is 0.6.0-rc0. This is a RELEASE CANDIDATE version, which m

Rust bindings for libtcod 1.6.3 (the Doryen library/roguelike toolkit)

Warning: Not Maintained This project is no longer actively developed or maintained. Please accept our apologies. Open pull requests may still get merg

A dependency-free chess engine library built to run anywhere.
A dependency-free chess engine library built to run anywhere.

♔chess-engine♚ A dependency-free chess engine library built to run anywhere. Demo | Docs | Contact Me Written in Rust 🦀 💖 Why write a Chess engine?

Scion is a tiny 2D game library built on top of wgpu, winit and legion.
Scion is a tiny 2D game library built on top of wgpu, winit and legion.

Scion is a 2D game library made in rust. Please note that this project is in its first milestones and is subject to change according to convience need

Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)

webview A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. Also, there are Rust bindings, Python bindings, Ni

Atomic Physics Library

Iridium Atomic Physics Library Attempt at making a atomic database. Uses Nubase2020, ENSDF for decay chains, atomic masses, and half-lives. Nubase2020

Minecraft Protocol Library

Protocol Minecraft Protocol Library This branch is dedicated to the Minecraft Bedrock Edition Protocol. If you have any concerns or questions you can

Comments
  • Responsive maintainer?

    Responsive maintainer?

    Hello, I just wanted to know whither or not the maintainer of this repo is responding to PRs. I want to update this project to be compatible with tetra 0.7.0, so @tesselode can publish a new release of this crate.

    If he isn't responding to the PR, I would upload the crate myself by forking it.

    opened by TimerErTim 6
Releases(v0.3.0)
  • v0.3.0(Jan 7, 2022)

  • v0.2.1(Sep 18, 2021)

  • v0.2.0(Sep 18, 2021)

    Improvements:

    • Fix UI not rendering correctly when using fixed timestep with vsync disabled
    • Implement Default for EguiWrapper
    • Update egui to 0.14.0
    • Update open to 2.0.1

    Breaking changes

    • Remove OpenError and change Error::OpenError to contain an std::io::Error
    • EguiWrapper::end_frame now takes a &mut tetra::Context argument
    • EguiWrapper::draw_frame no longer returns a Result
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Jun 26, 2021)

Owner
Game developer and musician.
null
An easy way to integrate @rhaiscript with @bevyengine.

Bevy Rhai What is Bevy Rhai? Bevy Rhai is an easy way to integrate and use Rhai with Bevy. It provides everything you need to get started, all you nee

Leon Davis 10 Jun 12, 2022
A barebones example of how to integrate OpenXR with wgpu (Vulkan-only)

wgpu-openxr-example a barebones example of how to integrate OpenXR with wgpu (Vulkan-only) It has four modes: cargo run --no-default-features: desktop

Philpax 21 Dec 15, 2022
"putzen" is German and means cleaning. It helps keeping your disk clean of build and dependency artifacts safely.

Putzen "putzen" is German and means cleaning. It helps keeping your disk clean of build and dependency artifacts safely. About In short, putzen solves

Sven Assmann 2 Jul 4, 2022
Libium is the backend of Ferium. It helps manage Minecraft mods from Modrinth, CurseForge, and Github Releases

Libium Libium is the backend of Ferium. It helps manage Minecraft mods from Modrinth, CurseForge, and Github Releases There are 3 main components in L

Ilesh Thiada 14 Dec 13, 2022
3d transformation gizmo built on top of the egui library.

egui-gizmo 3d transformation gizmo built on top of the egui library. Try it out in a web demo Usage let gizmo = Gizmo::new("My gizmo") .view_matri

Urho Laukkarinen 69 Dec 10, 2022
A plugin for Egui integration into Bevy

bevy_egui This crate provides a Egui integration for the Bevy game engine. Features: Desktop and web (bevy_webgl2) platforms support Clipboard (web su

Vladyslav Batyrenko 453 Jan 3, 2023
Show puffin profiler flamegraph in-game using egui

Show puffin profiler flamegraph in-game using egui puffin is an instrumentation profiler where you opt-in to profile parts of your code: fn my_functio

Emil Ernerfeldt 44 Jun 3, 2022
An egui backend for godot-rust

Godot Egui An egui backend for godot-rust. Rationale Godot has a perfectly valid GUI system, so why egui? Here are my personal reasons: Simplicity: No

null 109 Jan 4, 2023
API tool,but egui style and rusty

WEAVER About Weaver is a simple,easy-to-use and cross-platform API tool.Inspired by hoppscotch . It uses the Rust egui GUI library. Features Get,Post

will 14 Dec 11, 2022
Generic and extensible egui widgets to create analog synthesizer-like UI with data-oriented API

egui_cable A generic and extensible data-oriented widget for connecting ports by cables. I create this for the visual programming editor of Hihaheho/D

Ryo Hirayama 44 Dec 30, 2022