Code Monkey home page Code Monkey logo

egui-app's Introduction

egui template

dependency status Build Status

This is a template repo for egui.

The goal is for this to be the simplest way to get started writing a GUI app in Rust.

You can compile your app natively or for the web, and share it using Github Pages.

Getting started

Start by clicking "Use this template" at https://github.com/emilk/egui_template/ or follow these instructions.

src/app.rs contains a simple example app. This is just to give some inspiration - most of it can be removed if you like.

Make sure you are using the latest version of stable rust.

Testing locally

cargo run --release

On Linux you need to first run sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev.

Compiling for the web

You can compile your app to WASM and publish it as a web page. For this you need to set up some tools. There are a few simple scripts that help you with this:

./setup_web.sh
./build_web.sh
./start_server.sh
open http://127.0.0.1:8080/
  • setup_web.sh installs the tools required to build for web
  • build_web.sh compiles your code to wasm and puts it in the docs/ folder (see below)
  • start_server.sh starts a local HTTP server so you can test before you publish
  • Open http://127.0.0.1:8080/ in a web browser to view

The finished web app is found in the docs/ folder (this is so that you can easily share it with GitHub Pages). It consists of three files:

  • index.html: A few lines of HTML, CSS and JS that loads your app. You need to edit this (once) to replace egui_template with the name of your crate!
  • your_crate_bg.wasm: What the Rust code compiles to.
  • your_crate.js: Auto-generated binding between Rust and JS.

You can test the template app at https://emilk.github.io/egui_template/.

Updating egui

As of 2021, egui is in active development with frequent releases with breaking changes. egui_template will be updated in lock-step to always use the latest version of egui.

egui-app's People

Contributors

cympfh avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.