pub fn draw_box(
box_type: FrameType,
x: i32,
y: i32,
w: i32,
h: i32,
color: Color,
)Expand description
Draws a box given the box type, size, position and color
Examples found in repository?
examples/table.rs (lines 48-55)
46fn draw_header(txt: &str, x: i32, y: i32, w: i32, h: i32) {
47 draw::push_clip(x, y, w, h);
48 draw::draw_box(
49 enums::FrameType::ThinUpBox,
50 x,
51 y,
52 w,
53 h,
54 enums::Color::FrameDefault,
55 );
56 draw::set_draw_color(enums::Color::Black);
57 draw::set_font(enums::Font::Helvetica, 14);
58 draw::draw_text_boxed(txt, x, y, w, h, enums::Align::Center);
59 draw::pop_clip();
60}More examples
examples/spreadsheet.rs (lines 114-121)
112 fn draw_header(txt: &str, x: i32, y: i32, w: i32, h: i32) {
113 draw::push_clip(x, y, w, h);
114 draw::draw_box(
115 enums::FrameType::ThinUpBox,
116 x,
117 y,
118 w,
119 h,
120 enums::Color::FrameDefault,
121 );
122 draw::set_draw_color(enums::Color::Black);
123 draw::set_font(enums::Font::Helvetica, 14);
124 draw::draw_text_boxed(txt, x, y, w, h, enums::Align::Center);
125 draw::pop_clip();
126 }