All Projects → optozorax → egui-macroquad

optozorax / egui-macroquad

Licence: Apache-2.0, Unknown licenses found Licenses found Apache-2.0 LICENSE-APACHE Unknown LICENSE-MIT
egui bindings for macroquad

Programming Languages

rust
11053 projects
shell
77523 projects

Projects that are alternatives of or similar to egui-macroquad

rgis
Performant, cross-platform (web, desktop) GIS app written in Rust
Stars: ✭ 79 (+61.22%)
Mutual labels:  egui
copy-translator
简单、轻量、好用的划词翻译软件
Stars: ✭ 979 (+1897.96%)
Mutual labels:  egui
procedural-spider
Small game where you play a big spider chasing small spiders, written in Rust and Macroquad.
Stars: ✭ 16 (-67.35%)
Mutual labels:  macroquad
headlines
[WIP] A simple news reading GUI app built in Rust
Stars: ✭ 92 (+87.76%)
Mutual labels:  egui
Loqui
A Harmony client made with Rust using the egui GUI library.
Stars: ✭ 41 (-16.33%)
Mutual labels:  egui
FishFight
Tactical 2D shooter in fishy pixels style. Made with Rust-lang and Macroquad 🦀🌶
Stars: ✭ 631 (+1187.76%)
Mutual labels:  macroquad
fishgame-macroquad
"Fish Game" for Macroquad is an online multiplayer game, created as a demonstration of Nakama, an open-source scalable game server, using Rust-lang and the Macroquad game engine.
Stars: ✭ 123 (+151.02%)
Mutual labels:  macroquad

egui bindings for macroquad

Latest version Documentation MIT Apache

This is the easiest way to use egui. Just two functions!

Web demo.

Usage

You need to call ui when you need to get information from ui. Then, only after that function you must call draw function when you need to draw egui contents. All this functions should be called each frame and once per frame.

Here is the small example on how to use this library:

use macroquad::prelude::*;

#[macroquad::main("egui with macroquad")]
async fn main() {
    loop {
        clear_background(WHITE);

        // Process keys, mouse etc.

        egui_macroquad::ui(|egui_ctx| {
            egui::Window::new("egui ❤ macroquad")
                .show(egui_ctx, |ui| {
                    ui.label("Test");
                });
        });

        // Draw things before egui

        egui_macroquad::draw();
        
        // Draw things after egui

        next_frame().await;
    }
}

Building

Building for native and for web works just as in macroquad. You can read about it here. Or you could look at building example at egui-miniquad.

But for wasm you will need to include two more .js files, which is plugins for quads, instruction is written here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].