docs.rs failed to build pixel-widgets-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
pixel-widgets-0.9.1
Pixel-widgets
pixel-widgets is a user interface library focused on use for games. It's architecture is inspired by elm, since it's very fitting for rust mutability patterns.
Features
- Very compact and easy API
- Render agnostic rendering
- wgpu based renderer included
- Styling using stylesheets
- Built in widgets
Check out the examples to get started quickly.
Overview
User interfaces in pixel-widgets are all defined by implementing a Model
, serving as the data model
for your user interface. The model then has to implement some methods:
view
- for generating a tree of ui widgets. These are retained for as long as the model is not mutated. Ui widgets generate messages when they are interacted with, which leads us to the next method:update
- modifies the model based on a message that was generated by the view
Other ways of updating the ui, such as futures and subscriptions will be be coming in the future.
Quick start
Setting up a ui with pixel-widgets is easy. You start with defining a model.
use *;
Then, we have to define a message type. The message type should be able to tell us what happend in the ui.
And finally, we must implement Model
on our state
use *;
// Now that we have a model that can be used with pixel-widgets, we can put it in a `Ui` in
// order to actually use it.
// `Ui` is the entry point for pixel-widgets, the user is responsible for driving it.