diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/README.md | 74 | ||||
-rw-r--r-- | examples/bezier_tool/Cargo.toml | 12 | ||||
-rw-r--r-- | examples/bezier_tool/src/main.rs (renamed from examples/bezier_tool.rs) | 0 | ||||
-rw-r--r-- | examples/counter/Cargo.toml | 9 | ||||
-rw-r--r-- | examples/counter/src/main.rs (renamed from examples/counter.rs) | 0 | ||||
-rw-r--r-- | examples/custom_widget/Cargo.toml | 11 | ||||
-rw-r--r-- | examples/custom_widget/src/main.rs (renamed from examples/custom_widget.rs) | 0 | ||||
-rw-r--r-- | examples/events/Cargo.toml | 10 | ||||
-rw-r--r-- | examples/events/src/main.rs (renamed from examples/events.rs) | 5 | ||||
-rw-r--r-- | examples/geometry/Cargo.toml | 11 | ||||
-rw-r--r-- | examples/geometry/src/main.rs (renamed from examples/geometry.rs) | 0 | ||||
-rw-r--r-- | examples/pokedex/Cargo.toml | 14 | ||||
-rw-r--r-- | examples/pokedex/README.md | 17 | ||||
-rw-r--r-- | examples/pokedex/src/main.rs (renamed from examples/pokedex.rs) | 5 | ||||
-rw-r--r-- | examples/progress_bar/Cargo.toml | 9 | ||||
-rw-r--r-- | examples/progress_bar/src/main.rs (renamed from examples/progress_bar.rs) | 0 | ||||
-rw-r--r-- | examples/stopwatch/Cargo.toml | 12 | ||||
-rw-r--r-- | examples/stopwatch/src/main.rs (renamed from examples/stopwatch.rs) | 5 | ||||
-rw-r--r-- | examples/styling/Cargo.toml | 9 | ||||
-rw-r--r-- | examples/styling/README.md | 15 | ||||
-rw-r--r-- | examples/styling/src/main.rs (renamed from examples/styling.rs) | 0 | ||||
-rw-r--r-- | examples/svg.rs | 54 | ||||
-rw-r--r-- | examples/svg/Cargo.toml | 9 | ||||
-rw-r--r-- | examples/svg/resources/tiger.svg (renamed from examples/resources/tiger.svg) | 0 | ||||
-rw-r--r-- | examples/svg/src/main.rs | 37 | ||||
-rw-r--r-- | examples/todos/Cargo.toml | 16 | ||||
-rw-r--r-- | examples/todos/README.md | 20 | ||||
-rw-r--r-- | examples/todos/fonts/icons.ttf (renamed from examples/resources/icons.ttf) | bin | 5596 -> 5596 bytes | |||
-rw-r--r-- | examples/todos/src/main.rs (renamed from examples/todos.rs) | 3 | ||||
-rw-r--r-- | examples/tour/Cargo.toml | 13 | ||||
-rw-r--r-- | examples/tour/README.md | 28 | ||||
-rw-r--r-- | examples/tour/images/ferris.png (renamed from examples/resources/ferris.png) | bin | 33061 -> 33061 bytes | |||
-rw-r--r-- | examples/tour/src/main.rs (renamed from examples/tour.rs) | 4 |
33 files changed, 327 insertions, 75 deletions
diff --git a/examples/README.md b/examples/README.md index 95ec6c5c..c7820f76 100644 --- a/examples/README.md +++ b/examples/README.md @@ -4,11 +4,10 @@ you want to learn about a specific release, check out [the release list]. [the release list]: https://github.com/hecrj/iced/releases -## [Tour](tour.rs) - +## [Tour](tour) A simple UI tour that can run both on native platforms and the web! It showcases different widgets that can be built using Iced. -The __[`tour`]__ file contains all the code of the example! All the cross-platform GUI is defined in terms of __state__, __messages__, __update logic__ and __view logic__. +The __[`main`](tour/src/main.rs)__ file contains all the code of the example! All the cross-platform GUI is defined in terms of __state__, __messages__, __update logic__ and __view logic__. <div align="center"> <a href="https://gfycat.com/politeadorableiberianmole"> @@ -16,7 +15,6 @@ The __[`tour`]__ file contains all the code of the example! All the cross-platfo </a> </div> -[`tour`]: tour.rs [`iced_winit`]: ../winit [`iced_native`]: ../native [`iced_wgpu`]: ../wgpu @@ -26,19 +24,17 @@ The __[`tour`]__ file contains all the code of the example! All the cross-platfo You can run the native version with `cargo run`: ``` -cargo run --example tour +cargo run --package tour ``` The web version can be run by following [the usage instructions of `iced_web`] or by accessing [iced.rs](https://iced.rs/)! [the usage instructions of `iced_web`]: ../web#usage +## [Todos](todos) +A todos tracker inspired by [TodoMVC]. It showcases dynamic layout, text input, checkboxes, scrollables, icons, and async actions! It automatically saves your tasks in the background, even if you did not finish typing them. -## [Todos](todos.rs) - -A simple todos tracker inspired by [TodoMVC]. It showcases dynamic layout, text input, checkboxes, scrollables, icons, and async actions! It automatically saves your tasks in the background, even if you did not finish typing them. - -All the example code is located in the __[`todos`]__ file. +The example code is located in the __[`main`](todos/src/main.rs)__ file. <div align="center"> <a href="https://gfycat.com/littlesanehalicore"> @@ -48,15 +44,67 @@ All the example code is located in the __[`todos`]__ file. You can run the native version with `cargo run`: ``` -cargo run --example todos +cargo run --package todos ``` We have not yet implemented a `LocalStorage` version of the auto-save feature. Therefore, it does not work on web _yet_! -[`todos`]: todos.rs [TodoMVC]: http://todomvc.com/ -## [Coffee] +## [Pokédex](pokedex) +An application that helps you learn about Pokémon! It performs an asynchronous HTTP request to the [PokéAPI] in order to load and display a random Pokédex entry (sprite included!). + +The example code can be found in the __[`main`](pokedex/src/main.rs)__ file. + +<div align="center"> + <a href="https://gfycat.com/aggressivedarkelephantseal-rust-gui"> + <img src="https://thumbs.gfycat.com/AggressiveDarkElephantseal-small.gif" height="400px"> + </a> +</div> + +You can run it on native platforms with `cargo run`: +``` +cargo run --package pokedex +``` + +[PokéAPI]: https://pokeapi.co/ + +## [Styling](styling) +An example showcasing custom styling with a light and dark theme. + +The example code is located in the __[`main`](styling/src/main.rs)__ file. +<div align="center"> + <a href="https://user-images.githubusercontent.com/518289/71867993-acff4300-310c-11ea-85a3-d01d8f884346.gif"> + <img src="https://user-images.githubusercontent.com/518289/71867993-acff4300-310c-11ea-85a3-d01d8f884346.gif" height="400px"> + </a> +</div> + +You can run it with `cargo run`: +``` +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`]. +- [`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`. +- [`geometry`](geometry), a custom widget showcasing how to draw geometry with the `Mesh2D` primitive in [`iced_wgpu`](../wgpu). +- [`progress_bar`](progress_bar), a simple progress bar that can be filled by using a slider. +- [`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. + +All of them are packaged in their own crate and, therefore, can be run using `cargo`: +``` +cargo run --package <example> +``` + +[`lyon`]: https://github.com/nical/lyon +[Ghostscript Tiger]: https://commons.wikimedia.org/wiki/File:Ghostscript_Tiger.svg + +## [Coffee] Since [Iced was born in May], it has been powering the user interfaces in [Coffee], an experimental 2D game engine. diff --git a/examples/bezier_tool/Cargo.toml b/examples/bezier_tool/Cargo.toml new file mode 100644 index 00000000..b13a0aa5 --- /dev/null +++ b/examples/bezier_tool/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "bezier_tool" +version = "0.1.0" +authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"] +edition = "2018" +publish = false + +[dependencies] +iced = { path = "../.." } +iced_native = { path = "../../native" } +iced_wgpu = { path = "../../wgpu" } +lyon = "0.15" diff --git a/examples/bezier_tool.rs b/examples/bezier_tool/src/main.rs index 043d265c..043d265c 100644 --- a/examples/bezier_tool.rs +++ b/examples/bezier_tool/src/main.rs diff --git a/examples/counter/Cargo.toml b/examples/counter/Cargo.toml new file mode 100644 index 00000000..a763cd78 --- /dev/null +++ b/examples/counter/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "counter" +version = "0.1.0" +authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"] +edition = "2018" +publish = false + +[dependencies] +iced = { path = "../.." } diff --git a/examples/counter.rs b/examples/counter/src/main.rs index b85db70d..b85db70d 100644 --- a/examples/counter.rs +++ b/examples/counter/src/main.rs diff --git a/examples/custom_widget/Cargo.toml b/examples/custom_widget/Cargo.toml new file mode 100644 index 00000000..30747dc0 --- /dev/null +++ b/examples/custom_widget/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "custom_widget" +version = "0.1.0" +authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"] +edition = "2018" +publish = false + +[dependencies] +iced = { path = "../.." } +iced_native = { path = "../../native" } +iced_wgpu = { path = "../../wgpu" } diff --git a/examples/custom_widget.rs b/examples/custom_widget/src/main.rs index 0a570745..0a570745 100644 --- a/examples/custom_widget.rs +++ b/examples/custom_widget/src/main.rs diff --git a/examples/events/Cargo.toml b/examples/events/Cargo.toml new file mode 100644 index 00000000..f883075f --- /dev/null +++ b/examples/events/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "events" +version = "0.1.0" +authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"] +edition = "2018" +publish = false + +[dependencies] +iced = { path = "../.." } +iced_native = { path = "../../native" } diff --git a/examples/events.rs b/examples/events/src/main.rs index 74542171..0c9dca05 100644 --- a/examples/events.rs +++ b/examples/events/src/main.rs @@ -1,6 +1,6 @@ use iced::{ - Align, Application, Checkbox, Column, Command, Container, Element, Length, - Settings, Subscription, Text, + executor, Align, Application, Checkbox, Column, Command, Container, + Element, Length, Settings, Subscription, Text, }; pub fn main() { @@ -20,6 +20,7 @@ enum Message { } impl Application for Events { + type Executor = executor::Default; type Message = Message; fn new() -> (Events, Command<Message>) { diff --git a/examples/geometry/Cargo.toml b/examples/geometry/Cargo.toml new file mode 100644 index 00000000..9df52454 --- /dev/null +++ b/examples/geometry/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "geometry" +version = "0.1.0" +authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"] +edition = "2018" +publish = false + +[dependencies] +iced = { path = "../.." } +iced_native = { path = "../../native" } +iced_wgpu = { path = "../../wgpu" } diff --git a/examples/geometry.rs b/examples/geometry/src/main.rs index 9d5fd611..9d5fd611 100644 --- a/examples/geometry.rs +++ b/examples/geometry/src/main.rs diff --git a/examples/pokedex/Cargo.toml b/examples/pokedex/Cargo.toml new file mode 100644 index 00000000..2972590f --- /dev/null +++ b/examples/pokedex/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "pokedex" +version = "0.1.0" +authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"] +edition = "2018" +publish = false + +[dependencies] +iced = { path = "../.." } +iced_futures = { path = "../../futures", features = ["async-std"] } +surf = "1.0" +rand = "0.7" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" diff --git a/examples/pokedex/README.md b/examples/pokedex/README.md new file mode 100644 index 00000000..50720f57 --- /dev/null +++ b/examples/pokedex/README.md @@ -0,0 +1,17 @@ +# Pokédex +An application that loads a random Pokédex entry using the [PokéAPI]. + +All the example code can be found in the __[`main`](src/main.rs)__ file. + +<div align="center"> + <a href="https://gfycat.com/aggressivedarkelephantseal-rust-gui"> + <img src="https://thumbs.gfycat.com/AggressiveDarkElephantseal-small.gif" height="400px"> + </a> +</div> + +You can run it on native platforms with `cargo run`: +``` +cargo run --package pokedex +``` + +[PokéAPI]: https://pokeapi.co/ diff --git a/examples/pokedex.rs b/examples/pokedex/src/main.rs index 7326f94f..283437b2 100644 --- a/examples/pokedex.rs +++ b/examples/pokedex/src/main.rs @@ -1,6 +1,6 @@ use iced::{ - button, image, Align, Application, Button, Column, Command, Container, - Element, Image, Length, Row, Settings, Text, + button, futures, image, Align, Application, Button, Column, Command, + Container, Element, Image, Length, Row, Settings, Text, }; pub fn main() { @@ -27,6 +27,7 @@ enum Message { } impl Application for Pokedex { + type Executor = iced_futures::executor::AsyncStd; type Message = Message; fn new() -> (Pokedex, Command<Message>) { diff --git a/examples/progress_bar/Cargo.toml b/examples/progress_bar/Cargo.toml new file mode 100644 index 00000000..4eccbf14 --- /dev/null +++ b/examples/progress_bar/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "progress_bar" +version = "0.1.0" +authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"] +edition = "2018" +publish = false + +[dependencies] +iced = { path = "../.." } diff --git a/examples/progress_bar.rs b/examples/progress_bar/src/main.rs index 43b09928..43b09928 100644 --- a/examples/progress_bar.rs +++ b/examples/progress_bar/src/main.rs diff --git a/examples/stopwatch/Cargo.toml b/examples/stopwatch/Cargo.toml new file mode 100644 index 00000000..1dae3b83 --- /dev/null +++ b/examples/stopwatch/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "stopwatch" +version = "0.1.0" +authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"] +edition = "2018" +publish = false + +[dependencies] +iced = { path = "../.." } +iced_native = { path = "../../native" } +iced_futures = { path = "../../futures", features = ["async-std"] } +async-std = { version = "1.0", features = ["unstable"] } diff --git a/examples/stopwatch.rs b/examples/stopwatch/src/main.rs index c9a61ee9..d84c4817 100644 --- a/examples/stopwatch.rs +++ b/examples/stopwatch/src/main.rs @@ -28,6 +28,7 @@ enum Message { } impl Application for Stopwatch { + type Executor = iced_futures::executor::AsyncStd; type Message = Message; fn new() -> (Stopwatch, Command<Message>) { @@ -142,6 +143,8 @@ impl Application for Stopwatch { } mod time { + use iced::futures; + pub fn every( duration: std::time::Duration, ) -> iced::Subscription<std::time::Instant> { @@ -165,7 +168,7 @@ mod time { fn stream( self: Box<Self>, - _input: I, + _input: futures::stream::BoxStream<'static, I>, ) -> futures::stream::BoxStream<'static, Self::Output> { use futures::stream::StreamExt; diff --git a/examples/styling/Cargo.toml b/examples/styling/Cargo.toml new file mode 100644 index 00000000..eb729f93 --- /dev/null +++ b/examples/styling/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "styling" +version = "0.1.0" +authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"] +edition = "2018" +publish = false + +[dependencies] +iced = { path = "../.." } diff --git a/examples/styling/README.md b/examples/styling/README.md new file mode 100644 index 00000000..6c198a54 --- /dev/null +++ b/examples/styling/README.md @@ -0,0 +1,15 @@ +# Styling +An example showcasing custom styling with a light and dark theme. + +All the example code is located in the __[`main`](src/main.rs)__ file. + +<div align="center"> + <a href="https://user-images.githubusercontent.com/518289/71867993-acff4300-310c-11ea-85a3-d01d8f884346.gif"> + <img src="https://user-images.githubusercontent.com/518289/71867993-acff4300-310c-11ea-85a3-d01d8f884346.gif" height="400px"> + </a> +</div> + +You can run it with `cargo run`: +``` +cargo run --package styling +``` diff --git a/examples/styling.rs b/examples/styling/src/main.rs index 50095ec7..50095ec7 100644 --- a/examples/styling.rs +++ b/examples/styling/src/main.rs diff --git a/examples/svg.rs b/examples/svg.rs deleted file mode 100644 index 1895039d..00000000 --- a/examples/svg.rs +++ /dev/null @@ -1,54 +0,0 @@ -use iced::{Container, Element, Length, Sandbox, Settings}; - -pub fn main() { - Tiger::run(Settings::default()) -} - -#[derive(Default)] -struct Tiger; - -impl Sandbox for Tiger { - type Message = (); - - fn new() -> Self { - Self::default() - } - - fn title(&self) -> String { - String::from("SVG - Iced") - } - - fn update(&mut self, _message: ()) {} - - fn view(&mut self) -> Element<()> { - #[cfg(feature = "svg")] - let content = { - use iced::{Column, Svg}; - - Column::new().padding(20).push( - Svg::new(format!( - "{}/examples/resources/tiger.svg", - env!("CARGO_MANIFEST_DIR") - )) - .width(Length::Fill) - .height(Length::Fill), - ) - }; - - #[cfg(not(feature = "svg"))] - let content = { - use iced::{HorizontalAlignment, Text}; - - Text::new("You need to enable the `svg` feature!") - .horizontal_alignment(HorizontalAlignment::Center) - .size(30) - }; - - Container::new(content) - .width(Length::Fill) - .height(Length::Fill) - .center_x() - .center_y() - .into() - } -} diff --git a/examples/svg/Cargo.toml b/examples/svg/Cargo.toml new file mode 100644 index 00000000..d8f83ac2 --- /dev/null +++ b/examples/svg/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "svg" +version = "0.1.0" +authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"] +edition = "2018" +publish = false + +[dependencies] +iced = { path = "../..", features = ["svg"] } diff --git a/examples/resources/tiger.svg b/examples/svg/resources/tiger.svg index 679edec2..679edec2 100644 --- a/examples/resources/tiger.svg +++ b/examples/svg/resources/tiger.svg diff --git a/examples/svg/src/main.rs b/examples/svg/src/main.rs new file mode 100644 index 00000000..57358e24 --- /dev/null +++ b/examples/svg/src/main.rs @@ -0,0 +1,37 @@ +use iced::{Column, Container, Element, Length, Sandbox, Settings, Svg}; + +pub fn main() { + Tiger::run(Settings::default()) +} + +#[derive(Default)] +struct Tiger; + +impl Sandbox for Tiger { + type Message = (); + + fn new() -> Self { + Self::default() + } + + fn title(&self) -> String { + String::from("SVG - Iced") + } + + fn update(&mut self, _message: ()) {} + + fn view(&mut self) -> Element<()> { + let content = Column::new().padding(20).push( + Svg::new(format!("{}/tiger.svg", env!("CARGO_MANIFEST_DIR"))) + .width(Length::Fill) + .height(Length::Fill), + ); + + Container::new(content) + .width(Length::Fill) + .height(Length::Fill) + .center_x() + .center_y() + .into() + } +} diff --git a/examples/todos/Cargo.toml b/examples/todos/Cargo.toml new file mode 100644 index 00000000..53a135e6 --- /dev/null +++ b/examples/todos/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "todos" +version = "0.1.0" +authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"] +edition = "2018" +publish = false + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +iced = { path = "../.." } +iced_futures = { path = "../../futures", features = ["async-std"] } +async-std = "1.0" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +directories = "2.0" diff --git a/examples/todos/README.md b/examples/todos/README.md new file mode 100644 index 00000000..9c2598b9 --- /dev/null +++ b/examples/todos/README.md @@ -0,0 +1,20 @@ +## Todos + +A todos tracker inspired by [TodoMVC]. It showcases dynamic layout, text input, checkboxes, scrollables, icons, and async actions! It automatically saves your tasks in the background, even if you did not finish typing them. + +All the example code is located in the __[`main`]__ file. + +<div align="center"> + <a href="https://gfycat.com/littlesanehalicore"> + <img src="https://thumbs.gfycat.com/LittleSaneHalicore-small.gif" height="400px"> + </a> +</div> + +You can run the native version with `cargo run`: +``` +cargo run --package todos +``` +We have not yet implemented a `LocalStorage` version of the auto-save feature. Therefore, it does not work on web _yet_! + +[`main`]: src/main.rs +[TodoMVC]: http://todomvc.com/ diff --git a/examples/resources/icons.ttf b/examples/todos/fonts/icons.ttf Binary files differindex 4498299d..4498299d 100644 --- a/examples/resources/icons.ttf +++ b/examples/todos/fonts/icons.ttf diff --git a/examples/todos.rs b/examples/todos/src/main.rs index 4166f75a..c6ddf2ea 100644 --- a/examples/todos.rs +++ b/examples/todos/src/main.rs @@ -38,6 +38,7 @@ enum Message { } impl Application for Todos { + type Executor = iced_futures::executor::AsyncStd; type Message = Message; fn new() -> (Todos, Command<Message>) { @@ -450,7 +451,7 @@ fn empty_message(message: &str) -> Element<'static, Message> { // Fonts const ICONS: Font = Font::External { name: "Icons", - bytes: include_bytes!("resources/icons.ttf"), + bytes: include_bytes!("../fonts/icons.ttf"), }; fn icon(unicode: char) -> Text { diff --git a/examples/tour/Cargo.toml b/examples/tour/Cargo.toml new file mode 100644 index 00000000..7772df1b --- /dev/null +++ b/examples/tour/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "tour" +version = "0.1.0" +authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"] +edition = "2018" +publish = false + +[dependencies] +iced = { path = "../..", features = ["debug"] } +env_logger = "0.7" + +[target.'cfg(target_arch = "wasm32")'.dependencies] +wasm-bindgen = "0.2.51" diff --git a/examples/tour/README.md b/examples/tour/README.md new file mode 100644 index 00000000..f380931a --- /dev/null +++ b/examples/tour/README.md @@ -0,0 +1,28 @@ +## Tour + +A simple UI tour that can run both on native platforms and the web! It showcases different widgets that can be built using Iced. + +The __[`main`]__ file contains all the code of the example! All the cross-platform GUI is defined in terms of __state__, __messages__, __update logic__ and __view logic__. + +<div align="center"> + <a href="https://gfycat.com/politeadorableiberianmole"> + <img src="https://thumbs.gfycat.com/PoliteAdorableIberianmole-small.gif"> + </a> +</div> + +[`main`]: src/main.rs +[`iced_winit`]: ../../winit +[`iced_native`]: ../../native +[`iced_wgpu`]: ../../wgpu +[`iced_web`]: ../../web +[`winit`]: https://github.com/rust-windowing/winit +[`wgpu`]: https://github.com/gfx-rs/wgpu-rs + +You can run the native version with `cargo run`: +``` +cargo run --package tour +``` + +The web version can be run by following [the usage instructions of `iced_web`] or by accessing [iced.rs](https://iced.rs/)! + +[the usage instructions of `iced_web`]: ../../web#usage diff --git a/examples/resources/ferris.png b/examples/tour/images/ferris.png Binary files differindex ebce1a14..ebce1a14 100644 --- a/examples/resources/ferris.png +++ b/examples/tour/images/ferris.png diff --git a/examples/tour.rs b/examples/tour/src/main.rs index b0ee4d96..43c7e50f 100644 --- a/examples/tour.rs +++ b/examples/tour/src/main.rs @@ -681,10 +681,10 @@ fn ferris<'a>(width: u16) -> Container<'a, StepMessage> { // This should go away once we unify resource loading on native // platforms if cfg!(target_arch = "wasm32") { - Image::new("resources/ferris.png") + Image::new("images/ferris.png") } else { Image::new(format!( - "{}/examples/resources/ferris.png", + "{}/images/ferris.png", env!("CARGO_MANIFEST_DIR") )) } |