Giter VIP home page Giter VIP logo

imagine's Introduction

Imagine

An experimental Rust GUI.

WARNING

This is a work in progress and is not meant to be used in production.

The current implementation is quite messy, but it is meant as a proof of concept and I plan to rewrite the majority of the code if this approach seems viable.

Basic Design

Imagine uses an ECS library (specs) which maintains all the widgets in the world. Widgets are composed of various components which is used to determine layout, rendering, and interactivity. Currently the bulk of the layout and render work is done via trait objects and a single Widget component which stores the Widget trit object. This benefit of this approach is that it allows anyone to build their own custom widgets in a separate crate. To demonstrate this, all the available widgets are in the imagine_toolkit crate rather than the imagine crate. Widgets are identifiable by a WidgetId which is a wrapper over a specs Entity. A WidgetId is only constructed when an entity with a widget component has been added to the World. Widgets can store these WidgetIds to keep track of their children. End users use WidgetIds to build their UI hierarchy and to attach event listeners to widgets.

Current Features

  • Widgets
    • Flex Box
    • Padding
    • Label
    • Button
    • Colored Box
  • Basic Interactivity
    • Hover
    • Click

Example

Calculator

Calculator Example

Inspiration

The layout is done via Flutter's box constraints and I have taken a lot of inspiration from druid.

imagine's People

Contributors

cbrewster avatar

Watchers

 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.