Documentation

nvg

Namespace

NanoVG bindings.

class nvg::Texture

Represents a texture for the NanoVG API.

class nvg::Paint

A paint style that can be used as a fill or a stroke.

Texture@ nvg::LoadTexture(MemoryBuffer&in buffer, int flags = 0)

Load a texture for the NanoVG API from a memory buffer.

Returns nvg::Texture@
float nvg::Text(float x, float y, const string&in str)

Draws text using the current font settings.

Returns float
float nvg::Text(const vec2&in pos, const string&in str)

Draws text using the current font settings.

Returns float
void nvg::TextBox(float x, float y, float w, const string&in str)

Draws text inside of a word wrapping box using the current font settings.

void nvg::TextBox(const vec2&in pos, float w, const string&in str)

Draws text inside of a word wrapping box using the current font settings.

vec2 nvg::TextBounds(const string&in str)

Measures the size of the given text using the current font settings.

Returns vec2
vec2 nvg::TextBoxBounds(float w, const string&in str)

Measures the size of the given text inside of a word wrapping box using the current font settings.

Returns vec2
enum nvg::TextureFlags

Flags to use when loading NanoVG textures.