tutorialsthe c abi
4. shapes and colours
rounded boxes, circles and lines, all out of panels
a panel takes a corner radius, and that one number gets you most shapes. add these under the orange
box, before gui_host_set_root
// the same box with rounded corners, 12 is how round
gui_control_t* round = NULL;
gui_panel_create(0xFF40A0E0, 12.0f, &round);
gui_control_set_bounds(round, 180, 40, 120, 80);
// a radius of half the size rounds a square all the way into a circle
gui_control_t* dot = NULL;
gui_panel_create(0xFF60C060, 40.0f, &dot);
gui_control_set_bounds(dot, 320, 40, 80, 80);
// and a panel 2 px tall is a line
gui_control_t* line = NULL;
gui_panel_create(0xFFFFFFFF, 0.0f, &line);
gui_control_set_bounds(line, 40, 160, 500, 2);
gui_control_add(root, round);
gui_control_add(root, dot);
gui_control_add(root, line);radius 0 | square corners |
| radius half the size | a circle, or a pill if the box is wider than it is tall |
0x80 alpha | half see through, so 0x80E06040 is the orange at half |
anything a panel cant make, an outline, a diagonal line, a star, is an svg. gui_icon_create,
gui_icon_parse and gui_icon_view_create put one in, see controls
you should see the orange box, a blue rounded box and a green circle in a row, with a white line under them