No description
Find a file
2020-05-24 19:33:49 +02:00
docs Remove 'Web' from GuiInput 2020-05-21 12:04:42 +02:00
emigui WIP: readable ids 2020-05-24 19:33:49 +02:00
emigui_glium Remove dropping files from emigui Input 2020-05-21 11:53:26 +02:00
emigui_wasm [refactor] collect stuff into new mod paint 2020-05-19 22:28:57 +02:00
example_glium example_glium: restore example app state 2020-05-23 09:57:39 +02:00
example_wasm Remove 'Web' from GuiInput 2020-05-21 12:04:42 +02:00
.gitignore Add a benchmark 2020-05-20 21:21:25 +02:00
build_glium.sh Add a fractal clock example to showcase painting performance 2020-05-11 20:21:24 +02:00
build_wasm.sh Update wasm/web example 2020-04-23 09:50:03 +02:00
Cargo.lock [optimize] switch to ahash for ids and most maps and sets 2020-05-24 11:36:24 +02:00
Cargo.toml Tweak opt-level and lto settings 2020-05-21 10:31:22 +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 Add a fractal clock example to showcase painting performance 2020-05-11 20:21:24 +02:00
start_server.sh Update wasm/web example 2020-04-23 09:50:03 +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:

  • Lightweight
  • Short, conveniant syntax
  • Responsive (60 Hz without breaking a sweat)
  • Portable
  • Platform independent (the same code works on the web and as a native app)

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:

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/examples/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:

  • Labels
  • Buttons, checkboxes, radio buttons and sliders
  • Horizontal or vertical layout
  • Column layout
  • Collapsible headers (sections)
  • Windows
  • Resizable regions
  • Vertical scolling
  • Simple text input
  • Anti-aliased rendering of circles, rounded rectangles and lines.

Conventions

  • All coordinates are screen space coordinates, in locial "points" (which may consist of many physical pixels).
  • All colors have premultiplied alpha

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