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

Merge pull request #203 from spider-killer556/main

book: Fix typos in the book chapter numbers
parents efe0e027 8330e563
No related branches found
No related tags found
No related merge requests found
# Chapter 2 - Creating custom widgets!
# Chapter 3 - Creating custom widgets!
Kayak UI allows users to create custom widgets.
Widgets are structured in a few different ways:
......
# Chapter 3 - State
# Chapter 4 - State
State is data that is directly associated with a particular widget. State persists during re-renders, but will be destroyed when an widget is despawned.
State can be created in Kayak easily, here is an example:
......
# Chapter 4 - Context
# Chapter 5 - Context
Context in Kayak UI allows users to pass data through the widget tree without having to pass data between each widget at every level in the tree.
Typically in Kayak the data is passed top-down or parent to child via "props", but this can be cumbersome when dealing with complex widget trees. Context provides a way to share values from a parent widget down to children without the need to explicitly pass that data through every level of the tree.
......@@ -45,4 +45,4 @@ fn my_child_widget_render(
When a widget is associated with context it's important that the widget update system is aware of this. By default the `widget_update` diff system is used. This accepts types for props and state but not for context. A separate system called `widget_update_with_context` can be used which takes an optional third type for context.
### Important!
`widget_update_with_context` is only designed to work with one type of context. If you need multiple context diffing for a single widget it's advised that you use a custom widget update system.
\ No newline at end of file
`widget_update_with_context` is only designed to work with one type of context. If you need multiple context diffing for a single widget it's advised that you use a custom widget update system.
# Chapter 5 - Fonts
# Chapter 6 - Fonts
Kayak UI uses SDF(signed distance fields) for rendering fonts. More specifically it uses multi-channel signed distance fields. Reasons for why we use MSDF:
- High Quality font rendering.
- Fast rendering!
......@@ -25,4 +25,4 @@ Please refer to the documentation found in the link about for generating fonts.
```
.\msdf-atlas-gen.exe -font .\my_font.ttf -type msdf -minsize 32 -format png -imageout my_font.png -json my_font.kayak_font
```
\ No newline at end of file
```
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