mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-23 18:06:34 +11:00
Basic splash screen
Just has key bindings for now.
This commit is contained in:
parent
8a083d9473
commit
152fa00843
1 changed files with 24 additions and 0 deletions
|
@ -27,6 +27,7 @@ pub fn test_scenes() -> SceneSet {
|
|||
// For WASM below, must be mutable
|
||||
#[allow(unused_mut)]
|
||||
let mut scenes = vec![
|
||||
scene!(splash_screen),
|
||||
scene!(funky_paths),
|
||||
scene!(cardioid_and_friends),
|
||||
scene!(animated_text: animated),
|
||||
|
@ -627,3 +628,26 @@ fn make_diamond(cx: f64, cy: f64) -> [PathEl; 5] {
|
|||
PathEl::ClosePath,
|
||||
]
|
||||
}
|
||||
|
||||
fn splash_screen(sb: &mut SceneBuilder, params: &mut SceneParams) {
|
||||
let strings = [
|
||||
"Vello test",
|
||||
"key bindings:",
|
||||
" Arrow keys: switch scenes",
|
||||
" S: toggle stats",
|
||||
" V: toggle vsync",
|
||||
" Q, E: rotate",
|
||||
" Space: reset transform",
|
||||
];
|
||||
for (i, s) in strings.iter().enumerate() {
|
||||
let text_size = if i == 0 { 60.0 } else { 40.0 };
|
||||
params.text.add(
|
||||
sb,
|
||||
None,
|
||||
text_size,
|
||||
None,
|
||||
Affine::translate((100.0, 100.0 + 60.0 * i as f64)),
|
||||
s,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue