diff --git a/Cargo.toml b/Cargo.toml index 7f0f7fcb72eb41145c33a396c3b256115ec65055..8da59d5203ee8741d27119561f7139e937fd45f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ members = ["kayak_ui_macros"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bevy = { git = "https://github.com/bevyengine/bevy", rev="1914a3f288a812667f735ee9e7806cf1560dacc0" } +bevy = { git = "https://github.com/bevyengine/bevy", version = "0.9" } bytemuck = "1.12" dashmap = "5.4" kayak_font = { path = "./kayak_font" } diff --git a/README.md b/README.md index 333eb1800c9401160d66e478ac4f3a323dd75a90..58056ddf9e22c0f6cb8414640bf6606214dd0b12 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,11 @@ ## What is Kayak UI? Kayak UI is a declarative UI that can be used to make user interfaces in Rust primarily targeting games. It's free and open-source! +Check out the book! +[Kayak UI Book](./book/src/SUMMARY.md) + ## WARNING -Kayak UI is in the very early stages of development. Important features are missing and documentation is non-existent. Kayak UI is designed to only work with Bevy. +Kayak UI is in the very early stages of development. Important features are missing and some documentation is missing. Kayak UI is designed to only work with Bevy. ## Features - Easy to use declarative syntax using a custom proc macro @@ -41,12 +44,17 @@ Kayak UI is in the very early stages of development. Important features are miss <img src="images/screen1.png" alt="Kayak UI" width="600" /> ## Usage -Use bevy main! Make sure the version of Kayak you are using uses the same version of bevy. +Use bevy `0.9`! Make sure the version of Kayak you are using uses the same version of bevy. ```rust -kayak_ui = { git="https://github.com/StarArawn/kayak_ui", rev="{INSERT_COMMIT_SHA_HERE}" } -bevy = { git = "https://github.com/bevyengine/bevy", rev="1914a3f288a812667f735ee9e7806cf1560dacc0" } +kayak_ui = "0.1" +bevy = "0.9" ``` +|bevy|kayak_ui| +|---|---| +|`main`|`bevy-track`| +|0.9|0.1| + ## Check out the book! [Kayak UI Book](./book/src/SUMMARY.md) diff --git a/kayak_font/Cargo.toml b/kayak_font/Cargo.toml index 1ec53adcb90cf9eabf638ddee98b250676e9baa9..d759b09b693eea46cd8741a8e35556d8a54a85d5 100644 --- a/kayak_font/Cargo.toml +++ b/kayak_font/Cargo.toml @@ -15,8 +15,8 @@ unicode-segmentation = "1.10.0" # Provides UAX #14 line break segmentation xi-unicode = "0.3" -bevy = { git = "https://github.com/bevyengine/bevy", rev="1914a3f288a812667f735ee9e7806cf1560dacc0", optional = true, default-features = false, features = ["bevy_asset", "bevy_render", "bevy_core_pipeline"] } +bevy = { git = "https://github.com/bevyengine/bevy", version = "0.9", optional = true, default-features = false, features = ["bevy_asset", "bevy_render", "bevy_core_pipeline"] } [dev-dependencies] -bevy = { git = "https://github.com/bevyengine/bevy", rev="1914a3f288a812667f735ee9e7806cf1560dacc0" } +bevy = { git = "https://github.com/bevyengine/bevy", version = "0.9" } bytemuck = "1.12.0" diff --git a/kayak_font/assets/roboto.png b/kayak_font/assets/roboto.png new file mode 100644 index 0000000000000000000000000000000000000000..1e35a6327fe8243d1e51ca56b06183733799628d Binary files /dev/null and b/kayak_font/assets/roboto.png differ diff --git a/kayak_ui_macros/Cargo.toml b/kayak_ui_macros/Cargo.toml index 84d689fd9cd4bbba2103e62de1473e01a233b4bb..2ef15e260f86fcd4a3da50e3417dfaa002093342 100644 --- a/kayak_ui_macros/Cargo.toml +++ b/kayak_ui_macros/Cargo.toml @@ -17,4 +17,4 @@ proc-macro-crate = "1.1" [dev-dependencies] kayak_ui = { path = "../", version = "0.1.0" } pretty_assertions = "1.2.1" -bevy = { git = "https://github.com/bevyengine/bevy", rev="1914a3f288a812667f735ee9e7806cf1560dacc0" } \ No newline at end of file +bevy = { git = "https://github.com/bevyengine/bevy", version = "0.9" } \ No newline at end of file diff --git a/src/input.rs b/src/input.rs index 3ef2709154f228f2dcbf4a71268562d02823348a..cf6f5ee0da84cd770d3c05206c602f248b5105f3 100644 --- a/src/input.rs +++ b/src/input.rs @@ -14,17 +14,17 @@ use crate::{ }; pub(crate) fn process_events(world: &mut World) { - // let window_size = if let Some(windows) = world.get_resource::<Windows>() { - // if let Some(window) = windows.get_primary() { - // Vec2::new(window.width(), window.height()) - // } else { - // // log::warn!("Couldn't find primiary window!"); - // return; - // } - // } else { - // // log::warn!("Couldn't find primiary window!"); - // return; - // }; + let window_size = if let Some(windows) = world.get_resource::<Windows>() { + if let Some(window) = windows.get_primary() { + Vec2::new(window.width(), window.height()) + } else { + log::warn!("Couldn't find primiary window!"); + return; + } + } else { + log::warn!("Couldn't find primiary window!"); + return; + }; let mut input_events = Vec::new(); @@ -64,7 +64,7 @@ pub(crate) fn process_events(world: &mut World) { // Currently, we can only handle a single MouseMoved event at a time so everything but the last needs to be skipped input_events.push(InputEvent::MouseMoved(( event.position.x as f32, - event.position.y as f32, + window_size.y - event.position.y as f32, ))); } diff --git a/src/render/image/extract.rs b/src/render/image/extract.rs index c5ab6f4b67a18b7dfd23a79c28712dbf1952f967..0af91427e23d714a9c3d4fc74bf11c4714d61d0a 100644 --- a/src/render/image/extract.rs +++ b/src/render/image/extract.rs @@ -5,7 +5,7 @@ use crate::{ }; use bevy::{math::Vec2, prelude::Rect, render::color::Color}; -pub fn extract_images(render_command: &RenderPrimitive, dpi: f32) -> Vec<ExtractQuadBundle> { +pub fn extract_images(render_command: &RenderPrimitive, _dpi: f32) -> Vec<ExtractQuadBundle> { let (border_radius, layout, handle) = match render_command { RenderPrimitive::Image { border_radius,