veloren_voxygen/ui/ice/renderer/
primitive.rs

1use crate::ui::{graphic, ice::widget::image};
2
3#[derive(Debug)]
4pub enum Primitive {
5    // Allocation :(
6    Group {
7        primitives: Vec<Primitive>,
8    },
9    Image {
10        handle: (image::Handle, graphic::Rotation),
11        bounds: iced::Rectangle,
12        color: vek::Rgba<u8>,
13        source_rect: Option<vek::Aabr<f32>>,
14    },
15    // A vertical gradient
16    // TODO: could be combined with rectangle
17    Gradient {
18        bounds: iced::Rectangle,
19        top_linear_color: vek::Rgba<f32>,
20        bottom_linear_color: vek::Rgba<f32>,
21    },
22    Rectangle {
23        bounds: iced::Rectangle,
24        linear_color: vek::Rgba<f32>,
25    },
26    Text {
27        glyphs: Vec<glyph_brush::SectionGlyph>,
28        bounds: iced::Rectangle,
29        linear_color: vek::Rgba<f32>,
30    },
31    Clip {
32        bounds: iced::Rectangle,
33        offset: vek::Vec2<u32>,
34        content: Box<Primitive>,
35    },
36    // Make content translucent
37    Opacity {
38        alpha: f32,
39        content: Box<Primitive>,
40    },
41    Nothing,
42}