natiny_render_view
void natiny_render_view(NatinyView view, float x, float y,
float w, float h);
Lays out a view and everything in it inside a rectangle, runs their pointer hooks, and calls their draw hooks on the current render target.
Parameters
| Name | Type | Description |
|---|---|---|
view |
NatinyView |
Root view handle from natiny_view_create |
x, y |
float |
Top-left corner of the space the root is placed in, in drawing units |
w, h |
float |
Size of that space, in drawing units |
Example
natiny_window_bind(win);
natiny_render_clear(background);
natiny_render_view(ui, 0.0f, 0.0f,
(float)natiny_window_get_width(win),
(float)natiny_window_get_height(win));
natiny_window_unbind();
Notes
- Called from inside a hook, it does nothing.
- A hook that moves, resizes, shows or hides a view is laid out again before anything is drawn, so what a press changes is on screen in the frame the press was made.