No description
Find a file
2020-04-20 10:54:57 +02:00
docs Refactor example code 2020-04-12 12:07:51 +02:00
emigui Resize windows based on cursor position rather than movement 2020-04-20 10:54:57 +02:00
emigui_glium Fix colors in glium (srgb issue) 2020-04-16 23:10:42 +02:00
emigui_wasm New font: Comfortaa 2019-03-16 13:37:29 +01:00
example_glium Show resize mouse cursor when resizing windows 2020-04-20 10:01:13 +02:00
example_wasm Refactor Region: remember region rectangle 2020-04-20 00:48:54 +02:00
.gitignore No typescript. Just one index.html + wasm. 2019-01-05 22:55:09 +01:00
build_and_run.sh Update rusttype and run cargo update 2019-11-02 10:15:06 +01:00
build_wasm.sh Build WASM in release 2020-04-12 12:02:44 +02:00
Cargo.lock Switch to parking_lot::Mutex 2020-04-18 09:32:39 +02:00
Cargo.toml Minor API improvements 2019-04-25 18:07:36 +02:00
lint.sh No typescript. Just one index.html + wasm. 2019-01-05 22:55:09 +01:00
OFL.txt New font: Comfortaa 2019-03-16 13:37:29 +01:00
README.md Remove roadmap and replace with emigui/README.md with a TODO section 2020-04-19 11:15:35 +02:00
start_server.sh Refactor example code 2020-04-12 12:07:51 +02:00
TODO.md Refactor example code 2020-04-12 12:07:51 +02:00

Emigui

(Experimental, Modularized Immediate mode Graphical User Interface)

An immediate mode GUI library written in Rust. For web apps or native apps.

Goals:

  • Easy to use
  • Platform independent (the same code works on the web and as a native app)
  • Responsive

How it works:

Loop:

  • Gather input: mouse, touches, screen size, ...
  • Run application code (Immediate Mode GUI)
  • Output is a triangle mesh
  • Render with e.g. OpenGL

Available backends:

Wherever you can render textured triangles you can use Emigui.

Currently two backends have been tested:

  • WebAssembly (emigui_wasm) for making a web app
  • Glium for native apps (see example_glium).

The same application code can thus be compiled to either into a native app or a web app.

Demos

Emigui feature demo, (partial) source: https://github.com/emilk/emigui/blob/master/emigui/src/example_app.rs

Hobogo: A small game using Emigui, source: https://github.com/emilk/hobogo

State

Mostly a tech demo at this point. I hope to find time to work more on this in the future.

Features:

  • Text
  • Buttons, checkboxes, radio buttons and sliders
  • Horizontal or vertical layout
  • Column layout
  • Collapsible headers (sections)
  • Anti-aliased rendering of circles, rounded rectangles and lines.

Inspiration

The one and only Dear ImGui is a great Immediate Mode GUI for C++ which works with many backends. That library revolutionized how I think about GUI code from something I hated to do to something I now like to do.

Credits / Licenses

Fonts:

  • Comfortaa: Open Font License, see OFT.txt
  • ProggyClean.ttf, Copyright (c) 2004, 2005 Tristan Grimmer. MIT License. http://www.proggyfonts.net/
  • Roboto-Regular.ttf: Apache License, Version 2.0