Create `README` files for all the examples

This commit is contained in:
Héctor Ramón Jiménez 2020-02-21 15:12:27 +01:00
parent 9758c12176
commit b0cf47cc2b
12 changed files with 199 additions and 1 deletions

View File

@ -69,7 +69,8 @@ cargo run --package styling
## Extras
A bunch of simpler examples exist:
- [`bezier_tool`](bezier_tool), a Paint-like tool for drawing Bezier curves using [`lyon`].
- [`bezier_tool`](bezier_tool), a Paint-like tool for drawing Bézier curves using [`lyon`].
- [`clock`](clock), an application that uses the `Canvas` widget to draw a clock and its hands to display the current time.
- [`counter`](counter), the classic counter example explained in the [`README`](../README.md).
- [`custom_widget`](custom_widget), a demonstration of how to build a custom widget that draws a circle.
- [`events`](events), a log of native events displayed using a conditional `Subscription`.
@ -77,6 +78,7 @@ A bunch of simpler examples exist:
- [`integration`](integration), a demonstration of how to integrate Iced in an existing graphical application.
- [`pokedex`](pokedex), an application that displays a random Pokédex entry (sprite included!) by using the [PokéAPI].
- [`progress_bar`](progress_bar), a simple progress bar that can be filled by using a slider.
- [`solar_system`](solar_system), an animated solar system drawn using the `Canvas` widget and showcasing how to compose different transforms.
- [`stopwatch`](stopwatch), a watch with start/stop and reset buttons showcasing how to listen to time.
- [`svg`](svg), an application that renders the [Ghostscript Tiger] by leveraging the `Svg` widget.

View File

@ -0,0 +1,19 @@
## Bézier tool
A Paint-like tool for drawing Bézier curves using [`lyon`].
The __[`main`]__ file contains all the code of the example.
<div align="center">
<a href="https://gfycat.com/soulfulinfiniteantbear">
<img src="https://thumbs.gfycat.com/SoulfulInfiniteAntbear-small.gif">
</a>
</div>
You can run it with `cargo run`:
```
cargo run --package bezier_tool
```
[`main`]: src/main.rs
[`lyon`]: https://github.com/nical/lyon

16
examples/clock/README.md Normal file
View File

@ -0,0 +1,16 @@
## Clock
An application that uses the `Canvas` widget to draw a clock and its hands to display the current time.
The __[`main`]__ file contains all the code of the example.
<div align="center">
<img src="https://user-images.githubusercontent.com/518289/74716344-a3e6b300-522e-11ea-8aea-3cc0a5100a2e.gif">
</div>
You can run it with `cargo run`:
```
cargo run --package clock
```
[`main`]: src/main.rs

View File

@ -0,0 +1,18 @@
## Counter
The classic counter example explained in the [`README`](../../README.md).
The __[`main`]__ file contains all the code of the example.
<div align="center">
<a href="https://gfycat.com/fairdeadcatbird">
<img src="https://thumbs.gfycat.com/FairDeadCatbird-small.gif">
</a>
</div>
You can run it with `cargo run`:
```
cargo run --package counter
```
[`main`]: src/main.rs

View File

@ -0,0 +1,18 @@
## Custom widget
A demonstration of how to build a custom widget that draws a circle.
The __[`main`]__ file contains all the code of the example.
<div align="center">
<a href="https://gfycat.com/jealouscornyhomalocephale">
<img src="https://thumbs.gfycat.com/JealousCornyHomalocephale-small.gif">
</a>
</div>
You can run it with `cargo run`:
```
cargo run --package custom_widget
```
[`main`]: src/main.rs

18
examples/events/README.md Normal file
View File

@ -0,0 +1,18 @@
## Events
A log of native events displayed using a conditional `Subscription`.
The __[`main`]__ file contains all the code of the example.
<div align="center">
<a href="https://gfycat.com/infamousicyermine">
<img src="https://thumbs.gfycat.com/InfamousIcyErmine-small.gif">
</a>
</div>
You can run it with `cargo run`:
```
cargo run --package events
```
[`main`]: src/main.rs

View File

@ -0,0 +1,18 @@
## Geometry
A custom widget showcasing how to draw geometry with the `Mesh2D` primitive in [`iced_wgpu`](../../wgpu).
The __[`main`]__ file contains all the code of the example.
<div align="center">
<a href="https://gfycat.com/activeunfitkangaroo">
<img src="https://thumbs.gfycat.com/ActiveUnfitKangaroo-small.gif">
</a>
</div>
You can run it with `cargo run`:
```
cargo run --package geometry
```
[`main`]: src/main.rs

View File

@ -0,0 +1,18 @@
## Integration
A demonstration of how to integrate Iced in an existing graphical application.
The __[`main`]__ file contains all the code of the example.
<div align="center">
<a href="https://gfycat.com/nicemediocrekodiakbear">
<img src="https://thumbs.gfycat.com/NiceMediocreKodiakbear-small.gif">
</a>
</div>
You can run it with `cargo run`:
```
cargo run --package integration
```
[`main`]: src/main.rs

View File

@ -0,0 +1,18 @@
## Progress bar
A simple progress bar that can be filled by using a slider.
The __[`main`]__ file contains all the code of the example.
<div align="center">
<a href="https://gfycat.com/importantdevotedhammerheadbird">
<img src="https://thumbs.gfycat.com/ImportantDevotedHammerheadbird-small.gif">
</a>
</div>
You can run it with `cargo run`:
```
cargo run --package progress_bar
```
[`main`]: src/main.rs

View File

@ -0,0 +1,18 @@
## Solar system
An animated solar system drawn using the `Canvas` widget and showcasing how to compose different transforms.
The __[`main`]__ file contains all the code of the example.
<div align="center">
<a href="https://gfycat.com/selfassuredaromaticdunnart">
<img src="https://thumbs.gfycat.com/SelfassuredAromaticDunnart-small.gif">
</a>
</div>
You can run it with `cargo run`:
```
cargo run --package solar_system
```
[`main`]: src/main.rs

View File

@ -0,0 +1,18 @@
## Stopwatch
A watch with start/stop and reset buttons showcasing how to listen to time.
The __[`main`]__ file contains all the code of the example.
<div align="center">
<a href="https://gfycat.com/granularenviousgoitered-rust-gui">
<img src="https://thumbs.gfycat.com/GranularEnviousGoitered-small.gif">
</a>
</div>
You can run it with `cargo run`:
```
cargo run --package stopwatch
```
[`main`]: src/main.rs

17
examples/svg/README.md Normal file
View File

@ -0,0 +1,17 @@
## SVG
An application that renders the [Ghostscript Tiger] by leveraging the `Svg` widget.
The __[`main`]__ file contains all the code of the example.
<div align="center">
<img src="resources/tiger.svg">
</div>
You can run it with `cargo run`:
```
cargo run --package svg
```
[`main`]: src/main.rs
[Ghostscript Tiger]: https://commons.wikimedia.org/wiki/File:Ghostscript_Tiger.svg