I'm trying to build an app with nannou. I started to experiment with DropDownList a little bit, and I cannot see any texts in it. Then I also added couple sliders from the examples of nannou - and I cannot see texts there too. Here's the repo Files · 95b6fb28f7a859051615b3e628a875bf42cb5cc4 · Viktor Lazarev / oxyfy · GitLab
Cargo.lock:
[package]
name = "oxyfy"
version = "0.0.1"
authors = ["Viktor Lazarev <taurus101v@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
nannou = "0.10"
[patch.crates-io]
"vulkano" = { git = "https://github.com/vulkano-rs/vulkano.git", rev = "0a8944362a176885d13a84a1ea5a0e3d9b09b706" }
"vulkano-win" = { git = "https://github.com/vulkano-rs/vulkano.git", rev = "0a8944362a176885d13a84a1ea5a0e3d9b09b706" }
"vulkano-shaders" = { git = "https://github.com/vulkano-rs/vulkano.git", rev = "0a8944362a176885d13a84a1ea5a0e3d9b09b706" }
"vk-sys" = { git = "https://github.com/vulkano-rs/vulkano.git", rev = "0a8944362a176885d13a84a1ea5a0e3d9b09b706" }
main.rs (here I've removed not related code to reduce its size):
use nannou::{prelude::*, ui::prelude::*};
fn main() {
nannou::app(model).update(update).simple_window(view).run();
}
struct Model {
filenames: Vec<String>,
selected: Option<usize>,
ui: Ui,
ids: Ids,
}
struct Ids {
dd_list: widget::Id,
}
fn model(app: &App) -> Model {
app.set_loop_mode(LoopMode::wait(3));
let mut ui = app.new_ui().build().unwrap();
let filenames = vec![
"Option 1".to_string(),
"Option 2".to_string(),
"Option 3".to_string(),
];
let selected = None;
let ids = Ids {
dd_list: ui.generate_widget_id(),
};
Model {
filenames,
selected,
ui,
ids,
}
}
fn update(_app: &App, model: &mut Model, _update: Update) {
let ui = &mut model.ui.set_widgets();
for selected in widget::DropDownList::new(&model.filenames, model.selected)
.down(10.0)
.w_h(800.0, 30.0)
.label("Colors")
.label_color(ui::color::BLACK)
.color(ui::color::BLUE)
.label_font_size(16)
.border(1.0)
.set(model.ids.dd_list, ui)
{
println!("selected {:?}", selected);
model.selected = Some(selected);
}
}
fn view(app: &App, model: &Model, frame: &Frame) {
frame.clear(PURPLE);
model.ui.draw_to_frame(app, &frame).unwrap();
}
Nannou looks very promising, but this really blocks me to go further. Any ideas how to fix this?