Colors in NanoVG are stored as unsigned ints in ABGR format.
NanoVG contains state which represents how paths will be rendered. The state contains transform, fill and stroke styles, text and font styles, and scissor clipping.
Fill and stroke render style can be either a solid color or a paint which is a gradient or a pattern. Solid color is simply defined as a color value,
different kinds of paints can be created using LinearGradient, BoxGradient, RadialGradient and ImagePattern.
Current render style can be saved and restored using Save and Restore.
The paths, gradients, patterns and scissor region are transformed by an transformation matrix at the time when they are passed to the API. The current transformation matrix is a affine matrix:
[sx kx tx]
[ky sy ty]
[ 0 0 1]
Where: sx,sy define scaling, kx,ky skewing, and tx,ty translation. The last row is assumed to be 0,0,1 and is not
stored.
Apart from ResetTransform, each transformation function first creates specific transformation matrix and pre-multiplies the current transformation
by it.
Current coordinate system (transformation) can be saved and restored using Save and Restore.
NanoVG allows you to load jpg, png, psd, tga, pic and gif files to be used for rendering. In addition you can upload your own image. The image loading
is provided by stb_image.
NanoVG supports four types of paints: linear gradient, box gradient, radial gradient and image pattern. These can be used as paints for strokes and fills.
Scissoring allows you to clip the rendering into a rectangle. This is useful for various user interface cases like rendering a text edit or a timeline.
Drawing a new shape starts with BeginPath, it clears all the currently defined paths. Then you define one or more paths and sub-paths which describe
the shape. The are functions to draw common shapes like rectangles and circles, and lower level step-by-step functions, which allow to define a path
curve by curve.
NanoVG uses even-odd fill rule to draw the shapes. Solid shapes should have counter clockwise winding and holes should have counter clockwise order. To
specify winding of a path you can call PathWinding. This is useful especially for the common shapes, which are drawn CCW.
Finally you can fill the path using current fill style by calling Fill, and stroke it with current stroke style by calling Stroke.
The curve segments and sub-paths are transformed by the current transform.
NanoVG allows you to load .ttf files and use the font to render text.
The appearance of the text can be defined by setting the current text style and by specifying the fill color. Common text and font settings such as font size, letter spacing and text align are supported. Font blur allows you to create simple text effects such as drop shadows.
At render time the font face can be set based on the font handles or name.
Font measure functions return values in local space, the calculations are carried in the same resolution as the final rendering. This is done because the text glyph positions are snapped to the nearest pixels sharp rendering.
The local space means that values are not rotated or scale as per the current transformation. For example if you set font size to 12, which would mean that line height is 16, then regardless of the current scaling and rotation, the returned line height is always 16. Some measures may vary because of the scaling since aforementioned pixel snapping.
While this may sound a little odd, the setup allows you to always render the same way regardless of scaling. I.e. following works regardless of scaling:
const char* txt = "Text me up.";
nvgTextBounds(vg, x,y, txt, NULL, bounds);
nvgBeginPath(vg);
nvgRoundedRect(vg, bounds[0],bounds[1], bounds[2]-bounds[0], bounds[3]-bounds[1]);
nvgFill(vg);Note
currently only solid color fill is supported for text.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | NVG_ALIGN_BASELINE
Alignments. |
| public static final int | NVG_ALIGN_BOTTOM
Alignments. |
| public static final int | NVG_ALIGN_CENTER
Alignments. |
| public static final int | NVG_ALIGN_LEFT
Alignments. |
| public static final int | NVG_ALIGN_MIDDLE
Alignments. |
| public static final int | NVG_ALIGN_RIGHT
Alignments. |
| public static final int | NVG_ALIGN_TOP
Alignments. |
| public static final int | NVG_ATOP
Composite operations. |
| public static final int | NVG_BEVEL
Line caps and joins. |
| public static final int | NVG_BUTT
Line caps and joins. |
| public static final int | NVG_CCW
Winding order. |
| public static final int | NVG_COPY
Composite operations. |
| public static final int | NVG_CW
Winding order. |
| public static final int | NVG_DESTINATION_ATOP
Composite operations. |
| public static final int | NVG_DESTINATION_IN
Composite operations. |
| public static final int | NVG_DESTINATION_OUT
Composite operations. |
| public static final int | NVG_DESTINATION_OVER
Composite operations. |
| public static final int | NVG_DST_ALPHA
Blend factors. |
| public static final int | NVG_DST_COLOR
Blend factors. |
| public static final int | NVG_HOLE
Solidity. |
| public static final int | NVG_IMAGE_FLIPY
Image flags. |
| public static final int | NVG_IMAGE_GENERATE_MIPMAPS
Image flags. |
| public static final int | NVG_IMAGE_NEAREST
Image flags. |
| public static final int | NVG_IMAGE_PREMULTIPLIED
Image flags. |
| public static final int | NVG_IMAGE_REPEATX
Image flags. |
| public static final int | NVG_IMAGE_REPEATY
Image flags. |
| public static final int | NVG_LIGHTER
Composite operations. |
| public static final int | NVG_MITER
Line caps and joins. |
| public static final int | NVG_ONE
Blend factors. |
| public static final int | NVG_ONE_MINUS_DST_ALPHA
Blend factors. |
| public static final int | NVG_ONE_MINUS_DST_COLOR
Blend factors. |
| public static final int | NVG_ONE_MINUS_SRC_ALPHA
Blend factors. |
| public static final int | NVG_ONE_MINUS_SRC_COLOR
Blend factors. |
| public static final float | NVG_PI
PI |
| public static final int | NVG_ROUND
Line caps and joins. |
| public static final int | NVG_SOLID
Solidity. |
| public static final int | NVG_SOURCE_IN
Composite operations. |
| public static final int | NVG_SOURCE_OUT
Composite operations. |
| public static final int | NVG_SOURCE_OVER
Composite operations. |
| public static final int | NVG_SQUARE
Line caps and joins. |
| public static final int | NVG_SRC_ALPHA
Blend factors. |
| public static final int | NVG_SRC_ALPHA_SATURATE
Blend factors. |
| public static final int | NVG_SRC_COLOR
Blend factors. |
| public static final int | NVG_XOR
Composite operations. |
| public static final int | NVG_ZERO
Blend factors. |
| pack-priv static final long | |
| pack-priv static final long | |
| pack-priv static final long |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public static native int | |||||||||||||||||||||||||||||||||||||||||||||
| public static native int | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgBeginFrame(long ctx, float windowWidth, float windowHeight, float devicePixelRatio)
Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgBezierTo(long ctx, float c1x, float c1y, float c2x, float c2y, float x, float y)
Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgBoxGradient(long ctx, float x, float y, float w, float h, float r, float f, long icol, long ocol, long __result)
Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native int | |||||||||||||||||||||||||||||||||||||||||||||
| public static native int | nnvgCreateFontAtIndex(long ctx, long name, long filename, int fontIndex)
Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native int | nnvgCreateFontMem(long ctx, long name, long data, int
the font data size, in bytes ndata, int freeData)Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native int | nnvgCreateFontMemAtIndex(long ctx, long name, long data, int
the font data size, in bytes ndata, int freeData, int fontIndex)Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native int | |||||||||||||||||||||||||||||||||||||||||||||
| public static native int | nnvgCreateImageMem(long ctx, int imageFlags, long data, int
the image data size, in bytes ndata)Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native int | nnvgCreateImageRGBA(long ctx, int w, int h, int imageFlags, long data)
Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native int | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgGlobalCompositeBlendFunc(long ctx, int sfactor, int dfactor)
Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgGlobalCompositeBlendFuncSeparate(long ctx, int srcRGB, int dstRGB, int srcAlpha, int dstAlpha)
Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgImagePattern(long ctx, float ox, float oy, float ex, float ey, float angle, int image, float alpha, long __result)
Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgIntersectScissor(long ctx, float x, float y, float w, float h)
Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgLinearGradient(long ctx, float sx, float sy, float ex, float ey, long icol, long ocol, long __result)
Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgRadialGradient(long ctx, float cx, float cy, float inr, float outr, long icol, long ocol, long __result)
Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgRoundedRect(long ctx, float x, float y, float w, float h, float r)
Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgRoundedRectVarying(long ctx, float x, float y, float w, float h, float radTopLeft, float radTopRight, float radBottomRight, float radBottomLeft)
Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native float | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native float | nnvgTextBounds(long ctx, float x, float y, long string, long
a pointer to the end of the sub-string to measure, or end, long bounds)NULLUnsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native float | nnvgTextBounds(long ctx, float x, float y, long string, long end, float[] bounds)
Array version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgTextBox(long ctx, float x, float y, float breakRowWidth, long string, long
a pointer to the end of the sub-string to draw, or end)NULLUnsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgTextBoxBounds(long ctx, float x, float y, float breakRowWidth, long string, long
a pointer to the end of the sub-string to measure, or end, long bounds)NULLUnsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgTextBoxBounds(long ctx, float x, float y, float breakRowWidth, long string, long end, float[] bounds)
Array version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native int | nnvgTextBreakLines(long ctx, long string, long
a pointer to the end of the sub-string to measure, or end, float breakRowWidth, long rows, int NULLthe maximum number of text rows to return maxRows)Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native int | nnvgTextGlyphPositions(long ctx, float x, float y, long string, long
a pointer to the end of the sub-string to measure, or end, long positions, int NULLthe maximum number of glyph positions to return maxPositions)Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgTextMetrics(long ctx, float[] ascender, float[] descender, float[] lineh)
Array version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgTransform(long ctx, float a, float b, float c, float d, float e, float f)
Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native int | |||||||||||||||||||||||||||||||||||||||||||||
| public static native int | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgTransformPoint(long dstx, long dsty, long xform, float srcx, float srcy)
Unsafe version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | nnvgTransformPoint(float[] dstx, float[] dsty, float[] xform, float srcx, float srcy)
Array version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native void | |||||||||||||||||||||||||||||||||||||||||||||
| public static int | nvgAddFallbackFont(long
the NanoVG context ctx, ByteBuffer baseFont, ByteBuffer fallbackFont)Adds fallback font by name. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | nvgAddFallbackFont(long
the NanoVG context ctx, CharSequence baseFont, CharSequence fallbackFont)Adds fallback font by name. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | nvgAddFallbackFontId(long
the NanoVG context ctx, int baseFont, int fallbackFont)Adds fallback font by handle. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgArc(long
the NanoVG context ctx, float the arc center X axis coordinate cx, float the arc center Y axis coordinate cy, float the arc radius r, float the arc starting angle, in radians a0, float the arc ending angle, in radians a1, int dir)Creates new circle arc shaped sub-path. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgArcTo(long
the NanoVG context ctx, float the first point X axis coordinate x1, float the first point Y axis coordinate y1, float the second point X axis coordinate x2, float the second point Y axis coordinate y2, float the arc radius, in radians radius)Adds an arc segment at the corner defined by the last path point, and two specified points. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgBeginFrame(long
the NanoVG context ctx, float the window width windowWidth, float the window height windowHeight, float the device pixel ratio devicePixelRatio)Begins drawing a new frame. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgBezierTo(long
the NanoVG context ctx, float the first control point X axis coordinate c1x, float the first control point Y axis coordinate c1y, float the second control point X axis coordinate c2x, float the second control point Y axis coordinate c2y, float the point X axis coordinate x, float the point Y axis coordinate y)Adds cubic bezier segment from last point in the path via two control points to the specified point. | ||||||||||||||||||||||||||||||||||||||||||||
| public static NVGPaint | nvgBoxGradient(long
the NanoVG context ctx, float the rectangle left coordinate x, float the rectangle top coordinate y, float the rectangle width w, float the rectangle height h, float the corner radius r, float the feather value. Feather defines how blurry the border of the rectangle is. f, NVGColor the inner color icol, NVGColor the outer color ocol, NVGPaint __result)Creates and returns a box gradient. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgCircle(long
the NanoVG context ctx, float the circle center X axis coordinate cx, float the circle center Y axis coordinate cy, float the circle radius r)Creates new circle shaped sub-path. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static int | Returns: a handle to the fontthe NanoVG context ctx, ByteBuffer the font name name, ByteBuffer the font file name filename)Creates font by loading it from the disk from specified file name. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | Returns: a handle to the fontthe NanoVG context ctx, CharSequence the font name name, CharSequence the font file name filename)Creates font by loading it from the disk from specified file name. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | Returns: a handle to the fontthe NanoVG context ctx, ByteBuffer the font name name, ByteBuffer the font file name filename, int specifies which font face to load from a .ttf/.ttc file fontIndex)Creates font by loading it from the disk from specified file name. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | Returns: a handle to the fontthe NanoVG context ctx, CharSequence the font name name, CharSequence the font file name filename, int specifies which font face to load from a .ttf/.ttc file fontIndex)Creates font by loading it from the disk from specified file name. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | Returns: a handle to the fontthe NanoVG context ctx, ByteBuffer the font name name, ByteBuffer the font data data, boolean 1 if the font data should be freed automatically, 0 otherwise freeData)Creates font by loading it from the specified memory chunk. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | Returns: a handle to the fontthe NanoVG context ctx, CharSequence the font name name, ByteBuffer the font data data, boolean 1 if the font data should be freed automatically, 0 otherwise freeData)Creates font by loading it from the specified memory chunk. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | Returns: a handle to the fontthe NanoVG context ctx, ByteBuffer the font name name, ByteBuffer the font data data, boolean 1 if the font data should be freed automatically, 0 otherwise freeData, int specifies which font face to load from a .ttf/.ttc file fontIndex)Creates font by loading it from the specified memory chunk. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | Returns: a handle to the fontthe NanoVG context ctx, CharSequence the font name name, ByteBuffer the font data data, boolean 1 if the font data should be freed automatically, 0 otherwise freeData, int specifies which font face to load from a .ttf/.ttc file fontIndex)Creates font by loading it from the specified memory chunk. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | Returns: a handle to the imagethe NanoVG context ctx, ByteBuffer the image file name filename, int the image flags. One of: imageFlags)
Creates image by loading it from the disk from specified file name. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | Returns: a handle to the imagethe NanoVG context ctx, CharSequence the image file name filename, int the image flags. One of: imageFlags)
Creates image by loading it from the disk from specified file name. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | Returns: a handle to the imagethe NanoVG context ctx, int the image flags. One of: imageFlags, ByteBuffer
the image data data)Creates image by loading it from the specified chunk of memory. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | Returns: a handle to the imagethe NanoVG context ctx, int the image width w, int the image height h, int the image flags. One of: imageFlags, ByteBuffer
the image data data)Creates image from specified image data. | ||||||||||||||||||||||||||||||||||||||||||||
| private static native long | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgCurrentTransform(long
the NanoVG context ctx, FloatBuffer the destination buffer xform)Stores the top part (a-f) of the current transformation matrix in to the specified buffer. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static native float | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgDeleteImage(long
the NanoVG context ctx, int the image handle to delete image)Deletes created image. | ||||||||||||||||||||||||||||||||||||||||||||
| private static native long | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgEllipse(long
the NanoVG context ctx, float the ellipse center X axis coordinate cx, float the ellipse center Y axis coordinate cy, float the ellipse X axis radius rx, float the ellipse Y axis radius ry)Creates new ellipse shaped sub-path. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgFillColor(long
the NanoVG context ctx, NVGColor the color to set color)Sets current fill style to a solid color. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgFillPaint(long
the NanoVG context ctx, NVGPaint the paint to set paint)Sets current fill style to a paint, which can be a one of the gradients or a pattern. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | nvgFindFont(long
the NanoVG context ctx, ByteBuffer the font name name)Finds a loaded font of specified name, and returns handle to it, or -1 if the font is not found. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | nvgFindFont(long
the NanoVG context ctx, CharSequence the font name name)Finds a loaded font of specified name, and returns handle to it, or -1 if the font is not found. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgFontBlur(long
the NanoVG context ctx, float the blur amount to set blur)Sets the blur of current text style. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgFontFace(long
the NanoVG context ctx, ByteBuffer the font name font)Sets the font face based on specified name of current text style. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgFontFace(long
the NanoVG context ctx, CharSequence the font name font)Sets the font face based on specified name of current text style. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgFontFaceId(long
the NanoVG context ctx, int the font id font)Sets the font face based on specified id of current text style. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgFontSize(long
the NanoVG context ctx, float the font size to set size)Sets the font size of current text style. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgGlobalAlpha(long
the NanoVG context ctx, float the alpha value to set alpha)Sets the transparency applied to all rendered shapes. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgGlobalCompositeBlendFunc(long
the NanoVG context ctx, int sfactor, int the destination blend factor. One of: dfactor)
Sets the composite operation with custom pixel arithmetic. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgGlobalCompositeBlendFuncSeparate(long
the NanoVG context ctx, int the source RGB blend factor. One of: srcRGB, int
the destination RGB blend factor. One of: dstRGB, int
the source alpha blend factor. One of: srcAlpha, int
the destination alpha blend factor. One of: dstAlpha)
Sets the composite operation with custom pixel arithmetic for RGB and alpha components separately. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgGlobalCompositeOperation(long
the NanoVG context ctx, int the composite operation. One of: op)
Sets the composite operation. | ||||||||||||||||||||||||||||||||||||||||||||
| public static NVGColor | |||||||||||||||||||||||||||||||||||||||||||||
| public static NVGColor | |||||||||||||||||||||||||||||||||||||||||||||
| public static NVGPaint | nvgImagePattern(long
the NanoVG context ctx, float the image pattern left coordinate ox, float the image pattern top coordinate oy, float the image width ex, float the image height ey, float the rotation angle around the top-left corner angle, int the image to render image, float the alpha value alpha, NVGPaint __result)Creates and returns an image patter. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgImageSize(long
the NanoVG context ctx, int the image handle image, IntBuffer returns the image width w, IntBuffer returns the image height h)Returns the dimensions of a created image. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| private static native long | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgIntersectScissor(long
the NanoVG context ctx, float the rectangle X axis coordinate x, float the rectangle Y axis coordinate y, float the rectangle width w, float the rectangle height h)Intersects current scissor rectangle with the specified rectangle. | ||||||||||||||||||||||||||||||||||||||||||||
| public static NVGColor | nvgLerpRGBA(NVGColor
the first color c0, NVGColor the second color c1, float the interpolation factor u, NVGColor __result)Linearly interpolates from color | ||||||||||||||||||||||||||||||||||||||||||||
| public static NVGPaint | nvgLinearGradient(long
the NanoVG context ctx, float the X axis start coordinate sx, float the Y axis start coordinate sy, float the X axis end coordinate ex, float the Y axis end coordinate ey, NVGColor the start color icol, NVGColor the end color ocol, NVGPaint __result)Creates and returns a linear gradient. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgLineTo(long
the NanoVG context ctx, float the point X axis coordinate x, float the point Y axis coordinate y)Adds line segment from the last point in the path to the specified point. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgMiterLimit(long
the NanoVG context ctx, float the miter limit to set limit)Sets the miter limit of the stroke style. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgMoveTo(long
the NanoVG context ctx, float the point X axis coordinate x, float the point Y axis coordinate y)Starts new sub-path with specified point as first point. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgQuadTo(long
the NanoVG context ctx, float the control point X axis coordinate cx, float the control point Y axis coordinate cy, float the point X axis coordinate x, float the point Y axis coordinate y)Adds quadratic bezier segment from last point in the path via a control point to the specified point. | ||||||||||||||||||||||||||||||||||||||||||||
| public static NVGPaint | nvgRadialGradient(long
the NanoVG context ctx, float the X axis center coordinate cx, float the Y axis center coordinate cy, float the inner radius inr, float the outer radius outr, NVGColor the start color icol, NVGColor the end color ocol, NVGPaint __result)Creates and returns a radial gradient. | ||||||||||||||||||||||||||||||||||||||||||||
| public static native float | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgRect(long
the NanoVG context ctx, float the rectangle X axis coordinate x, float the rectangle Y axis coordinate y, float the rectangle width w, float the rectangle height h)Creates new rectangle shaped sub-path. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgResetFallbackFonts(long
the NanoVG context ctx, ByteBuffer baseFont)Resets fallback fonts by name. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgResetFallbackFonts(long
the NanoVG context ctx, CharSequence baseFont)Resets fallback fonts by name. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static NVGColor | |||||||||||||||||||||||||||||||||||||||||||||
| public static NVGColor | |||||||||||||||||||||||||||||||||||||||||||||
| public static NVGColor | |||||||||||||||||||||||||||||||||||||||||||||
| public static NVGColor | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgRotate(long
the NanoVG context ctx, float the rotation angle, in radians angle)Rotates current coordinate system. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgRoundedRect(long
the NanoVG context ctx, float the rectangle X axis coordinate x, float the rectangle Y axis coordinate y, float the rectangle width w, float the rectangle height h, float the corner radius r)Creates new rounded rectangle shaped sub-path. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgRoundedRectVarying(long
the NanoVG context ctx, float the rectangle X axis coordinate x, float the rectangle Y axis coordinate y, float the rectangle width w, float the rectangle height h, float the top-left corner radius radTopLeft, float the top-right corner radius radTopRight, float the bottom-right corner radius radBottomRight, float the bottom-left corner radius radBottomLeft)Creates new rounded rectangle shaped sub-path with varying radii for each corner. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgScale(long
the NanoVG context ctx, float the X axis scale factor x, float the Y axis scale factor y)Scales the current coordinate system. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgScissor(long
the NanoVG context ctx, float the rectangle X axis coordinate x, float the rectangle Y axis coordinate y, float the rectangle width w, float the rectangle height h)Sets the current scissor rectangle. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgShapeAntiAlias(long
the NanoVG context ctx, boolean the flag to set enabled) | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgSkewX(long
the NanoVG context ctx, float the skew angle, in radians angle)Skews the current coordinate system along X axis. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgSkewY(long
the NanoVG context ctx, float the skew angle, in radians angle)Skews the current coordinate system along Y axis. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgStrokeColor(long
the NanoVG context ctx, NVGColor the color to set color)Sets current stroke style to a solid color. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgStrokePaint(long
the NanoVG context ctx, NVGPaint the paint to set paint)Sets current stroke style to a paint, which can be a one of the gradients or a pattern. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgStrokeWidth(long
the NanoVG context ctx, float the stroke width to set size)Sets the stroke width of the stroke style. | ||||||||||||||||||||||||||||||||||||||||||||
| public static float | nvgText(long
the NanoVG context ctx, float the text X axis coordinate x, float the text Y axis coordinate y, ByteBuffer the text string to draw string)Draws text string at specified location. | ||||||||||||||||||||||||||||||||||||||||||||
| public static float | nvgText(long
the NanoVG context ctx, float the text X axis coordinate x, float the text Y axis coordinate y, CharSequence the text string to draw string)Draws text string at specified location. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTextAlign(long
the NanoVG context ctx, int the text align to set. One of: align)
Sets the text align of current text style. | ||||||||||||||||||||||||||||||||||||||||||||
| public static float | Returns: the horizontal advance of the measured text (i.e. where the next character should drawn)the NanoVG context ctx, float the text X axis coordinate x, float the text Y axis coordinate y, ByteBuffer the text string to measure string, FloatBuffer returns the bounding box of the text bounds)Measures the specified text string. | ||||||||||||||||||||||||||||||||||||||||||||
| public static float | Returns: the horizontal advance of the measured text (i.e. where the next character should drawn)the NanoVG context ctx, float the text X axis coordinate x, float the text Y axis coordinate y, CharSequence the text string to measure string, FloatBuffer returns the bounding box of the text bounds)Measures the specified text string. | ||||||||||||||||||||||||||||||||||||||||||||
| public static float | nvgTextBounds(long ctx, float x, float y, ByteBuffer string, float[] bounds)
Array version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static float | nvgTextBounds(long ctx, float x, float y, CharSequence string, float[] bounds)
Array version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTextBox(long
the NanoVG context ctx, float the text box X axis coordinate x, float the text box Y axis coordinate y, float the maximum row width breakRowWidth, ByteBuffer the text string to draw string)Draws multi-line text string at specified location wrapped at the specified width. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTextBox(long
the NanoVG context ctx, float the text box X axis coordinate x, float the text box Y axis coordinate y, float the maximum row width breakRowWidth, CharSequence the text string to draw string)Draws multi-line text string at specified location wrapped at the specified width. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTextBoxBounds(long
the NanoVG context ctx, float the text box X axis coordinate x, float the text box Y axis coordinate y, float the maximum row width breakRowWidth, ByteBuffer the text string to measure string, FloatBuffer returns the bounding box of the text box bounds)Measures the specified multi-text string. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTextBoxBounds(long
the NanoVG context ctx, float the text box X axis coordinate x, float the text box Y axis coordinate y, float the maximum row width breakRowWidth, CharSequence the text string to measure string, FloatBuffer returns the bounding box of the text box bounds)Measures the specified multi-text string. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTextBoxBounds(long ctx, float x, float y, float breakRowWidth, ByteBuffer string, float[] bounds)
Array version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTextBoxBounds(long ctx, float x, float y, float breakRowWidth, CharSequence string, float[] bounds)
Array version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | nvgTextBreakLines(long
the NanoVG context ctx, ByteBuffer the text string to measure string, float the maximum row width breakRowWidth, NVGTextRow.returns the text rows rowsBreaks the specified text into lines. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | nvgTextBreakLines(long
the NanoVG context ctx, CharSequence the text string to measure string, float the maximum row width breakRowWidth, NVGTextRow.returns the text rows rowsBreaks the specified text into lines. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | nvgTextGlyphPositions(long
the NanoVG context ctx, float the text X axis coordinate x, float the text Y axis coordinate y, ByteBuffer the text string to measure string, NVGGlyphPosition.returns the glyph x positions positionsCalculates the glyph x positions of the specified text. | ||||||||||||||||||||||||||||||||||||||||||||
| public static int | nvgTextGlyphPositions(long
the NanoVG context ctx, float the text X axis coordinate x, float the text Y axis coordinate y, CharSequence the text string to measure string, NVGGlyphPosition.returns the glyph x positions positionsCalculates the glyph x positions of the specified text. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTextLetterSpacing(long
the NanoVG context ctx, float the letter spacing amount to set spacing)Sets the letter spacing of current text style. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTextLineHeight(long
the NanoVG context ctx, float the line height to set lineHeight)Sets the proportional line height of current text style. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTextMetrics(long
the NanoVG context ctx, FloatBuffer the line ascend ascender, FloatBuffer the line descend descender, FloatBuffer the line height lineh)Returns the vertical metrics based on the current text style. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTextMetrics(long ctx, float[] ascender, float[] descender, float[] lineh)
Array version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTransform(long
the NanoVG context ctx, float the a value a, float the b value b, float the c value c, float the d value d, float the e value e, float the f value f)Premultiplies current coordinate system by specified matrix. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static boolean | Returns: 1 if the inverse could be calculated, else 0the destination buffer dst, FloatBuffer the transformation matrix to inverse src)Sets the destination to inverse of specified transform. | ||||||||||||||||||||||||||||||||||||||||||||
| public static boolean | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTransformMultiply(FloatBuffer
the destination buffer dst, FloatBuffer the src)B transformation matrixSets the transform to the result of multiplication of two transforms, of | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTransformPoint(FloatBuffer
returns the transformed X axis coordinate dstx, FloatBuffer returns the transformed Y axis coordinate dsty, FloatBuffer the transformation matrix xform, float the point X axis coordinate srcx, float the point Y axis coordinate srcy)Transform a point by given transform. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTransformPoint(float[] dstx, float[] dsty, float[] xform, float srcx, float srcy)
Array version of: | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTransformPremultiply(FloatBuffer
the destination buffer dst, FloatBuffer the src)B transformation matrixSets the transform to the result of multiplication of two transforms, of | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTransformRotate(FloatBuffer
the destination buffer dst, float the rotation angle, in radians a)Sets the transform to rotate matrix. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTransformScale(FloatBuffer
the destination buffer dst, float the X axis scale factor sx, float the Y axis scale factor sy)Sets the transform to scale matrix. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTransformSkewX(FloatBuffer
the destination buffer dst, float the skew angle, in radians a)Sets the transform to skew-x matrix. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTransformSkewY(FloatBuffer
the destination buffer dst, float the skew angle, in radians a)Sets the transform to skew-y matrix. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTransformTranslate(FloatBuffer
the destination buffer dst, float the X axis translation amount tx, float the Y axis translation amount ty)Sets the transform to translation matrix matrix. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | |||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgTranslate(long
the NanoVG context ctx, float the X axis translation amount x, float the Y axis translation amount y)Translates current coordinate system. | ||||||||||||||||||||||||||||||||||||||||||||
| public static NVGColor | nvgTransRGBA(NVGColor
the color c0, byte the alpha value a, NVGColor __result)Sets transparency of a color value. | ||||||||||||||||||||||||||||||||||||||||||||
| public static NVGColor | nvgTransRGBAf(NVGColor
the color c0, float the alpha value a, NVGColor __result)Sets transparency of a color value. | ||||||||||||||||||||||||||||||||||||||||||||
| public static void | nvgUpdateImage(long
the NanoVG context ctx, int the image handle image, ByteBuffer the image data data)Updates image data specified by image handle. |