FyroxEngine / Fyrox

3D and 2D game engine written in Rust
https://fyrox.rs
MIT License
7.64k stars 343 forks source link

UI: Z index does nothing #356

Closed martin-t closed 3 months ago

martin-t commented 2 years ago

Example:

let prompt2 = fyrox::gui::text_box::TextBoxBuilder::new(
    WidgetBuilder::new()
        .with_desired_position(fyrox::core::algebra::Vector2::new(50.0, 50.0))
        .with_z_index(10)
        .with_foreground(Brush::Solid(Color::RED))
        .with_background(Brush::Solid(Color::BLACK)),
)
.with_text("> PROMPT2222222")
.build(&mut engine.user_interface.build_ctx());

let prompt3 = fyrox::gui::text_box::TextBoxBuilder::new(
    WidgetBuilder::new()
        .with_desired_position(fyrox::core::algebra::Vector2::new(55.0, 60.0))
        .with_z_index(5)
        .with_foreground(Brush::Solid(Color::RED))
        .with_background(Brush::Solid(Color::BLACK)),
)
.with_text("> PROMPT3333333333")
.build(&mut engine.user_interface.build_ctx());

I hope i am using it correctly. It doesn't matter if i change the 5 and 10 numbers, prompt3 is always above prompt2.