Skip to content
Snippets Groups Projects
Unverified Commit 8a2ccdbc authored by John's avatar John Committed by GitHub
Browse files

Merge pull request #158 from StarArawn/pre-release

Pre release
parents 5c81aaef adb22f98
No related branches found
No related tags found
No related merge requests found
......@@ -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" }
......
......@@ -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)
......@@ -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"
kayak_font/assets/roboto.png

95.9 KiB

......@@ -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
......@@ -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,
)));
}
......
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment