diff options
author | 2019-10-06 20:06:13 +0200 | |
---|---|---|
committer | 2019-10-06 20:06:13 +0200 | |
commit | 5286ef36b6a5eb6846b5675a7a4aced72601df3b (patch) | |
tree | 90f90a0e326c5c2eb598ba1a50c8096f0ea074ad | |
parent | 7765e6da50a3448501ee1b639e580c94a4fbda8a (diff) | |
download | iced-5286ef36b6a5eb6846b5675a7a4aced72601df3b.tar.gz iced-5286ef36b6a5eb6846b5675a7a4aced72601df3b.tar.bz2 iced-5286ef36b6a5eb6846b5675a7a4aced72601df3b.zip |
Make `tour` a simple example instead of a crate
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | examples/resources/Roboto-LICENSE (renamed from examples/tour/resources/Roboto-LICENSE) | 0 | ||||
-rw-r--r-- | examples/resources/Roboto-Regular.ttf (renamed from examples/tour/resources/Roboto-Regular.ttf) | bin | 171272 -> 171272 bytes | |||
-rw-r--r-- | examples/resources/ferris.png (renamed from examples/tour/resources/ferris.png) | bin | 33061 -> 33061 bytes | |||
-rw-r--r-- | examples/resources/ui.png (renamed from examples/tour/resources/ui.png) | bin | 16691 -> 16691 bytes | |||
-rw-r--r-- | examples/tour.html (renamed from examples/tour/index.html) | 0 | ||||
-rw-r--r-- | examples/tour.rs (renamed from examples/tour/src/main.rs) | 0 | ||||
-rw-r--r-- | examples/tour/Cargo.toml | 12 | ||||
-rw-r--r-- | examples/tour/README.md | 66 | ||||
-rw-r--r-- | wgpu/src/renderer.rs | 2 |
10 files changed, 1 insertions, 80 deletions
@@ -19,7 +19,6 @@ members = [ "core", "native", "web", - "examples/tour", ] [features] diff --git a/examples/tour/resources/Roboto-LICENSE b/examples/resources/Roboto-LICENSE index 75b52484..75b52484 100644 --- a/examples/tour/resources/Roboto-LICENSE +++ b/examples/resources/Roboto-LICENSE diff --git a/examples/tour/resources/Roboto-Regular.ttf b/examples/resources/Roboto-Regular.ttf Binary files differindex 2b6392ff..2b6392ff 100644 --- a/examples/tour/resources/Roboto-Regular.ttf +++ b/examples/resources/Roboto-Regular.ttf diff --git a/examples/tour/resources/ferris.png b/examples/resources/ferris.png Binary files differindex ebce1a14..ebce1a14 100644 --- a/examples/tour/resources/ferris.png +++ b/examples/resources/ferris.png diff --git a/examples/tour/resources/ui.png b/examples/resources/ui.png Binary files differindex 4fd3beb3..4fd3beb3 100644 --- a/examples/tour/resources/ui.png +++ b/examples/resources/ui.png diff --git a/examples/tour/index.html b/examples/tour.html index b17ac4a2..b17ac4a2 100644 --- a/examples/tour/index.html +++ b/examples/tour.html diff --git a/examples/tour/src/main.rs b/examples/tour.rs index 0b88ccd5..0b88ccd5 100644 --- a/examples/tour/src/main.rs +++ b/examples/tour.rs diff --git a/examples/tour/Cargo.toml b/examples/tour/Cargo.toml deleted file mode 100644 index 8b3d7765..00000000 --- a/examples/tour/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "iced_tour" -version = "0.0.0" -authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"] -description = "Tour example for Iced" -license = "MIT" -repository = "https://github.com/hecrj/iced" -edition = "2018" -publish = false - -[dependencies] -iced = { version = "0.1.0-alpha.1", path = "../.." } diff --git a/examples/tour/README.md b/examples/tour/README.md deleted file mode 100644 index 7ef1a212..00000000 --- a/examples/tour/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# Tour - -A simple UI tour showcasing different widgets that can be built using Iced. It -also shows how the library can be integrated into an existing system. - -The example can run both on native and web platforms, using the same GUI code! - -The native renderer of the example is built on top of [`ggez`], a game library -for Rust. Currently, it is using a [personal fork] to [add a `FontCache` type] -and [fix some issues with HiDPI]. - -The web version uses `iced_web` directly. This crate is still a work in -progress. In particular, the styling of elements is not finished yet -(text color, alignment, sizing, etc). - -The implementation consists of different modules: - - __[`tour`]__ contains the actual cross-platform GUI code: __state__, - __messages__, __update logic__ and __view logic__. - - __[`iced_ggez`]__ implements a simple renderer for each of the used widgets - on top of the graphics module of [`ggez`]. - - __[`widget`]__ conditionally re-exposes the correct platform widgets based - on the target architecture. - - __[`main`]__ integrates Iced with [`ggez`] and connects the [`tour`] with - the native [`renderer`]. - - __[`lib`]__ exposes the [`tour`] types and conditionally implements the - WebAssembly entrypoint in the [`web`] module. - -The conditional compilation awkwardness from targetting both native and web -platforms should be handled seamlessly by the `iced` crate in the near future! - -If you want to run it as a native app: - -``` -cd examples/tour -cargo run -``` - -If you want to run it on web, you will need [`wasm-pack`]: - -``` -cd examples/tour -wasm-pack build --target web -``` - -Then, simply serve the directory with any HTTP server. For instance: - -``` -python3 -m http.server -``` - -[![Tour - Iced][gui_gif]][gui_gfycat] - -[`ggez`]: https://github.com/ggez/ggez -[`tour`]: src/tour.rs -[`iced_ggez`]: src/iced_ggez -[`renderer`]: src/iced_ggez/renderer -[`widget`]: src/widget.rs -[`main`]: src/main.rs -[`lib`]: src/lib.rs -[`web`]: src/web.rs -[`wasm-pack`]: https://rustwasm.github.io/wasm-pack/installer/ -[personal fork]: https://github.com/hecrj/ggez -[add a `FontCache` type]: https://github.com/ggez/ggez/pull/679 -[fix some issues with HiDPI]: https://github.com/hecrj/ggez/commit/dfe2fd2423c51a6daf42c75f66dfaeaacd439fb1 -[gui_gif]: https://thumbs.gfycat.com/VeneratedSourAurochs-small.gif -[gui_gfycat]: https://gfycat.com/veneratedsouraurochs diff --git a/wgpu/src/renderer.rs b/wgpu/src/renderer.rs index 56986bd1..f8f000f0 100644 --- a/wgpu/src/renderer.rs +++ b/wgpu/src/renderer.rs @@ -54,7 +54,7 @@ impl Renderer { // TODO: Think about font loading strategy // Loading system fonts with fallback may be a good idea let font: &[u8] = - include_bytes!("../../examples/tour/resources/Roboto-Regular.ttf"); + include_bytes!("../../examples/resources/Roboto-Regular.ttf"); let glyph_brush = GlyphBrushBuilder::using_font_bytes(font) .build(&mut device, TextureFormat::Bgra8UnormSrgb); |