finite_draw_text_group
The finite_draw_text_group function attempts to draw a set of FiniteTextGroups to the screen.
void finite_draw_text_group(FiniteShell *shell, FiniteTextGroup *groups, double x, double y, size_t n)Parameters
Section titled “Parameters”| Type | Description |
|---|---|
FiniteShell *shell | The FiniteShell where the window is. |
FiniteTextGroup *groups | An array of FiniteTextGroups. |
double x | The x position to set the draw position to. |
double y | The y position to set the draw position to. |
size_t n | The number of FiniteTextGroups in groups |
Code Example
Section titled “Code Example”#include <finite/draw.h>
finite_draw_set_font(shell, "Kumbh Sans", false, true, 52);
cairo_text_extents_t ext;
FiniteTextGroup parts[3] = { {1,1,1,1,"Welcome to the "}, {0.964, 0.674, 0.192,1,"Infinite "}, {1,1,1,1,"Level"}};
cairo_font_extents_t fext = finite_draw_get_font_extents(shell);printf("Font height: %f\n", fext.height);
finite_draw_text_group(shell, parts, (shell->details->width * 0.03), (shell->details->height * 0.1), 3);This function should have an array of atleast two FiniteTextGroups. Having less than 2 is both pointless and unnessary.
If shell.cr is undefined, this function will create a new Cairo draw tool and set it to shell.cr
Standard Usage
Section titled “Standard Usage”This function must have a valid FiniteShell
This function uses Cairo which requires a valid cairo_surface_t in FiniteShell.cairo_surface beforehand.