natiny_render_rounded_rectangle_outline

C
void natiny_render_rounded_rectangle_outline(
    float x, float y, float w, float h,
    float radius_tl, float radius_tr, float radius_br, float radius_bl,
    float thickness
);

Draws the outline of a rectangle with each corner rounded by a radius of its own, on the currently bound render target, using the current drawing color set by natiny_render_set_color().

The radii are given in the order the CSS box model uses - top-left, top-right, bottom-right, bottom-left.

Parameters

Name Type Description
x float Left edge X position
y float Top edge Y position
w float Width
h float Height
radius_tl float Top-left corner radius
radius_tr float Top-right corner radius
radius_br float Bottom-right corner radius
radius_bl float Bottom-left corner radius
thickness float Outline thickness

Example

C
natiny_render_rounded_rectangle_outline(40.0f, 40.0f, 240.0f, 140.0f,
                                      14.0f, 14.0f, 14.0f, 14.0f, 2.0f);

Notes

  • The stroke is centered on the box boundary: half lies inside and half outside.
  • Negative radii become 0.0f; oversized radii are scaled together to fit. All-zero radii produce a rectangle outline.
  • Zero or negative w, h or thickness draws nothing.