mirror of
https://github.com/slint-ui/slint.git
synced 2025-12-04 09:02:55 +00:00
Allow testing the individual Rust tutorial steps by hand
Might be useful for regression testing
This commit is contained in:
parent
b67ad35319
commit
a31e7e4220
4 changed files with 38 additions and 2 deletions
|
|
@ -37,6 +37,7 @@ members = [
|
|||
'tests/driver/cpp',
|
||||
'tests/driver/nodejs',
|
||||
'tests/driver/interpreter',
|
||||
'docs/tutorial/src',
|
||||
]
|
||||
|
||||
default-members = [
|
||||
|
|
|
|||
35
docs/tutorial/src/Cargo.toml
Normal file
35
docs/tutorial/src/Cargo.toml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
[package]
|
||||
name = "src"
|
||||
version = "0.1.0"
|
||||
authors = ["SixtyFPS <info@sixtyfps.io>"]
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[[bin]]
|
||||
name = "memory_tutorial_initial"
|
||||
path = "main_initial.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "memory_tutorial_tile"
|
||||
path = "main_memory_tile.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "memory_tutorial_polishing_the_tile"
|
||||
path = "main_polishing_the_tile.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "memory_tutorial_multiple_tiles"
|
||||
path = "main_multiple_tiles.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "memory_tutorial_tiles_from_rust"
|
||||
path = "main_tiles_from_rust.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "memory_tutorial_game_logic_in_rust"
|
||||
path = "main_game_logic_in_rust.rs"
|
||||
|
||||
[dependencies]
|
||||
sixtyfps = { path = "../../../api/sixtyfps-rs" }
|
||||
rand = "0.8"
|
||||
|
|
@ -15,13 +15,13 @@ index with a little bit of spacing between the tiles.
|
|||
First, we copy the tile data structure definition and paste it at top inside the `sixtyfps!` macro:
|
||||
|
||||
```60
|
||||
{{#include main_from_one_to_multiple_tiles.rs:tile_data}}
|
||||
{{#include main_multiple_tiles.rs:tile_data}}
|
||||
```
|
||||
|
||||
Next, we replace the *`MainWindow` := { ... }* section at the bottom of the `sixtyfps!` macro with the following snippet:
|
||||
|
||||
```60
|
||||
{{#include main_from_one_to_multiple_tiles.rs:main_window}}
|
||||
{{#include main_multiple_tiles.rs:main_window}}
|
||||
```
|
||||
|
||||
The `for tile[i] in memory_tiles :` syntax declares a variable `tile` which contains the data of one element from the `memory_tiles` array,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue