Skip to content

Commit 5a7830f

Browse files
authored
Merge pull request #223 from StarArawn/release-prep
Release prep
2 parents c4af47c + 45bad4b commit 5a7830f

File tree

6 files changed

+38
-27
lines changed

6 files changed

+38
-27
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "kayak_ui"
33
description = "A UI library built using the bevy game engine!"
4-
version = "0.2.0"
4+
version = "0.3.0"
55
edition = "2021"
66
resolver = "2"
77
authors = ["John Mitchell"]
@@ -19,9 +19,9 @@ members = ["kayak_ui_macros", "kayak_font"]
1919
bevy = { version = "0.10", default-features = false, features = ["bevy_render", "bevy_asset", "bevy_winit", "bevy_core_pipeline", "bevy_ui"] }
2020
bytemuck = "1.12"
2121
dashmap = "5.4"
22-
kayak_font = { path = "./kayak_font", version = "0.2" }
22+
kayak_font = { path = "./kayak_font", version = "0.3" }
2323
morphorm = "0.3"
24-
kayak_ui_macros = { path = "./kayak_ui_macros", version = "0.2" }
24+
kayak_ui_macros = { path = "./kayak_ui_macros", version = "0.3" }
2525
indexmap = "1.9"
2626
log = "0.4"
2727
bitflags = "1.3.2"

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Kayak UI is in the very early stages of development. Important features are miss
3535
- Custom UI node to ensure UI renders on top of 3D and 2D entities.
3636
- Fully integrated into bevy to capture input events, use bevy assets(images, etc).
3737
- Dpi Scaling
38+
- Batched Rendering
3839

3940
## Missing features
4041
- More default widgets.
@@ -44,16 +45,17 @@ Kayak UI is in the very early stages of development. Important features are miss
4445
<img src="images/screen1.png" alt="Kayak UI" width="600" />
4546

4647
## Usage
47-
Use bevy `0.9`! Make sure the version of Kayak you are using uses the same version of bevy.
48+
Use bevy `0.10`! Make sure the version of Kayak you are using uses the same version of bevy.
4849

4950
```rust
5051
kayak_ui = "0.2"
51-
bevy = "0.9"
52+
bevy = "0.10"
5253
```
5354

5455
|bevy|kayak_ui|
5556
|---|---|
5657
|`main`|`bevy-track`|
58+
|0.10|0.3|
5759
|0.9|0.2|
5860
|0.9|0.1|
5961

book/src/chapter_1.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,50 @@ Once you've added Kayak UI to your bevy project you can now start to use it! In
1010
Hello World Example:
1111
```rust
1212
use bevy::prelude::*;
13-
use kayak_ui::prelude::{widgets::*, *};
13+
use kayak_ui::{
14+
prelude::{widgets::*, *},
15+
CameraUIKayak,
16+
};
1417

1518
fn startup(
1619
mut commands: Commands,
1720
mut font_mapping: ResMut<FontMapping>,
1821
asset_server: Res<AssetServer>,
1922
) {
20-
font_mapping.set_default(asset_server.load("roboto.kayak_font"));
23+
let camera_entity = commands
24+
.spawn(Camera2dBundle::default())
25+
.insert(CameraUIKayak)
26+
.id();
27+
28+
font_mapping.set_default(asset_server.load("roboto.kttf"));
2129

22-
let mut widget_context = KayakRootContext::new();
30+
let mut widget_context = KayakRootContext::new(camera_entity);
2331
widget_context.add_plugin(KayakWidgetsContextPlugin);
2432
let parent_id = None;
25-
26-
// The rsx! macro expects a parent_id, a widget_context from the user.
27-
// It also expects `Commands` from bevy.
28-
// This can be a little weird at first.
29-
// See the rsx! docs for more info!
3033
rsx! {
3134
<KayakAppBundle>
3235
<TextWidgetBundle
3336
text={TextProps {
3437
content: "Hello World".into(),
38+
size: 20.0,
3539
..Default::default()
3640
}}
3741
/>
3842
</KayakAppBundle>
3943
};
40-
41-
commands.spawn(UICameraBundle::new(widget_context));
44+
45+
commands.spawn((widget_context, EventDispatcher::default()));
4246
}
4347

4448
fn main() {
4549
App::new()
46-
.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
50+
.add_plugins(DefaultPlugins)
4751
.add_plugin(KayakContextPlugin)
4852
.add_plugin(KayakWidgets)
4953
.add_startup_system(startup)
5054
.run()
5155
}
56+
5257
```
5358

5459
## Wait where is the ECS?
@@ -64,11 +69,16 @@ fn startup(
6469
mut font_mapping: ResMut<FontMapping>,
6570
asset_server: Res<AssetServer>,
6671
) {
67-
font_mapping.set_default(asset_server.load("roboto.kayak_font"));
68-
commands.spawn(UICameraBundle::new());
69-
let mut widget_context = KayakRootContext::new();
72+
let camera_entity = commands
73+
.spawn(Camera2dBundle::default())
74+
.insert(CameraUIKayak)
75+
.id();
76+
77+
font_mapping.set_default(asset_server.load("roboto.kttf"));
78+
let mut widget_context = KayakRootContext::new(camera_entity);
79+
widget_context.add_plugin(KayakWidgetsContextPlugin);
7080

71-
let app_entity = widget_context.spawn_widget(&mut commands, None);
81+
let app_entity = widget_context.spawn_widget(&mut commands, None, None);
7282
// Create default app bundle
7383
let mut app_bundle = KayakAppBundle {
7484
..Default::default()
@@ -78,7 +88,7 @@ fn startup(
7888
let mut children = KChildren::new();
7989

8090
// Create the text child
81-
let text_entity = widget_context.spawn_widget(&mut commands, Some(app_entity));
91+
let text_entity = widget_context.spawn_widget(&mut commands, None, None);
8292
commands.entity(text_entity).insert(TextWidgetBundle {
8393
text: TextProps {
8494
content: "Hello World".into(),
@@ -97,8 +107,8 @@ fn startup(
97107
widget_context.add_widget(None, app_entity);
98108

99109
// Add widget context as resource.
100-
101-
commands.spawn(UICameraBundle::new(widget_context));
110+
111+
commands.spawn((widget_context, EventDispatcher::default()));
102112
}
103113
fn main() {
104114
App::new()
@@ -108,5 +118,4 @@ fn main() {
108118
.add_startup_system(startup)
109119
.run()
110120
}
111-
112121
```

book/src/chapter_6.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The char range is a defined as u32 char values. 0x20 through 0x7f represents mos
1717

1818
Fonts are also stored as an atlased image and a json file which tells Kayak about the font glyphs. These fonts are generated using `msdf-atlas-gen`. Check out `roboto.kayak_font` and `roboto.png` in the `assets` folder. The cached file name will be located next to the kttf file and have the file format of: `{font_name}.kttf-cached.png`.
1919

20-
## Generating new fonts.
20+
### Generating Legacy `*.kayak_font`. WARNING! Does not work in wasm.
2121
In order to create a new font you need to use the `msdf-atlas-gen` tool. This can be found at:
2222
[https://github.com/Chlumsky/msdf-atlas-gen](https://github.com/Chlumsky/msdf-atlas-gen)
2323

kayak_font/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "kayak_font"
33
description = "An SDF font renderer for Kayak UI and the Bevy game engine"
4-
version = "0.2.0"
4+
version = "0.3.0"
55
edition = "2021"
66
resolver = "2"
77
authors = ["John Mitchell"]

kayak_ui_macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "kayak_ui_macros"
33
description = "A proc macro library that provides RSX like syntax for Kayak UI."
4-
version = "0.2.0"
4+
version = "0.3.0"
55
edition = "2021"
66
resolver = "2"
77
authors = ["John Mitchell"]

0 commit comments

Comments
 (0)