Code Monkey home page Code Monkey logo

conrod's Introduction

Conrod Build Status Crates.io Crates.io

An easy-to-use, 2D GUI library written entirely in Rust.

Here's a youtube demo of the all_widgets.rs example.

Here's another demo of it being used to create a basic synth editor.

You can find the API documentation here.

Screenshots

The all_widgets.rs example.

examples/all_widgets.rs

The canvas.rs example.

examples/canvas.rs

If you have an awesome looking GUI made with conrod, please send us a screenshot and we'll add it here :)

Current State

We're just starting to reach a stable-ish API pattern! There will still be some large changes however these are more likely to be new features than API overhauls.

To get a clearer idea of where we're at see the issues and in particular, the 1.0.0 milestone.

Features

  • "Reactive"/"Immediate" style - produce the UI from your application state in one place, rather than as a separate entity spread across callbacks, instantiation, updates and drawing.
  • A simple Widget trait to allow for custom, third-party widgets.
  • Opt-in, generalised, easy-to-use scrolling! I.e. simply call .vertical_scrolling(true) on a widget and it will become a scrollable container for its children.
  • Powerful layout and positioning:
    • Placement - .middle(), .top_left_of(CANVAS), .mid_right_with_margin(20.0), etc.
    • Alignment - .align_left(), .align_top_of(LABEL), etc.
    • Relative - .down(20.0), .right_from(BUTTON, 40.0), .x_y_relative(20.0, 42.0), etc.
    • Absolute - .x_y(6.0, 7.0)
    • Draggable pop-up / floating canvasses - .floating(true).
    • WidgetMatrix and PositionMatrix for instantiating a grid of widgets.
  • Themes for unique style and layout defaults.
  • widget_ids! macro for easily and safely generating unique widget identifiers.
  • Generic over events and graphics backends - compatible with:
  • Comes with a collection of pre-made widgets.

Available Widgets

Primitives

  • Shapes:
    • Circle
    • Rectangle
    • Oval
    • Polygon
    • FramedRectangle
  • Line
  • PointPath
  • Text (automatic line-wrapping, line spacing, etc)

Interactive

  • Button
  • Canvas (a container-like widget)
  • DropDownList
  • EnvelopeEditor
  • WidgetMatrix
  • NumberDialer
  • Slider
  • Tabs (for easily switching between multiple Canvasses with ease)
  • TextBox
  • TitleBar
  • Toggle
  • XYPad
  • Custom: Conrod also provides a Widget trait for designing and implementing custom widgets. You can find an annotated demonstration of designing a custom widget implementation here. All internal widgets also use this same trait so they should make for decent examples. If you feel like your widget is useful enough to be included within the internal widget library, feel free to submit them in a pull request :)

To-do:

If conrod is missing anything you really wish it had, let us know with an issue describing the widget's style, behaviour and functionality - or even better, submit a pull request :D

Make sure you check the widget label for your desired widget first as it may have already been requested.

Getting Started

Get freetype - at the moment, Conrod uses freetype-rs for its font rendering, which means you'll need to have the freetype library installed on your system. You can download and install the freetype library here.

Build the conrod lib like this:

git clone https://github.com/PistonDevelopers/conrod.git
cd conrod
cargo build

And then build and run the examples like this:

cargo run --release --example all_widgets
cargo run --release --example canvas

You can add it to your project by adding this to your Cargo.toml:

[dependencies]
conrod = "X.Y.Z"

Dependency Graph

dependencies

Contributing

Want to help out? See Piston's how to contribute guide.

License

MIT.

Example assets.

conrod's People

Contributors

mitchmindtree avatar bvssvni avatar dcampbell24 avatar alexchandel avatar potpourri avatar abonander avatar eklavya avatar zummenix avatar esption avatar jarrett avatar benmch avatar indiv0 avatar frewsxcv avatar evenlis avatar gchp avatar stjahns avatar debloper avatar theneikos avatar leonkunert avatar ryman avatar elediaz avatar waynenilsen avatar benaryorg avatar yuripourre avatar s1gtrap avatar iwillspeak avatar tjtolon avatar steveklabnik avatar ebfull avatar lily-mara avatar

Watchers

James Cloos 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.