Crate nannou[][src]

An open-source creative-coding toolkit for Rust.

Nannou is a collection of code aimed at making it easy for artists to express themselves with simple, fast, reliable, portable code. Whether working on a 12-month laser installation or a 5 minute sketch, this framework aims to give artists easy access to the tools they need.

If you're new to nannou, we recommend checking out the examples to get an idea of how nannou applications are structured and how the API works.

Re-exports

pub extern crate daggy;
pub extern crate find_folder;
pub extern crate glium;
pub use self::event::Event;
pub use self::ui::Ui;
pub use app::App;
pub use app::LoopMode;
pub use draw::Draw;

Modules

app

The application context. See here for items related to the event loop, device access, creating and managing windows and streams and more.

audio

The nannou audio API and implementation.

color

Color items, including everything from rgb, hsb/l/v, lap, alpha, luma and more, provided by the palette crate. See the palette docs for more details or see the named module for a set of provided color constants.

draw

A simple API for drawing 2D and 3D graphics. See the Draw type for more details.

ease

A suite of common interpolation functions often referred to as "easing" and "tweening" functions. This API is provided by the pennereq crate.

event

Application, event loop and window event definitions and implementations.

geom

Types, functions and other items related to geometry. This module is the source of all graphics and lazer primitives and aids work in 2D and 3D space.

image

Items related to working with images. Currently, this module simply re-exports the renown image crate which supports reading and writing PNG, JPEG, GIF, WEBP, BMP and more.

io

An extension of the std::io module. Includes functions for safely saving and loading files from any serializable types, along with functions specifically for working with JSON and TOML.

math

A mathematical foundation for nannou including point and vector types and a range of helper/utility functions.

mesh

An API for composing Meshs. Meshs may be composed of different sets of channels including position, color, texture-coordinate and normals. Note that this is quite a low-level representation. For a higher-level, graphics-related mesh API, see the draw module.

noise

Items related to noise generation, API offered via the noise-rs crate.

osc

Tools for working with OSC. sender() creates an OSC sender, receiver(port) creates an OSC receiver.

prelude

A collection of commonly used items that we recommend importing for ease of use.

rand

Items related to randomness and random number generators. Also provides some high-level helper functions including random_f32(), random_f64() and random_range(min, max).

state

Small tracked parts of the application state. Includes window, keys, mouse, time - each of which are stored in the App.

ui

The User Interface API. Instantiate a Ui via app.new_ui().

window

The nannou Window API. Create a new window via .app.new_window(). This produces a Builder which can be used to build a window.

Structs

Builder

A nannou application builder.

ContextBuilder

Object that allows you to build Contexts.

Frame

A Frame represents all graphics for the application for a single "frame" of time.

MonitorId

Identifier for a monitor.

WindowBuilder

Object that allows you to build windows.

Enums

ElementState

Describes the input state of a key.

MouseCursor

Describes the appearance of the mouse cursor.

View

The App's view function.

VirtualKeyCode

Symbolic name for a keyboard key.

WindowEvent

Describes an event from a Window.

Functions

app

Begin building a nannou App.

run

A simple function for creating and running a nannou App with a default window!

view

Build a simple nannou App with a default window and a view function.

Type Definitions

EventFn
ExitFn
ModelFn
SimpleViewFn
ViewFn