public class NanoVG
extends java.lang.Object
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 |
|---|---|
static int |
NVG_ALIGN_BASELINE
Alignments.
|
static int |
NVG_ALIGN_BOTTOM
Alignments.
|
static int |
NVG_ALIGN_CENTER
Alignments.
|
static int |
NVG_ALIGN_LEFT
Alignments.
|
static int |
NVG_ALIGN_MIDDLE
Alignments.
|
static int |
NVG_ALIGN_RIGHT
Alignments.
|
static int |
NVG_ALIGN_TOP
Alignments.
|
static int |
NVG_ATOP
Composite operations.
|
static int |
NVG_BEVEL
Line caps and joins.
|
static int |
NVG_BUTT
Line caps and joins.
|
static int |
NVG_CCW
Winding order.
|
static int |
NVG_COPY
Composite operations.
|
static int |
NVG_CW
Winding order.
|
static int |
NVG_DESTINATION_ATOP
Composite operations.
|
static int |
NVG_DESTINATION_IN
Composite operations.
|
static int |
NVG_DESTINATION_OUT
Composite operations.
|
static int |
NVG_DESTINATION_OVER
Composite operations.
|
static int |
NVG_DST_ALPHA
Blend factors.
|
static int |
NVG_DST_COLOR
Blend factors.
|
static int |
NVG_HOLE
Solidity.
|
static int |
NVG_IMAGE_FLIPY
Image flags.
|
static int |
NVG_IMAGE_GENERATE_MIPMAPS
Image flags.
|
static int |
NVG_IMAGE_NEAREST
Image flags.
|
static int |
NVG_IMAGE_PREMULTIPLIED
Image flags.
|
static int |
NVG_IMAGE_REPEATX
Image flags.
|
static int |
NVG_IMAGE_REPEATY
Image flags.
|
static int |
NVG_LIGHTER
Composite operations.
|
static int |
NVG_MITER
Line caps and joins.
|
static int |
NVG_ONE
Blend factors.
|
static int |
NVG_ONE_MINUS_DST_ALPHA
Blend factors.
|
static int |
NVG_ONE_MINUS_DST_COLOR
Blend factors.
|
static int |
NVG_ONE_MINUS_SRC_ALPHA
Blend factors.
|
static int |
NVG_ONE_MINUS_SRC_COLOR
Blend factors.
|
static float |
NVG_PI
PI
|
static int |
NVG_ROUND
Line caps and joins.
|
static int |
NVG_SOLID
Solidity.
|
static int |
NVG_SOURCE_IN
Composite operations.
|
static int |
NVG_SOURCE_OUT
Composite operations.
|
static int |
NVG_SOURCE_OVER
Composite operations.
|
static int |
NVG_SQUARE
Line caps and joins.
|
static int |
NVG_SRC_ALPHA
Blend factors.
|
static int |
NVG_SRC_ALPHA_SATURATE
Blend factors.
|
static int |
NVG_SRC_COLOR
Blend factors.
|
static int |
NVG_XOR
Composite operations.
|
static int |
NVG_ZERO
Blend factors.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
nnvgAddFallbackFont(long ctx,
long baseFont,
long fallbackFont)
Unsafe version of:
AddFallbackFont |
static int |
nnvgAddFallbackFontId(long ctx,
int baseFont,
int fallbackFont)
Unsafe version of:
AddFallbackFontId |
static void |
nnvgArc(long ctx,
float cx,
float cy,
float r,
float a0,
float a1,
int dir)
Unsafe version of:
Arc |
static void |
nnvgArcTo(long ctx,
float x1,
float y1,
float x2,
float y2,
float radius)
Unsafe version of:
ArcTo |
static void |
nnvgBeginFrame(long ctx,
float windowWidth,
float windowHeight,
float devicePixelRatio)
Unsafe version of:
BeginFrame |
static void |
nnvgBeginPath(long ctx)
Unsafe version of:
BeginPath |
static void |
nnvgBezierTo(long ctx,
float c1x,
float c1y,
float c2x,
float c2y,
float x,
float y)
Unsafe version of:
BezierTo |
static 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:
BoxGradient |
static void |
nnvgCancelFrame(long ctx)
Unsafe version of:
CancelFrame |
static void |
nnvgCircle(long ctx,
float cx,
float cy,
float r)
Unsafe version of:
Circle |
static void |
nnvgClosePath(long ctx)
Unsafe version of:
ClosePath |
static int |
nnvgCreateFont(long ctx,
long name,
long filename)
Unsafe version of:
CreateFont |
static int |
nnvgCreateFontMem(long ctx,
long name,
long data,
int ndata,
int freeData)
Unsafe version of:
CreateFontMem |
static int |
nnvgCreateImage(long ctx,
long filename,
int imageFlags)
Unsafe version of:
CreateImage |
static int |
nnvgCreateImageMem(long ctx,
int imageFlags,
long data,
int ndata)
Unsafe version of:
CreateImageMem |
static int |
nnvgCreateImageRGBA(long ctx,
int w,
int h,
int imageFlags,
long data)
Unsafe version of:
CreateImageRGBA |
static void |
nnvgCurrentTransform(long ctx,
float[] xform)
Array version of:
nnvgCurrentTransform(long, long) |
static void |
nnvgCurrentTransform(long ctx,
long xform)
Unsafe version of:
CurrentTransform |
static void |
nnvgDeleteImage(long ctx,
int image)
Unsafe version of:
DeleteImage |
static void |
nnvgEllipse(long ctx,
float cx,
float cy,
float rx,
float ry)
Unsafe version of:
Ellipse |
static void |
nnvgEndFrame(long ctx)
Unsafe version of:
EndFrame |
static void |
nnvgFill(long ctx)
Unsafe version of:
Fill |
static void |
nnvgFillColor(long ctx,
long color)
Unsafe version of:
FillColor |
static void |
nnvgFillPaint(long ctx,
long paint)
Unsafe version of:
FillPaint |
static int |
nnvgFindFont(long ctx,
long name)
Unsafe version of:
FindFont |
static void |
nnvgFontBlur(long ctx,
float blur)
Unsafe version of:
FontBlur |
static void |
nnvgFontFace(long ctx,
long font)
Unsafe version of:
FontFace |
static void |
nnvgFontFaceId(long ctx,
int font)
Unsafe version of:
FontFaceId |
static void |
nnvgFontSize(long ctx,
float size)
Unsafe version of:
FontSize |
static void |
nnvgGlobalAlpha(long ctx,
float alpha)
Unsafe version of:
GlobalAlpha |
static void |
nnvgGlobalCompositeBlendFunc(long ctx,
int sfactor,
int dfactor)
Unsafe version of:
GlobalCompositeBlendFunc |
static void |
nnvgGlobalCompositeBlendFuncSeparate(long ctx,
int srcRGB,
int dstRGB,
int srcAlpha,
int dstAlpha)
Unsafe version of:
GlobalCompositeBlendFuncSeparate |
static void |
nnvgGlobalCompositeOperation(long ctx,
int op)
Unsafe version of:
GlobalCompositeOperation |
static void |
nnvgHSL(float h,
float s,
float l,
long __result)
Unsafe version of:
HSL |
static void |
nnvgHSLA(float h,
float s,
float l,
byte a,
long __result)
Unsafe version of:
HSLA |
static void |
nnvgImagePattern(long ctx,
float ox,
float oy,
float ex,
float ey,
float angle,
int image,
float alpha,
long __result)
Unsafe version of:
ImagePattern |
static void |
nnvgImageSize(long ctx,
int image,
int[] w,
int[] h)
Array version of:
nnvgImageSize(long, int, long, long) |
static void |
nnvgImageSize(long ctx,
int image,
long w,
long h)
Unsafe version of:
ImageSize |
static void |
nnvgIntersectScissor(long ctx,
float x,
float y,
float w,
float h)
Unsafe version of:
IntersectScissor |
static void |
nnvgLerpRGBA(long c0,
long c1,
float u,
long __result)
Unsafe version of:
LerpRGBA |
static void |
nnvgLinearGradient(long ctx,
float sx,
float sy,
float ex,
float ey,
long icol,
long ocol,
long __result)
Unsafe version of:
LinearGradient |
static void |
nnvgLineCap(long ctx,
int cap)
Unsafe version of:
LineCap |
static void |
nnvgLineJoin(long ctx,
int join)
Unsafe version of:
LineJoin |
static void |
nnvgLineTo(long ctx,
float x,
float y)
Unsafe version of:
LineTo |
static void |
nnvgMiterLimit(long ctx,
float limit)
Unsafe version of:
MiterLimit |
static void |
nnvgMoveTo(long ctx,
float x,
float y)
Unsafe version of:
MoveTo |
static void |
nnvgPathWinding(long ctx,
int dir)
Unsafe version of:
PathWinding |
static void |
nnvgQuadTo(long ctx,
float cx,
float cy,
float x,
float y)
Unsafe version of:
QuadTo |
static void |
nnvgRadialGradient(long ctx,
float cx,
float cy,
float inr,
float outr,
long icol,
long ocol,
long __result)
Unsafe version of:
RadialGradient |
static void |
nnvgRect(long ctx,
float x,
float y,
float w,
float h)
Unsafe version of:
Rect |
static void |
nnvgReset(long ctx)
Unsafe version of:
Reset |
static void |
nnvgResetScissor(long ctx)
Unsafe version of:
ResetScissor |
static void |
nnvgResetTransform(long ctx)
Unsafe version of:
ResetTransform |
static void |
nnvgRestore(long ctx)
Unsafe version of:
Restore |
static void |
nnvgRGB(byte r,
byte g,
byte b,
long __result)
Unsafe version of:
RGB |
static void |
nnvgRGBA(byte r,
byte g,
byte b,
byte a,
long __result)
Unsafe version of:
RGBA |
static void |
nnvgRGBAf(float r,
float g,
float b,
float a,
long __result)
Unsafe version of:
RGBAf |
static void |
nnvgRGBf(float r,
float g,
float b,
long __result)
Unsafe version of:
RGBf |
static void |
nnvgRotate(long ctx,
float angle)
Unsafe version of:
Rotate |
static void |
nnvgRoundedRect(long ctx,
float x,
float y,
float w,
float h,
float r)
Unsafe version of:
RoundedRect |
static void |
nnvgRoundedRectVarying(long ctx,
float x,
float y,
float w,
float h,
float radTopLeft,
float radTopRight,
float radBottomRight,
float radBottomLeft)
Unsafe version of:
RoundedRectVarying |
static void |
nnvgSave(long ctx)
Unsafe version of:
Save |
static void |
nnvgScale(long ctx,
float x,
float y)
Unsafe version of:
Scale |
static void |
nnvgScissor(long ctx,
float x,
float y,
float w,
float h)
Unsafe version of:
Scissor |
static void |
nnvgShapeAntiAlias(long ctx,
int enabled)
Unsafe version of:
ShapeAntiAlias |
static void |
nnvgSkewX(long ctx,
float angle)
Unsafe version of:
SkewX |
static void |
nnvgSkewY(long ctx,
float angle)
Unsafe version of:
SkewY |
static void |
nnvgStroke(long ctx)
Unsafe version of:
Stroke |
static void |
nnvgStrokeColor(long ctx,
long color)
Unsafe version of:
StrokeColor |
static void |
nnvgStrokePaint(long ctx,
long paint)
Unsafe version of:
StrokePaint |
static void |
nnvgStrokeWidth(long ctx,
float size)
Unsafe version of:
StrokeWidth |
static float |
nnvgText(long ctx,
float x,
float y,
long string,
long end)
Unsafe version of:
Text |
static void |
nnvgTextAlign(long ctx,
int align)
Unsafe version of:
TextAlign |
static float |
nnvgTextBounds(long ctx,
float x,
float y,
long string,
long end,
float[] bounds)
Array version of:
nnvgTextBounds(long, float, float, long, long, long) |
static float |
nnvgTextBounds(long ctx,
float x,
float y,
long string,
long end,
long bounds)
Unsafe version of:
TextBounds |
static void |
nnvgTextBox(long ctx,
float x,
float y,
float breakRowWidth,
long string,
long end)
Unsafe version of:
TextBox |
static void |
nnvgTextBoxBounds(long ctx,
float x,
float y,
float breakRowWidth,
long string,
long end,
float[] bounds)
Array version of:
nnvgTextBoxBounds(long, float, float, float, long, long, long) |
static void |
nnvgTextBoxBounds(long ctx,
float x,
float y,
float breakRowWidth,
long string,
long end,
long bounds)
Unsafe version of:
TextBoxBounds |
static int |
nnvgTextBreakLines(long ctx,
long string,
long end,
float breakRowWidth,
long rows,
int maxRows)
Unsafe version of:
TextBreakLines |
static int |
nnvgTextGlyphPositions(long ctx,
float x,
float y,
long string,
long end,
long positions,
int maxPositions)
Unsafe version of:
TextGlyphPositions |
static void |
nnvgTextLetterSpacing(long ctx,
float spacing)
Unsafe version of:
TextLetterSpacing |
static void |
nnvgTextLineHeight(long ctx,
float lineHeight)
Unsafe version of:
TextLineHeight |
static void |
nnvgTextMetrics(long ctx,
float[] ascender,
float[] descender,
float[] lineh)
Array version of:
nnvgTextMetrics(long, long, long, long) |
static void |
nnvgTextMetrics(long ctx,
long ascender,
long descender,
long lineh)
Unsafe version of:
TextMetrics |
static void |
nnvgTransform(long ctx,
float a,
float b,
float c,
float d,
float e,
float f)
Unsafe version of:
Transform |
static void |
nnvgTransformIdentity(float[] dst)
Array version of:
nnvgTransformIdentity(long) |
static void |
nnvgTransformIdentity(long dst)
Unsafe version of:
TransformIdentity |
static int |
nnvgTransformInverse(float[] dst,
float[] src)
Array version of:
nnvgTransformInverse(long, long) |
static int |
nnvgTransformInverse(long dst,
long src)
Unsafe version of:
TransformInverse |
static void |
nnvgTransformMultiply(float[] dst,
float[] src)
Array version of:
nnvgTransformMultiply(long, long) |
static void |
nnvgTransformMultiply(long dst,
long src)
Unsafe version of:
TransformMultiply |
static void |
nnvgTransformPoint(float[] dstx,
float[] dsty,
float[] xform,
float srcx,
float srcy)
Array version of:
nnvgTransformPoint(long, long, long, float, float) |
static void |
nnvgTransformPoint(long dstx,
long dsty,
long xform,
float srcx,
float srcy)
Unsafe version of:
TransformPoint |
static void |
nnvgTransformPremultiply(float[] dst,
float[] src)
Array version of:
nnvgTransformPremultiply(long, long) |
static void |
nnvgTransformPremultiply(long dst,
long src)
Unsafe version of:
TransformPremultiply |
static void |
nnvgTransformRotate(float[] dst,
float a)
Array version of:
nnvgTransformRotate(long, float) |
static void |
nnvgTransformRotate(long dst,
float a)
Unsafe version of:
TransformRotate |
static void |
nnvgTransformScale(float[] dst,
float sx,
float sy)
Array version of:
nnvgTransformScale(long, float, float) |
static void |
nnvgTransformScale(long dst,
float sx,
float sy)
Unsafe version of:
TransformScale |
static void |
nnvgTransformSkewX(float[] dst,
float a)
Array version of:
nnvgTransformSkewX(long, float) |
static void |
nnvgTransformSkewX(long dst,
float a)
Unsafe version of:
TransformSkewX |
static void |
nnvgTransformSkewY(float[] dst,
float a)
Array version of:
nnvgTransformSkewY(long, float) |
static void |
nnvgTransformSkewY(long dst,
float a)
Unsafe version of:
TransformSkewY |
static void |
nnvgTransformTranslate(float[] dst,
float tx,
float ty)
Array version of:
nnvgTransformTranslate(long, float, float) |
static void |
nnvgTransformTranslate(long dst,
float tx,
float ty)
Unsafe version of:
TransformTranslate |
static void |
nnvgTranslate(long ctx,
float x,
float y)
Unsafe version of:
Translate |
static void |
nnvgTransRGBA(long c0,
byte a,
long __result)
Unsafe version of:
TransRGBA |
static void |
nnvgTransRGBAf(long c0,
float a,
long __result)
Unsafe version of:
TransRGBAf |
static void |
nnvgUpdateImage(long ctx,
int image,
long data)
Unsafe version of:
UpdateImage |
static int |
nvgAddFallbackFont(long ctx,
java.nio.ByteBuffer baseFont,
java.nio.ByteBuffer fallbackFont)
Adds fallback font by name.
|
static int |
nvgAddFallbackFont(long ctx,
java.lang.CharSequence baseFont,
java.lang.CharSequence fallbackFont)
Adds fallback font by name.
|
static int |
nvgAddFallbackFontId(long ctx,
int baseFont,
int fallbackFont)
Adds fallback font by handle.
|
static void |
nvgArc(long ctx,
float cx,
float cy,
float r,
float a0,
float a1,
int dir)
Creates new circle arc shaped sub-path.
|
static void |
nvgArcTo(long ctx,
float x1,
float y1,
float x2,
float y2,
float radius)
Adds an arc segment at the corner defined by the last path point, and two specified points.
|
static void |
nvgBeginFrame(long ctx,
float windowWidth,
float windowHeight,
float devicePixelRatio)
Begins drawing a new frame.
|
static void |
nvgBeginPath(long ctx)
Clears the current path and sub-paths.
|
static void |
nvgBezierTo(long ctx,
float c1x,
float c1y,
float c2x,
float c2y,
float x,
float y)
Adds cubic bezier segment from last point in the path via two control points to the specified point.
|
static NVGPaint |
nvgBoxGradient(long ctx,
float x,
float y,
float w,
float h,
float r,
float f,
NVGColor icol,
NVGColor ocol,
NVGPaint __result)
Creates and returns a box gradient.
|
static void |
nvgCancelFrame(long ctx)
Cancels drawing the current frame.
|
static void |
nvgCircle(long ctx,
float cx,
float cy,
float r)
Creates new circle shaped sub-path.
|
static void |
nvgClosePath(long ctx)
Closes current sub-path with a line segment.
|
static int |
nvgCreateFont(long ctx,
java.nio.ByteBuffer name,
java.nio.ByteBuffer filename)
Creates font by loading it from the disk from specified file name.
|
static int |
nvgCreateFont(long ctx,
java.lang.CharSequence name,
java.lang.CharSequence filename)
Creates font by loading it from the disk from specified file name.
|
static int |
nvgCreateFontMem(long ctx,
java.nio.ByteBuffer name,
java.nio.ByteBuffer data,
int freeData)
Creates font by loading it from the specified memory chunk.
|
static int |
nvgCreateFontMem(long ctx,
java.lang.CharSequence name,
java.nio.ByteBuffer data,
int freeData)
Creates font by loading it from the specified memory chunk.
|
static int |
nvgCreateImage(long ctx,
java.nio.ByteBuffer filename,
int imageFlags)
Creates image by loading it from the disk from specified file name.
|
static int |
nvgCreateImage(long ctx,
java.lang.CharSequence filename,
int imageFlags)
Creates image by loading it from the disk from specified file name.
|
static int |
nvgCreateImageMem(long ctx,
int imageFlags,
java.nio.ByteBuffer data)
Creates image by loading it from the specified chunk of memory.
|
static int |
nvgCreateImageRGBA(long ctx,
int w,
int h,
int imageFlags,
java.nio.ByteBuffer data)
Creates image from specified image data.
|
static void |
nvgCurrentTransform(long ctx,
float[] xform)
Array version of:
CurrentTransform |
static void |
nvgCurrentTransform(long ctx,
java.nio.FloatBuffer xform)
Stores the top part (a-f) of the current transformation matrix in to the specified buffer.
|
static float |
nvgDegToRad(float deg)
Converts degrees to radians.
|
static void |
nvgDeleteImage(long ctx,
int image)
Deletes created image.
|
static void |
nvgEllipse(long ctx,
float cx,
float cy,
float rx,
float ry)
Creates new ellipse shaped sub-path.
|
static void |
nvgEndFrame(long ctx)
Ends drawing flushing remaining render state.
|
static void |
nvgFill(long ctx)
Fills the current path with current fill style.
|
static void |
nvgFillColor(long ctx,
NVGColor color)
Sets current fill style to a solid color.
|
static void |
nvgFillPaint(long ctx,
NVGPaint paint)
Sets current fill style to a paint, which can be a one of the gradients or a pattern.
|
static int |
nvgFindFont(long ctx,
java.nio.ByteBuffer name)
Finds a loaded font of specified name, and returns handle to it, or -1 if the font is not found.
|
static int |
nvgFindFont(long ctx,
java.lang.CharSequence name)
Finds a loaded font of specified name, and returns handle to it, or -1 if the font is not found.
|
static void |
nvgFontBlur(long ctx,
float blur)
Sets the blur of current text style.
|
static void |
nvgFontFace(long ctx,
java.nio.ByteBuffer font)
Sets the font face based on specified name of current text style.
|
static void |
nvgFontFace(long ctx,
java.lang.CharSequence font)
Sets the font face based on specified name of current text style.
|
static void |
nvgFontFaceId(long ctx,
int font)
Sets the font face based on specified id of current text style.
|
static void |
nvgFontSize(long ctx,
float size)
Sets the font size of current text style.
|
static void |
nvgGlobalAlpha(long ctx,
float alpha)
Sets the transparency applied to all rendered shapes.
|
static void |
nvgGlobalCompositeBlendFunc(long ctx,
int sfactor,
int dfactor)
Sets the composite operation with custom pixel arithmetic.
|
static void |
nvgGlobalCompositeBlendFuncSeparate(long ctx,
int srcRGB,
int dstRGB,
int srcAlpha,
int dstAlpha)
Sets the composite operation with custom pixel arithmetic for RGB and alpha components separately.
|
static void |
nvgGlobalCompositeOperation(long ctx,
int op)
Sets the composite operation.
|
static NVGColor |
nvgHSL(float h,
float s,
float l,
NVGColor __result)
Returns color value specified by hue, saturation and lightness.
|
static NVGColor |
nvgHSLA(float h,
float s,
float l,
byte a,
NVGColor __result)
Returns color value specified by hue, saturation and lightness and alpha.
|
static NVGPaint |
nvgImagePattern(long ctx,
float ox,
float oy,
float ex,
float ey,
float angle,
int image,
float alpha,
NVGPaint __result)
Creates and returns an image patter.
|
static void |
nvgImageSize(long ctx,
int image,
int[] w,
int[] h)
Array version of:
ImageSize |
static void |
nvgImageSize(long ctx,
int image,
java.nio.IntBuffer w,
java.nio.IntBuffer h)
Returns the dimensions of a created image.
|
static void |
nvgIntersectScissor(long ctx,
float x,
float y,
float w,
float h)
Intersects current scissor rectangle with the specified rectangle.
|
static NVGColor |
nvgLerpRGBA(NVGColor c0,
NVGColor c1,
float u,
NVGColor __result)
Linearly interpolates from color
c0 to c1, and returns resulting color value. |
static NVGPaint |
nvgLinearGradient(long ctx,
float sx,
float sy,
float ex,
float ey,
NVGColor icol,
NVGColor ocol,
NVGPaint __result)
Creates and returns a linear gradient.
|
static void |
nvgLineCap(long ctx,
int cap)
Sets how the end of the line (cap) is drawn.
|
static void |
nvgLineJoin(long ctx,
int join)
Sets how sharp path corners are drawn.
|
static void |
nvgLineTo(long ctx,
float x,
float y)
Adds line segment from the last point in the path to the specified point.
|
static void |
nvgMiterLimit(long ctx,
float limit)
Sets the miter limit of the stroke style.
|
static void |
nvgMoveTo(long ctx,
float x,
float y)
Starts new sub-path with specified point as first point.
|
static void |
nvgPathWinding(long ctx,
int dir)
Sets the current sub-path winding.
|
static void |
nvgQuadTo(long ctx,
float cx,
float cy,
float x,
float y)
Adds quadratic bezier segment from last point in the path via a control point to the specified point.
|
static NVGPaint |
nvgRadialGradient(long ctx,
float cx,
float cy,
float inr,
float outr,
NVGColor icol,
NVGColor ocol,
NVGPaint __result)
Creates and returns a radial gradient.
|
static float |
nvgRadToDeg(float rad)
Converts radians to degrees.
|
static void |
nvgRect(long ctx,
float x,
float y,
float w,
float h)
Creates new rectangle shaped sub-path.
|
static void |
nvgReset(long ctx)
Resets current render state to default values.
|
static void |
nvgResetScissor(long ctx)
Resets and disables scissoring.
|
static void |
nvgResetTransform(long ctx)
Resets current transform to an identity matrix.
|
static void |
nvgRestore(long ctx)
Pops and restores current render state.
|
static NVGColor |
nvgRGB(byte r,
byte g,
byte b,
NVGColor __result)
Returns a color value from red, green, blue values.
|
static NVGColor |
nvgRGBA(byte r,
byte g,
byte b,
byte a,
NVGColor __result)
Returns a color value from red, green, blue and alpha values.
|
static NVGColor |
nvgRGBAf(float r,
float g,
float b,
float a,
NVGColor __result)
Returns a color value from red, green, blue and alpha values.
|
static NVGColor |
nvgRGBf(float r,
float g,
float b,
NVGColor __result)
Returns a color value from red, green, blue values.
|
static void |
nvgRotate(long ctx,
float angle)
Rotates current coordinate system.
|
static void |
nvgRoundedRect(long ctx,
float x,
float y,
float w,
float h,
float r)
Creates new rounded rectangle shaped sub-path.
|
static void |
nvgRoundedRectVarying(long ctx,
float x,
float y,
float w,
float h,
float radTopLeft,
float radTopRight,
float radBottomRight,
float radBottomLeft)
Creates new rounded rectangle shaped sub-path with varying radii for each corner.
|
static void |
nvgSave(long ctx)
Pushes and saves the current render state into a state stack.
|
static void |
nvgScale(long ctx,
float x,
float y)
Scales the current coordinate system.
|
static void |
nvgScissor(long ctx,
float x,
float y,
float w,
float h)
Sets the current scissor rectangle.
|
static void |
nvgShapeAntiAlias(long ctx,
boolean enabled)
|
static void |
nvgSkewX(long ctx,
float angle)
Skews the current coordinate system along X axis.
|
static void |
nvgSkewY(long ctx,
float angle)
Skews the current coordinate system along Y axis.
|
static void |
nvgStroke(long ctx)
Fills the current path with current stroke style.
|
static void |
nvgStrokeColor(long ctx,
NVGColor color)
Sets current stroke style to a solid color.
|
static void |
nvgStrokePaint(long ctx,
NVGPaint paint)
Sets current stroke style to a paint, which can be a one of the gradients or a pattern.
|
static void |
nvgStrokeWidth(long ctx,
float size)
Sets the stroke width of the stroke style.
|
static float |
nvgText(long ctx,
float x,
float y,
java.nio.ByteBuffer string)
Draws text string at specified location.
|
static float |
nvgText(long ctx,
float x,
float y,
java.lang.CharSequence string)
Draws text string at specified location.
|
static void |
nvgTextAlign(long ctx,
int align)
Sets the text align of current text style.
|
static float |
nvgTextBounds(long ctx,
float x,
float y,
java.nio.ByteBuffer string,
float[] bounds)
Array version of:
TextBounds |
static float |
nvgTextBounds(long ctx,
float x,
float y,
java.nio.ByteBuffer string,
java.nio.FloatBuffer bounds)
Measures the specified text string.
|
static float |
nvgTextBounds(long ctx,
float x,
float y,
java.lang.CharSequence string,
float[] bounds)
Array version of:
TextBounds |
static float |
nvgTextBounds(long ctx,
float x,
float y,
java.lang.CharSequence string,
java.nio.FloatBuffer bounds)
Measures the specified text string.
|
static void |
nvgTextBox(long ctx,
float x,
float y,
float breakRowWidth,
java.nio.ByteBuffer string)
Draws multi-line text string at specified location wrapped at the specified width.
|
static void |
nvgTextBox(long ctx,
float x,
float y,
float breakRowWidth,
java.lang.CharSequence string)
Draws multi-line text string at specified location wrapped at the specified width.
|
static void |
nvgTextBoxBounds(long ctx,
float x,
float y,
float breakRowWidth,
java.nio.ByteBuffer string,
float[] bounds)
Array version of:
TextBoxBounds |
static void |
nvgTextBoxBounds(long ctx,
float x,
float y,
float breakRowWidth,
java.nio.ByteBuffer string,
java.nio.FloatBuffer bounds)
Measures the specified multi-text string.
|
static void |
nvgTextBoxBounds(long ctx,
float x,
float y,
float breakRowWidth,
java.lang.CharSequence string,
float[] bounds)
Array version of:
TextBoxBounds |
static void |
nvgTextBoxBounds(long ctx,
float x,
float y,
float breakRowWidth,
java.lang.CharSequence string,
java.nio.FloatBuffer bounds)
Measures the specified multi-text string.
|
static int |
nvgTextBreakLines(long ctx,
java.nio.ByteBuffer string,
float breakRowWidth,
NVGTextRow.Buffer rows)
Breaks the specified text into lines.
|
static int |
nvgTextBreakLines(long ctx,
java.lang.CharSequence string,
float breakRowWidth,
NVGTextRow.Buffer rows)
Breaks the specified text into lines.
|
static int |
nvgTextGlyphPositions(long ctx,
float x,
float y,
java.nio.ByteBuffer string,
NVGGlyphPosition.Buffer positions)
Calculates the glyph x positions of the specified text.
|
static int |
nvgTextGlyphPositions(long ctx,
float x,
float y,
java.lang.CharSequence string,
NVGGlyphPosition.Buffer positions)
Calculates the glyph x positions of the specified text.
|
static void |
nvgTextLetterSpacing(long ctx,
float spacing)
Sets the letter spacing of current text style.
|
static void |
nvgTextLineHeight(long ctx,
float lineHeight)
Sets the proportional line height of current text style.
|
static void |
nvgTextMetrics(long ctx,
float[] ascender,
float[] descender,
float[] lineh)
Array version of:
TextMetrics |
static void |
nvgTextMetrics(long ctx,
java.nio.FloatBuffer ascender,
java.nio.FloatBuffer descender,
java.nio.FloatBuffer lineh)
Returns the vertical metrics based on the current text style.
|
static void |
nvgTransform(long ctx,
float a,
float b,
float c,
float d,
float e,
float f)
Premultiplies current coordinate system by specified matrix.
|
static void |
nvgTransformIdentity(float[] dst)
Array version of:
TransformIdentity |
static void |
nvgTransformIdentity(java.nio.FloatBuffer dst)
Sets the transform to identity matrix.
|
static boolean |
nvgTransformInverse(float[] dst,
float[] src)
Array version of:
TransformInverse |
static boolean |
nvgTransformInverse(java.nio.FloatBuffer dst,
java.nio.FloatBuffer src)
Sets the destination to inverse of specified transform.
|
static void |
nvgTransformMultiply(float[] dst,
float[] src)
Array version of:
TransformMultiply |
static void |
nvgTransformMultiply(java.nio.FloatBuffer dst,
java.nio.FloatBuffer src)
Sets the transform to the result of multiplication of two transforms, of
A = A*B. |
static void |
nvgTransformPoint(float[] dstx,
float[] dsty,
float[] xform,
float srcx,
float srcy)
Array version of:
TransformPoint |
static void |
nvgTransformPoint(java.nio.FloatBuffer dstx,
java.nio.FloatBuffer dsty,
java.nio.FloatBuffer xform,
float srcx,
float srcy)
Transform a point by given transform.
|
static void |
nvgTransformPremultiply(float[] dst,
float[] src)
Array version of:
TransformPremultiply |
static void |
nvgTransformPremultiply(java.nio.FloatBuffer dst,
java.nio.FloatBuffer src)
Sets the transform to the result of multiplication of two transforms, of
A = B*A. |
static void |
nvgTransformRotate(float[] dst,
float a)
Array version of:
TransformRotate |
static void |
nvgTransformRotate(java.nio.FloatBuffer dst,
float a)
Sets the transform to rotate matrix.
|
static void |
nvgTransformScale(float[] dst,
float sx,
float sy)
Array version of:
TransformScale |
static void |
nvgTransformScale(java.nio.FloatBuffer dst,
float sx,
float sy)
Sets the transform to scale matrix.
|
static void |
nvgTransformSkewX(float[] dst,
float a)
Array version of:
TransformSkewX |
static void |
nvgTransformSkewX(java.nio.FloatBuffer dst,
float a)
Sets the transform to skew-x matrix.
|
static void |
nvgTransformSkewY(float[] dst,
float a)
Array version of:
TransformSkewY |
static void |
nvgTransformSkewY(java.nio.FloatBuffer dst,
float a)
Sets the transform to skew-y matrix.
|
static void |
nvgTransformTranslate(float[] dst,
float tx,
float ty)
Array version of:
TransformTranslate |
static void |
nvgTransformTranslate(java.nio.FloatBuffer dst,
float tx,
float ty)
Sets the transform to translation matrix matrix.
|
static void |
nvgTranslate(long ctx,
float x,
float y)
Translates current coordinate system.
|
static NVGColor |
nvgTransRGBA(NVGColor c0,
byte a,
NVGColor __result)
Sets transparency of a color value.
|
static NVGColor |
nvgTransRGBAf(NVGColor c0,
float a,
NVGColor __result)
Sets transparency of a color value.
|
static void |
nvgUpdateImage(long ctx,
int image,
java.nio.ByteBuffer data)
Updates image data specified by image handle.
|
public static final float NVG_PI
public static final int NVG_CCW
public static final int NVG_CW
public static final int NVG_SOLID
public static final int NVG_HOLE
public static final int NVG_BUTT
public static final int NVG_ROUND
public static final int NVG_SQUARE
public static final int NVG_BEVEL
public static final int NVG_MITER
public static final int NVG_ALIGN_LEFT
ALIGN_LEFT - Default, align text horizontally to left.ALIGN_CENTER - Align text horizontally to center.ALIGN_RIGHT - Align text horizontally to right.ALIGN_TOP - Align text vertically to top.ALIGN_MIDDLE - Align text vertically to middle.ALIGN_BOTTOM - Align text vertically to bottom.ALIGN_BASELINE - Default, align text vertically to baseline.public static final int NVG_ALIGN_CENTER
ALIGN_LEFT - Default, align text horizontally to left.ALIGN_CENTER - Align text horizontally to center.ALIGN_RIGHT - Align text horizontally to right.ALIGN_TOP - Align text vertically to top.ALIGN_MIDDLE - Align text vertically to middle.ALIGN_BOTTOM - Align text vertically to bottom.ALIGN_BASELINE - Default, align text vertically to baseline.public static final int NVG_ALIGN_RIGHT
ALIGN_LEFT - Default, align text horizontally to left.ALIGN_CENTER - Align text horizontally to center.ALIGN_RIGHT - Align text horizontally to right.ALIGN_TOP - Align text vertically to top.ALIGN_MIDDLE - Align text vertically to middle.ALIGN_BOTTOM - Align text vertically to bottom.ALIGN_BASELINE - Default, align text vertically to baseline.public static final int NVG_ALIGN_TOP
ALIGN_LEFT - Default, align text horizontally to left.ALIGN_CENTER - Align text horizontally to center.ALIGN_RIGHT - Align text horizontally to right.ALIGN_TOP - Align text vertically to top.ALIGN_MIDDLE - Align text vertically to middle.ALIGN_BOTTOM - Align text vertically to bottom.ALIGN_BASELINE - Default, align text vertically to baseline.public static final int NVG_ALIGN_MIDDLE
ALIGN_LEFT - Default, align text horizontally to left.ALIGN_CENTER - Align text horizontally to center.ALIGN_RIGHT - Align text horizontally to right.ALIGN_TOP - Align text vertically to top.ALIGN_MIDDLE - Align text vertically to middle.ALIGN_BOTTOM - Align text vertically to bottom.ALIGN_BASELINE - Default, align text vertically to baseline.public static final int NVG_ALIGN_BOTTOM
ALIGN_LEFT - Default, align text horizontally to left.ALIGN_CENTER - Align text horizontally to center.ALIGN_RIGHT - Align text horizontally to right.ALIGN_TOP - Align text vertically to top.ALIGN_MIDDLE - Align text vertically to middle.ALIGN_BOTTOM - Align text vertically to bottom.ALIGN_BASELINE - Default, align text vertically to baseline.public static final int NVG_ALIGN_BASELINE
ALIGN_LEFT - Default, align text horizontally to left.ALIGN_CENTER - Align text horizontally to center.ALIGN_RIGHT - Align text horizontally to right.ALIGN_TOP - Align text vertically to top.ALIGN_MIDDLE - Align text vertically to middle.ALIGN_BOTTOM - Align text vertically to bottom.ALIGN_BASELINE - Default, align text vertically to baseline.public static final int NVG_ZERO
public static final int NVG_ONE
public static final int NVG_SRC_COLOR
public static final int NVG_ONE_MINUS_SRC_COLOR
public static final int NVG_DST_COLOR
public static final int NVG_ONE_MINUS_DST_COLOR
public static final int NVG_SRC_ALPHA
public static final int NVG_ONE_MINUS_SRC_ALPHA
public static final int NVG_DST_ALPHA
public static final int NVG_ONE_MINUS_DST_ALPHA
public static final int NVG_SRC_ALPHA_SATURATE
public static final int NVG_SOURCE_OVER
public static final int NVG_SOURCE_IN
public static final int NVG_SOURCE_OUT
public static final int NVG_ATOP
public static final int NVG_DESTINATION_OVER
public static final int NVG_DESTINATION_IN
public static final int NVG_DESTINATION_OUT
public static final int NVG_DESTINATION_ATOP
public static final int NVG_LIGHTER
public static final int NVG_COPY
public static final int NVG_XOR
public static final int NVG_IMAGE_GENERATE_MIPMAPS
IMAGE_GENERATE_MIPMAPS - Generate mipmaps during creation of the image.IMAGE_REPEATX - Repeat image in X direction.IMAGE_REPEATY - Repeat image in Y direction.IMAGE_FLIPY - Flips (inverses) image in Y direction when rendered.IMAGE_PREMULTIPLIED - Image data has premultiplied alpha.IMAGE_NEAREST - Image interpolation is Nearest instead Linear.public static final int NVG_IMAGE_REPEATX
IMAGE_GENERATE_MIPMAPS - Generate mipmaps during creation of the image.IMAGE_REPEATX - Repeat image in X direction.IMAGE_REPEATY - Repeat image in Y direction.IMAGE_FLIPY - Flips (inverses) image in Y direction when rendered.IMAGE_PREMULTIPLIED - Image data has premultiplied alpha.IMAGE_NEAREST - Image interpolation is Nearest instead Linear.public static final int NVG_IMAGE_REPEATY
IMAGE_GENERATE_MIPMAPS - Generate mipmaps during creation of the image.IMAGE_REPEATX - Repeat image in X direction.IMAGE_REPEATY - Repeat image in Y direction.IMAGE_FLIPY - Flips (inverses) image in Y direction when rendered.IMAGE_PREMULTIPLIED - Image data has premultiplied alpha.IMAGE_NEAREST - Image interpolation is Nearest instead Linear.public static final int NVG_IMAGE_FLIPY
IMAGE_GENERATE_MIPMAPS - Generate mipmaps during creation of the image.IMAGE_REPEATX - Repeat image in X direction.IMAGE_REPEATY - Repeat image in Y direction.IMAGE_FLIPY - Flips (inverses) image in Y direction when rendered.IMAGE_PREMULTIPLIED - Image data has premultiplied alpha.IMAGE_NEAREST - Image interpolation is Nearest instead Linear.public static final int NVG_IMAGE_PREMULTIPLIED
IMAGE_GENERATE_MIPMAPS - Generate mipmaps during creation of the image.IMAGE_REPEATX - Repeat image in X direction.IMAGE_REPEATY - Repeat image in Y direction.IMAGE_FLIPY - Flips (inverses) image in Y direction when rendered.IMAGE_PREMULTIPLIED - Image data has premultiplied alpha.IMAGE_NEAREST - Image interpolation is Nearest instead Linear.public static final int NVG_IMAGE_NEAREST
IMAGE_GENERATE_MIPMAPS - Generate mipmaps during creation of the image.IMAGE_REPEATX - Repeat image in X direction.IMAGE_REPEATY - Repeat image in Y direction.IMAGE_FLIPY - Flips (inverses) image in Y direction when rendered.IMAGE_PREMULTIPLIED - Image data has premultiplied alpha.IMAGE_NEAREST - Image interpolation is Nearest instead Linear.public static void nnvgBeginFrame(long ctx,
float windowWidth,
float windowHeight,
float devicePixelRatio)
BeginFramepublic static void nvgBeginFrame(long ctx,
float windowWidth,
float windowHeight,
float devicePixelRatio)
Calls to nanovg drawing API should be wrapped in BeginFrame & EndFrame. BeginFrame defines the size of the window to render to in relation
currently set viewport (i.e. glViewport on GL backends). Device pixel ration allows to control the rendering on Hi-DPI devices. For example,
GLFW returns two dimension for an opened window: window size and frame buffer size. In that case you would set windowWidth/Height to the window
size devicePixelRatio to: frameBufferWidth / windowWidth.
ctx - the NanoVG contextwindowWidth - the window widthwindowHeight - the window heightdevicePixelRatio - the device pixel ratiopublic static void nnvgCancelFrame(long ctx)
CancelFramepublic static void nvgCancelFrame(long ctx)
ctx - the NanoVG contextpublic static void nnvgEndFrame(long ctx)
EndFramepublic static void nvgEndFrame(long ctx)
ctx - the NanoVG contextpublic static void nnvgGlobalCompositeOperation(long ctx,
int op)
GlobalCompositeOperationpublic static void nvgGlobalCompositeOperation(long ctx,
int op)
ctx - the NanoVG contextop - the composite operation. One of:SOURCE_OVER | SOURCE_IN | SOURCE_OUT | ATOP | DESTINATION_OVER | DESTINATION_IN | DESTINATION_OUT | DESTINATION_ATOP |
LIGHTER | COPY | XOR |
public static void nnvgGlobalCompositeBlendFunc(long ctx,
int sfactor,
int dfactor)
GlobalCompositeBlendFuncpublic static void nvgGlobalCompositeBlendFunc(long ctx,
int sfactor,
int dfactor)
ctx - the NanoVG contextsfactor - the source blend factor. One of:ZERO | ONE | SRC_COLOR | ONE_MINUS_SRC_COLOR | DST_COLOR | ONE_MINUS_DST_COLOR |
SRC_ALPHA | ONE_MINUS_SRC_ALPHA | DST_ALPHA | ONE_MINUS_DST_ALPHA | SRC_ALPHA_SATURATE |
dfactor - the destination blend factor. One of:ZERO | ONE | SRC_COLOR | ONE_MINUS_SRC_COLOR | DST_COLOR | ONE_MINUS_DST_COLOR |
SRC_ALPHA | ONE_MINUS_SRC_ALPHA | DST_ALPHA | ONE_MINUS_DST_ALPHA | SRC_ALPHA_SATURATE |
public static void nnvgGlobalCompositeBlendFuncSeparate(long ctx,
int srcRGB,
int dstRGB,
int srcAlpha,
int dstAlpha)
GlobalCompositeBlendFuncSeparatepublic static void nvgGlobalCompositeBlendFuncSeparate(long ctx,
int srcRGB,
int dstRGB,
int srcAlpha,
int dstAlpha)
ctx - the NanoVG contextsrcRGB - the source RGB blend factor. One of:ZERO | ONE | SRC_COLOR | ONE_MINUS_SRC_COLOR | DST_COLOR | ONE_MINUS_DST_COLOR |
SRC_ALPHA | ONE_MINUS_SRC_ALPHA | DST_ALPHA | ONE_MINUS_DST_ALPHA | SRC_ALPHA_SATURATE |
dstRGB - the destination RGB blend factor. One of:ZERO | ONE | SRC_COLOR | ONE_MINUS_SRC_COLOR | DST_COLOR | ONE_MINUS_DST_COLOR |
SRC_ALPHA | ONE_MINUS_SRC_ALPHA | DST_ALPHA | ONE_MINUS_DST_ALPHA | SRC_ALPHA_SATURATE |
srcAlpha - the source alpha blend factor. One of:ZERO | ONE | SRC_COLOR | ONE_MINUS_SRC_COLOR | DST_COLOR | ONE_MINUS_DST_COLOR |
SRC_ALPHA | ONE_MINUS_SRC_ALPHA | DST_ALPHA | ONE_MINUS_DST_ALPHA | SRC_ALPHA_SATURATE |
dstAlpha - the destination alpha blend factor. One of:ZERO | ONE | SRC_COLOR | ONE_MINUS_SRC_COLOR | DST_COLOR | ONE_MINUS_DST_COLOR |
SRC_ALPHA | ONE_MINUS_SRC_ALPHA | DST_ALPHA | ONE_MINUS_DST_ALPHA | SRC_ALPHA_SATURATE |
public static void nnvgRGB(byte r,
byte g,
byte b,
long __result)
RGBpublic static NVGColor nvgRGB(byte r, byte g, byte b, NVGColor __result)
r - the red valueg - the green valueb - the blue valuepublic static void nnvgRGBf(float r,
float g,
float b,
long __result)
RGBfpublic static NVGColor nvgRGBf(float r, float g, float b, NVGColor __result)
r - the red valueg - the green valueb - the blue valuepublic static void nnvgRGBA(byte r,
byte g,
byte b,
byte a,
long __result)
RGBApublic static NVGColor nvgRGBA(byte r, byte g, byte b, byte a, NVGColor __result)
r - the red valueg - the green valueb - the blue valuea - the alpha valuepublic static void nnvgRGBAf(float r,
float g,
float b,
float a,
long __result)
RGBAfpublic static NVGColor nvgRGBAf(float r, float g, float b, float a, NVGColor __result)
r - the red valueg - the green valueb - the blue valuea - the alpha valuepublic static void nnvgLerpRGBA(long c0,
long c1,
float u,
long __result)
LerpRGBApublic static NVGColor nvgLerpRGBA(NVGColor c0, NVGColor c1, float u, NVGColor __result)
c0 to c1, and returns resulting color value.c0 - the first colorc1 - the second coloru - the interpolation factorpublic static void nnvgTransRGBA(long c0,
byte a,
long __result)
TransRGBApublic static NVGColor nvgTransRGBA(NVGColor c0, byte a, NVGColor __result)
c0 - the colora - the alpha valuepublic static void nnvgTransRGBAf(long c0,
float a,
long __result)
TransRGBAfpublic static NVGColor nvgTransRGBAf(NVGColor c0, float a, NVGColor __result)
c0 - the colora - the alpha valuepublic static void nnvgHSL(float h,
float s,
float l,
long __result)
HSLpublic static NVGColor nvgHSL(float h, float s, float l, NVGColor __result)
HSL values are all in range [0..1], alpha will be set to 255.
h - the hue values - the saturation valuel - the lightness valuepublic static void nnvgHSLA(float h,
float s,
float l,
byte a,
long __result)
HSLApublic static NVGColor nvgHSLA(float h, float s, float l, byte a, NVGColor __result)
HSL values are all in range [0..1], alpha in range [0..255]
h - the hue values - the saturation valuel - the lightness valuea - the alpha valuepublic static void nnvgSave(long ctx)
Savepublic static void nvgSave(long ctx)
Restore must be used to restore the state.ctx - the NanoVG contextpublic static void nnvgRestore(long ctx)
Restorepublic static void nvgRestore(long ctx)
ctx - the NanoVG contextpublic static void nnvgReset(long ctx)
Resetpublic static void nvgReset(long ctx)
ctx - the NanoVG contextpublic static void nnvgShapeAntiAlias(long ctx,
int enabled)
ShapeAntiAliaspublic static void nvgShapeAntiAlias(long ctx,
boolean enabled)
ctx - the NanoVG contextenabled - the flag to setpublic static void nnvgStrokeColor(long ctx,
long color)
StrokeColorpublic static void nvgStrokeColor(long ctx,
NVGColor color)
ctx - the NanoVG contextcolor - the color to setpublic static void nnvgStrokePaint(long ctx,
long paint)
StrokePaintpublic static void nvgStrokePaint(long ctx,
NVGPaint paint)
ctx - the NanoVG contextpaint - the paint to setpublic static void nnvgFillColor(long ctx,
long color)
FillColorpublic static void nvgFillColor(long ctx,
NVGColor color)
ctx - the NanoVG contextcolor - the color to setpublic static void nnvgFillPaint(long ctx,
long paint)
FillPaintpublic static void nvgFillPaint(long ctx,
NVGPaint paint)
ctx - the NanoVG contextpaint - the paint to setpublic static void nnvgMiterLimit(long ctx,
float limit)
MiterLimitpublic static void nvgMiterLimit(long ctx,
float limit)
ctx - the NanoVG contextlimit - the miter limit to setpublic static void nnvgStrokeWidth(long ctx,
float size)
StrokeWidthpublic static void nvgStrokeWidth(long ctx,
float size)
ctx - the NanoVG contextsize - the stroke width to setpublic static void nnvgLineCap(long ctx,
int cap)
LineCappublic static void nvgLineCap(long ctx,
int cap)
The default line cap is BUTT.
public static void nnvgLineJoin(long ctx,
int join)
LineJoinpublic static void nvgLineJoin(long ctx,
int join)
The default line join is MITER.
public static void nnvgGlobalAlpha(long ctx,
float alpha)
GlobalAlphapublic static void nvgGlobalAlpha(long ctx,
float alpha)
Already transparent paths will get proportionally more transparent as well.
ctx - the NanoVG contextalpha - the alpha value to setpublic static void nnvgResetTransform(long ctx)
ResetTransformpublic static void nvgResetTransform(long ctx)
ctx - the NanoVG contextpublic static void nnvgTransform(long ctx,
float a,
float b,
float c,
float d,
float e,
float f)
Transformpublic static void nvgTransform(long ctx,
float a,
float b,
float c,
float d,
float e,
float f)
[a c e]
[b d f]
[0 0 1]ctx - the NanoVG contexta - the a valueb - the b valuec - the c valued - the d valuee - the e valuef - the f valuepublic static void nnvgTranslate(long ctx,
float x,
float y)
Translatepublic static void nvgTranslate(long ctx,
float x,
float y)
ctx - the NanoVG contextx - the X axis translation amounty - the Y axis translation amountpublic static void nnvgRotate(long ctx,
float angle)
Rotatepublic static void nvgRotate(long ctx,
float angle)
ctx - the NanoVG contextangle - the rotation angle, in radianspublic static void nnvgSkewX(long ctx,
float angle)
SkewXpublic static void nvgSkewX(long ctx,
float angle)
ctx - the NanoVG contextangle - the skew angle, in radianspublic static void nnvgSkewY(long ctx,
float angle)
SkewYpublic static void nvgSkewY(long ctx,
float angle)
ctx - the NanoVG contextangle - the skew angle, in radianspublic static void nnvgScale(long ctx,
float x,
float y)
Scalepublic static void nvgScale(long ctx,
float x,
float y)
ctx - the NanoVG contextx - the X axis scale factory - the Y axis scale factorpublic static void nnvgCurrentTransform(long ctx,
long xform)
CurrentTransformpublic static void nvgCurrentTransform(long ctx,
java.nio.FloatBuffer xform)
[a c e]
[b d f]
[0 0 1]
There should be space for 6 floats in the return buffer for the values a-f.
ctx - the NanoVG contextxform - the destination bufferpublic static void nnvgTransformIdentity(long dst)
TransformIdentitypublic static void nvgTransformIdentity(java.nio.FloatBuffer dst)
dst - the destination bufferpublic static void nnvgTransformTranslate(long dst,
float tx,
float ty)
TransformTranslatepublic static void nvgTransformTranslate(java.nio.FloatBuffer dst,
float tx,
float ty)
dst - the destination buffertx - the X axis translation amountty - the Y axis translation amountpublic static void nnvgTransformScale(long dst,
float sx,
float sy)
TransformScalepublic static void nvgTransformScale(java.nio.FloatBuffer dst,
float sx,
float sy)
dst - the destination buffersx - the X axis scale factorsy - the Y axis scale factorpublic static void nnvgTransformRotate(long dst,
float a)
TransformRotatepublic static void nvgTransformRotate(java.nio.FloatBuffer dst,
float a)
dst - the destination buffera - the rotation angle, in radianspublic static void nnvgTransformSkewX(long dst,
float a)
TransformSkewXpublic static void nvgTransformSkewX(java.nio.FloatBuffer dst,
float a)
dst - the destination buffera - the skew angle, in radianspublic static void nnvgTransformSkewY(long dst,
float a)
TransformSkewYpublic static void nvgTransformSkewY(java.nio.FloatBuffer dst,
float a)
dst - the destination buffera - the skew angle, in radianspublic static void nnvgTransformMultiply(long dst,
long src)
TransformMultiplypublic static void nvgTransformMultiply(java.nio.FloatBuffer dst,
java.nio.FloatBuffer src)
A = A*B.dst - the destination buffersrc - the B transformation matrixpublic static void nnvgTransformPremultiply(long dst,
long src)
TransformPremultiplypublic static void nvgTransformPremultiply(java.nio.FloatBuffer dst,
java.nio.FloatBuffer src)
A = B*A.dst - the destination buffersrc - the B transformation matrixpublic static int nnvgTransformInverse(long dst,
long src)
TransformInversepublic static boolean nvgTransformInverse(java.nio.FloatBuffer dst,
java.nio.FloatBuffer src)
dst - the destination buffersrc - the transformation matrix to inversepublic static void nnvgTransformPoint(long dstx,
long dsty,
long xform,
float srcx,
float srcy)
TransformPointpublic static void nvgTransformPoint(java.nio.FloatBuffer dstx,
java.nio.FloatBuffer dsty,
java.nio.FloatBuffer xform,
float srcx,
float srcy)
dstx - returns the transformed X axis coordinatedsty - returns the transformed Y axis coordinatexform - the transformation matrixsrcx - the point X axis coordinatesrcy - the point Y axis coordinatepublic static float nvgDegToRad(float deg)
deg - the rotation value, in degreespublic static float nvgRadToDeg(float rad)
rad - the rotation value, in radianspublic static int nnvgCreateImage(long ctx,
long filename,
int imageFlags)
CreateImagepublic static int nvgCreateImage(long ctx,
java.nio.ByteBuffer filename,
int imageFlags)
ctx - the NanoVG contextfilename - the image file nameimageFlags - the image flags. One of:IMAGE_GENERATE_MIPMAPS | IMAGE_REPEATX | IMAGE_REPEATY | IMAGE_FLIPY | IMAGE_PREMULTIPLIED |
IMAGE_NEAREST |
public static int nvgCreateImage(long ctx,
java.lang.CharSequence filename,
int imageFlags)
ctx - the NanoVG contextfilename - the image file nameimageFlags - the image flags. One of:IMAGE_GENERATE_MIPMAPS | IMAGE_REPEATX | IMAGE_REPEATY | IMAGE_FLIPY | IMAGE_PREMULTIPLIED |
IMAGE_NEAREST |
public static int nnvgCreateImageMem(long ctx,
int imageFlags,
long data,
int ndata)
CreateImageMemndata - the image data size, in bytespublic static int nvgCreateImageMem(long ctx,
int imageFlags,
java.nio.ByteBuffer data)
ctx - the NanoVG contextimageFlags - the image flags. One of:IMAGE_GENERATE_MIPMAPS | IMAGE_REPEATX | IMAGE_REPEATY | IMAGE_FLIPY | IMAGE_PREMULTIPLIED |
IMAGE_NEAREST |
data - the image datapublic static int nnvgCreateImageRGBA(long ctx,
int w,
int h,
int imageFlags,
long data)
CreateImageRGBApublic static int nvgCreateImageRGBA(long ctx,
int w,
int h,
int imageFlags,
java.nio.ByteBuffer data)
ctx - the NanoVG contextw - the image widthh - the image heightimageFlags - the image flags. One of:IMAGE_GENERATE_MIPMAPS | IMAGE_REPEATX | IMAGE_REPEATY | IMAGE_FLIPY | IMAGE_PREMULTIPLIED |
IMAGE_NEAREST |
data - the image datapublic static void nnvgUpdateImage(long ctx,
int image,
long data)
UpdateImagepublic static void nvgUpdateImage(long ctx,
int image,
java.nio.ByteBuffer data)
ctx - the NanoVG contextimage - the image handledata - the image datapublic static void nnvgImageSize(long ctx,
int image,
long w,
long h)
ImageSizepublic static void nvgImageSize(long ctx,
int image,
java.nio.IntBuffer w,
java.nio.IntBuffer h)
ctx - the NanoVG contextimage - the image handlew - returns the image widthh - returns the image heightpublic static void nnvgDeleteImage(long ctx,
int image)
DeleteImagepublic static void nvgDeleteImage(long ctx,
int image)
ctx - the NanoVG contextimage - the image handle to deletepublic static void nnvgLinearGradient(long ctx,
float sx,
float sy,
float ex,
float ey,
long icol,
long ocol,
long __result)
LinearGradientpublic static NVGPaint nvgLinearGradient(long ctx, float sx, float sy, float ex, float ey, NVGColor icol, NVGColor ocol, NVGPaint __result)
The gradient is transformed by the current transform when it is passed to FillPaint or StrokePaint.
ctx - the NanoVG contextsx - the X axis start coordinatesy - the Y axis start coordinateex - the X axis end coordinateey - the Y axis end coordinateicol - the start colorocol - the end colorpublic static void nnvgBoxGradient(long ctx,
float x,
float y,
float w,
float h,
float r,
float f,
long icol,
long ocol,
long __result)
BoxGradientpublic static NVGPaint nvgBoxGradient(long ctx, float x, float y, float w, float h, float r, float f, NVGColor icol, NVGColor ocol, NVGPaint __result)
The gradient is transformed by the current transform when it is passed to FillPaint or StrokePaint.
ctx - the NanoVG contextx - the rectangle left coordinatey - the rectangle top coordinatew - the rectangle widthh - the rectangle heightr - the corner radiusf - the feather value. Feather defines how blurry the border of the rectangle is.icol - the inner colorocol - the outer colorpublic static void nnvgRadialGradient(long ctx,
float cx,
float cy,
float inr,
float outr,
long icol,
long ocol,
long __result)
RadialGradientpublic static NVGPaint nvgRadialGradient(long ctx, float cx, float cy, float inr, float outr, NVGColor icol, NVGColor ocol, NVGPaint __result)
The gradient is transformed by the current transform when it is passed to FillPaint or StrokePaint.
ctx - the NanoVG contextcx - the X axis center coordinatecy - the Y axis center coordinateinr - the inner radiusoutr - the outer radiusicol - the start colorocol - the end colorpublic static void nnvgImagePattern(long ctx,
float ox,
float oy,
float ex,
float ey,
float angle,
int image,
float alpha,
long __result)
ImagePatternpublic static NVGPaint nvgImagePattern(long ctx, float ox, float oy, float ex, float ey, float angle, int image, float alpha, NVGPaint __result)
The gradient is transformed by the current transform when it is passed to FillPaint or StrokePaint.
ctx - the NanoVG contextox - the image pattern left coordinateoy - the image pattern top coordinateex - the image widthey - the image heightangle - the rotation angle around the top-left cornerimage - the image to renderalpha - the alpha valuepublic static void nnvgScissor(long ctx,
float x,
float y,
float w,
float h)
Scissorpublic static void nvgScissor(long ctx,
float x,
float y,
float w,
float h)
The scissor rectangle is transformed by the current transform.
ctx - the NanoVG contextx - the rectangle X axis coordinatey - the rectangle Y axis coordinatew - the rectangle widthh - the rectangle heightpublic static void nnvgIntersectScissor(long ctx,
float x,
float y,
float w,
float h)
IntersectScissorpublic static void nvgIntersectScissor(long ctx,
float x,
float y,
float w,
float h)
The scissor rectangle is transformed by the current transform.
Note: in case the rotation of previous scissor rect differs from the current one, the intersection will be done between the specified rectangle and the previous scissor rectangle transformed in the current transform space. The resulting shape is always rectangle.
ctx - the NanoVG contextx - the rectangle X axis coordinatey - the rectangle Y axis coordinatew - the rectangle widthh - the rectangle heightpublic static void nnvgResetScissor(long ctx)
ResetScissorpublic static void nvgResetScissor(long ctx)
ctx - the NanoVG contextpublic static void nnvgBeginPath(long ctx)
BeginPathpublic static void nvgBeginPath(long ctx)
ctx - the NanoVG contextpublic static void nnvgMoveTo(long ctx,
float x,
float y)
MoveTopublic static void nvgMoveTo(long ctx,
float x,
float y)
ctx - the NanoVG contextx - the point X axis coordinatey - the point Y axis coordinatepublic static void nnvgLineTo(long ctx,
float x,
float y)
LineTopublic static void nvgLineTo(long ctx,
float x,
float y)
ctx - the NanoVG contextx - the point X axis coordinatey - the point Y axis coordinatepublic static void nnvgBezierTo(long ctx,
float c1x,
float c1y,
float c2x,
float c2y,
float x,
float y)
BezierTopublic static void nvgBezierTo(long ctx,
float c1x,
float c1y,
float c2x,
float c2y,
float x,
float y)
ctx - the NanoVG contextc1x - the first control point X axis coordinatec1y - the first control point Y axis coordinatec2x - the second control point X axis coordinatec2y - the second control point Y axis coordinatex - the point X axis coordinatey - the point Y axis coordinatepublic static void nnvgQuadTo(long ctx,
float cx,
float cy,
float x,
float y)
QuadTopublic static void nvgQuadTo(long ctx,
float cx,
float cy,
float x,
float y)
ctx - the NanoVG contextcx - the control point X axis coordinatecy - the control point Y axis coordinatex - the point X axis coordinatey - the point Y axis coordinatepublic static void nnvgArcTo(long ctx,
float x1,
float y1,
float x2,
float y2,
float radius)
ArcTopublic static void nvgArcTo(long ctx,
float x1,
float y1,
float x2,
float y2,
float radius)
ctx - the NanoVG contextx1 - the first point X axis coordinatey1 - the first point Y axis coordinatex2 - the second point X axis coordinatey2 - the second point Y axis coordinateradius - the arc radius, in radianspublic static void nnvgClosePath(long ctx)
ClosePathpublic static void nvgClosePath(long ctx)
ctx - the NanoVG contextpublic static void nnvgPathWinding(long ctx,
int dir)
PathWindingpublic static void nvgPathWinding(long ctx,
int dir)
public static void nnvgArc(long ctx,
float cx,
float cy,
float r,
float a0,
float a1,
int dir)
Arcpublic static void nvgArc(long ctx,
float cx,
float cy,
float r,
float a0,
float a1,
int dir)
public static void nnvgRect(long ctx,
float x,
float y,
float w,
float h)
Rectpublic static void nvgRect(long ctx,
float x,
float y,
float w,
float h)
ctx - the NanoVG contextx - the rectangle X axis coordinatey - the rectangle Y axis coordinatew - the rectangle widthh - the rectangle heightpublic static void nnvgRoundedRect(long ctx,
float x,
float y,
float w,
float h,
float r)
RoundedRectpublic static void nvgRoundedRect(long ctx,
float x,
float y,
float w,
float h,
float r)
ctx - the NanoVG contextx - the rectangle X axis coordinatey - the rectangle Y axis coordinatew - the rectangle widthh - the rectangle heightr - the corner radiuspublic static void nnvgRoundedRectVarying(long ctx,
float x,
float y,
float w,
float h,
float radTopLeft,
float radTopRight,
float radBottomRight,
float radBottomLeft)
RoundedRectVaryingpublic static void nvgRoundedRectVarying(long ctx,
float x,
float y,
float w,
float h,
float radTopLeft,
float radTopRight,
float radBottomRight,
float radBottomLeft)
ctx - the NanoVG contextx - the rectangle X axis coordinatey - the rectangle Y axis coordinatew - the rectangle widthh - the rectangle heightradTopLeft - the top-left corner radiusradTopRight - the top-right corner radiusradBottomRight - the bottom-right corner radiusradBottomLeft - the bottom-left corner radiuspublic static void nnvgEllipse(long ctx,
float cx,
float cy,
float rx,
float ry)
Ellipsepublic static void nvgEllipse(long ctx,
float cx,
float cy,
float rx,
float ry)
ctx - the NanoVG contextcx - the ellipse center X axis coordinatecy - the ellipse center Y axis coordinaterx - the ellipse X axis radiusry - the ellipse Y axis radiuspublic static void nnvgCircle(long ctx,
float cx,
float cy,
float r)
Circlepublic static void nvgCircle(long ctx,
float cx,
float cy,
float r)
ctx - the NanoVG contextcx - the circle center X axis coordinatecy - the circle center Y axis coordinater - the circle radiuspublic static void nnvgFill(long ctx)
Fillpublic static void nvgFill(long ctx)
ctx - the NanoVG contextpublic static void nnvgStroke(long ctx)
Strokepublic static void nvgStroke(long ctx)
ctx - the NanoVG contextpublic static int nnvgCreateFont(long ctx,
long name,
long filename)
CreateFontpublic static int nvgCreateFont(long ctx,
java.nio.ByteBuffer name,
java.nio.ByteBuffer filename)
ctx - the NanoVG contextname - the font namefilename - the font file namepublic static int nvgCreateFont(long ctx,
java.lang.CharSequence name,
java.lang.CharSequence filename)
ctx - the NanoVG contextname - the font namefilename - the font file namepublic static int nnvgCreateFontMem(long ctx,
long name,
long data,
int ndata,
int freeData)
CreateFontMemndata - the font data size, in bytespublic static int nvgCreateFontMem(long ctx,
java.nio.ByteBuffer name,
java.nio.ByteBuffer data,
int freeData)
The memory chunk must remain valid for as long as the font is used by NanoVG.
ctx - the NanoVG contextname - the font namedata - the font datafreeData - 1 if the font data should be freed automatically, 0 otherwisepublic static int nvgCreateFontMem(long ctx,
java.lang.CharSequence name,
java.nio.ByteBuffer data,
int freeData)
The memory chunk must remain valid for as long as the font is used by NanoVG.
ctx - the NanoVG contextname - the font namedata - the font datafreeData - 1 if the font data should be freed automatically, 0 otherwisepublic static int nnvgFindFont(long ctx,
long name)
FindFontpublic static int nvgFindFont(long ctx,
java.nio.ByteBuffer name)
ctx - the NanoVG contextname - the font namepublic static int nvgFindFont(long ctx,
java.lang.CharSequence name)
ctx - the NanoVG contextname - the font namepublic static int nnvgAddFallbackFontId(long ctx,
int baseFont,
int fallbackFont)
AddFallbackFontIdpublic static int nvgAddFallbackFontId(long ctx,
int baseFont,
int fallbackFont)
ctx - the NanoVG contextpublic static int nnvgAddFallbackFont(long ctx,
long baseFont,
long fallbackFont)
AddFallbackFontpublic static int nvgAddFallbackFont(long ctx,
java.nio.ByteBuffer baseFont,
java.nio.ByteBuffer fallbackFont)
ctx - the NanoVG contextpublic static int nvgAddFallbackFont(long ctx,
java.lang.CharSequence baseFont,
java.lang.CharSequence fallbackFont)
ctx - the NanoVG contextpublic static void nnvgFontSize(long ctx,
float size)
FontSizepublic static void nvgFontSize(long ctx,
float size)
ctx - the NanoVG contextsize - the font size to setpublic static void nnvgFontBlur(long ctx,
float blur)
FontBlurpublic static void nvgFontBlur(long ctx,
float blur)
ctx - the NanoVG contextblur - the blur amount to setpublic static void nnvgTextLetterSpacing(long ctx,
float spacing)
TextLetterSpacingpublic static void nvgTextLetterSpacing(long ctx,
float spacing)
ctx - the NanoVG contextspacing - the letter spacing amount to setpublic static void nnvgTextLineHeight(long ctx,
float lineHeight)
TextLineHeightpublic static void nvgTextLineHeight(long ctx,
float lineHeight)
ctx - the NanoVG contextlineHeight - the line height to setpublic static void nnvgTextAlign(long ctx,
int align)
TextAlignpublic static void nvgTextAlign(long ctx,
int align)
ctx - the NanoVG contextalign - the text align to set. One of:ALIGN_LEFT | ALIGN_CENTER | ALIGN_RIGHT | ALIGN_TOP | ALIGN_MIDDLE | ALIGN_BOTTOM | ALIGN_BASELINE |
public static void nnvgFontFaceId(long ctx,
int font)
FontFaceIdpublic static void nvgFontFaceId(long ctx,
int font)
ctx - the NanoVG contextfont - the font idpublic static void nnvgFontFace(long ctx,
long font)
FontFacepublic static void nvgFontFace(long ctx,
java.nio.ByteBuffer font)
ctx - the NanoVG contextfont - the font namepublic static void nvgFontFace(long ctx,
java.lang.CharSequence font)
ctx - the NanoVG contextfont - the font namepublic static float nnvgText(long ctx,
float x,
float y,
long string,
long end)
Textend - a pointer to the end of the sub-string to draw, or NULLpublic static float nvgText(long ctx,
float x,
float y,
java.nio.ByteBuffer string)
end is specified only the sub-string up to the end is drawn.ctx - the NanoVG contextx - the text X axis coordinatey - the text Y axis coordinatestring - the text string to drawpublic static float nvgText(long ctx,
float x,
float y,
java.lang.CharSequence string)
end is specified only the sub-string up to the end is drawn.ctx - the NanoVG contextx - the text X axis coordinatey - the text Y axis coordinatestring - the text string to drawpublic static void nnvgTextBox(long ctx,
float x,
float y,
float breakRowWidth,
long string,
long end)
TextBoxend - a pointer to the end of the sub-string to draw, or NULLpublic static void nvgTextBox(long ctx,
float x,
float y,
float breakRowWidth,
java.nio.ByteBuffer string)
end is specified only the sub-string up to the
end is drawn.
White space is stripped at the beginning of the rows, the text is split at word boundaries or when new-line characters are encountered. Words longer than the max width are slit at nearest character (i.e. no hyphenation).
ctx - the NanoVG contextx - the text box X axis coordinatey - the text box Y axis coordinatebreakRowWidth - the maximum row widthstring - the text string to drawpublic static void nvgTextBox(long ctx,
float x,
float y,
float breakRowWidth,
java.lang.CharSequence string)
end is specified only the sub-string up to the
end is drawn.
White space is stripped at the beginning of the rows, the text is split at word boundaries or when new-line characters are encountered. Words longer than the max width are slit at nearest character (i.e. no hyphenation).
ctx - the NanoVG contextx - the text box X axis coordinatey - the text box Y axis coordinatebreakRowWidth - the maximum row widthstring - the text string to drawpublic static float nnvgTextBounds(long ctx,
float x,
float y,
long string,
long end,
long bounds)
TextBoundsend - a pointer to the end of the sub-string to measure, or NULLpublic static float nvgTextBounds(long ctx,
float x,
float y,
java.nio.ByteBuffer string,
@Nullable
java.nio.FloatBuffer bounds)
Parameter bounds should be a pointer to float[4], if the bounding box of the text should be returned. The bounds value are
[xmin,ymin, xmax,ymax].
Measured values are returned in local coordinate space.
ctx - the NanoVG contextx - the text X axis coordinatey - the text Y axis coordinatestring - the text string to measurebounds - returns the bounding box of the textpublic static float nvgTextBounds(long ctx,
float x,
float y,
java.lang.CharSequence string,
@Nullable
java.nio.FloatBuffer bounds)
Parameter bounds should be a pointer to float[4], if the bounding box of the text should be returned. The bounds value are
[xmin,ymin, xmax,ymax].
Measured values are returned in local coordinate space.
ctx - the NanoVG contextx - the text X axis coordinatey - the text Y axis coordinatestring - the text string to measurebounds - returns the bounding box of the textpublic static void nnvgTextBoxBounds(long ctx,
float x,
float y,
float breakRowWidth,
long string,
long end,
long bounds)
TextBoxBoundsend - a pointer to the end of the sub-string to measure, or NULLpublic static void nvgTextBoxBounds(long ctx,
float x,
float y,
float breakRowWidth,
java.nio.ByteBuffer string,
@Nullable
java.nio.FloatBuffer bounds)
Parameter bounds should be a pointer to float[4], if the bounding box of the text should be returned. The bounds value are
[xmin,ymin, xmax,ymax].
Measured values are returned in local coordinate space.
ctx - the NanoVG contextx - the text box X axis coordinatey - the text box Y axis coordinatebreakRowWidth - the maximum row widthstring - the text string to measurebounds - returns the bounding box of the text boxpublic static void nvgTextBoxBounds(long ctx,
float x,
float y,
float breakRowWidth,
java.lang.CharSequence string,
@Nullable
java.nio.FloatBuffer bounds)
Parameter bounds should be a pointer to float[4], if the bounding box of the text should be returned. The bounds value are
[xmin,ymin, xmax,ymax].
Measured values are returned in local coordinate space.
ctx - the NanoVG contextx - the text box X axis coordinatey - the text box Y axis coordinatebreakRowWidth - the maximum row widthstring - the text string to measurebounds - returns the bounding box of the text boxpublic static int nnvgTextGlyphPositions(long ctx,
float x,
float y,
long string,
long end,
long positions,
int maxPositions)
TextGlyphPositionsend - a pointer to the end of the sub-string to measure, or NULLmaxPositions - the maximum number of glyph positions to returnpublic static int nvgTextGlyphPositions(long ctx,
float x,
float y,
java.nio.ByteBuffer string,
NVGGlyphPosition.Buffer positions)
end is specified only the sub-string will be used.
Measured values are returned in local coordinate space.
ctx - the NanoVG contextx - the text X axis coordinatey - the text Y axis coordinatestring - the text string to measurepositions - returns the glyph x positionspublic static int nvgTextGlyphPositions(long ctx,
float x,
float y,
java.lang.CharSequence string,
NVGGlyphPosition.Buffer positions)
end is specified only the sub-string will be used.
Measured values are returned in local coordinate space.
ctx - the NanoVG contextx - the text X axis coordinatey - the text Y axis coordinatestring - the text string to measurepositions - returns the glyph x positionspublic static void nnvgTextMetrics(long ctx,
long ascender,
long descender,
long lineh)
TextMetricspublic static void nvgTextMetrics(long ctx,
@Nullable
java.nio.FloatBuffer ascender,
@Nullable
java.nio.FloatBuffer descender,
@Nullable
java.nio.FloatBuffer lineh)
Measured values are returned in local coordinate space.
ctx - the NanoVG contextascender - the line ascenddescender - the line descendlineh - the line heightpublic static int nnvgTextBreakLines(long ctx,
long string,
long end,
float breakRowWidth,
long rows,
int maxRows)
TextBreakLinesend - a pointer to the end of the sub-string to measure, or NULLmaxRows - the maximum number of text rows to returnpublic static int nvgTextBreakLines(long ctx,
java.nio.ByteBuffer string,
float breakRowWidth,
NVGTextRow.Buffer rows)
end is specified only the sub-string will be used.
White space is stripped at the beginning of the rows, the text is split at word boundaries or when new-line characters are encountered. Words longer than the max width are slit at nearest character (i.e. no hyphenation).
ctx - the NanoVG contextstring - the text string to measurebreakRowWidth - the maximum row widthrows - returns the text rowspublic static int nvgTextBreakLines(long ctx,
java.lang.CharSequence string,
float breakRowWidth,
NVGTextRow.Buffer rows)
end is specified only the sub-string will be used.
White space is stripped at the beginning of the rows, the text is split at word boundaries or when new-line characters are encountered. Words longer than the max width are slit at nearest character (i.e. no hyphenation).
ctx - the NanoVG contextstring - the text string to measurebreakRowWidth - the maximum row widthrows - returns the text rowspublic static void nnvgCurrentTransform(long ctx,
float[] xform)
nnvgCurrentTransform(long, long)public static void nvgCurrentTransform(long ctx,
float[] xform)
CurrentTransformpublic static void nnvgTransformIdentity(float[] dst)
nnvgTransformIdentity(long)public static void nvgTransformIdentity(float[] dst)
TransformIdentitypublic static void nnvgTransformTranslate(float[] dst,
float tx,
float ty)
nnvgTransformTranslate(long, float, float)public static void nvgTransformTranslate(float[] dst,
float tx,
float ty)
TransformTranslatepublic static void nnvgTransformScale(float[] dst,
float sx,
float sy)
nnvgTransformScale(long, float, float)public static void nvgTransformScale(float[] dst,
float sx,
float sy)
TransformScalepublic static void nnvgTransformRotate(float[] dst,
float a)
nnvgTransformRotate(long, float)public static void nvgTransformRotate(float[] dst,
float a)
TransformRotatepublic static void nnvgTransformSkewX(float[] dst,
float a)
nnvgTransformSkewX(long, float)public static void nvgTransformSkewX(float[] dst,
float a)
TransformSkewXpublic static void nnvgTransformSkewY(float[] dst,
float a)
nnvgTransformSkewY(long, float)public static void nvgTransformSkewY(float[] dst,
float a)
TransformSkewYpublic static void nnvgTransformMultiply(float[] dst,
float[] src)
nnvgTransformMultiply(long, long)public static void nvgTransformMultiply(float[] dst,
float[] src)
TransformMultiplypublic static void nnvgTransformPremultiply(float[] dst,
float[] src)
nnvgTransformPremultiply(long, long)public static void nvgTransformPremultiply(float[] dst,
float[] src)
TransformPremultiplypublic static int nnvgTransformInverse(float[] dst,
float[] src)
nnvgTransformInverse(long, long)public static boolean nvgTransformInverse(float[] dst,
float[] src)
TransformInversepublic static void nnvgTransformPoint(float[] dstx,
float[] dsty,
float[] xform,
float srcx,
float srcy)
nnvgTransformPoint(long, long, long, float, float)public static void nvgTransformPoint(float[] dstx,
float[] dsty,
float[] xform,
float srcx,
float srcy)
TransformPointpublic static void nnvgImageSize(long ctx,
int image,
int[] w,
int[] h)
nnvgImageSize(long, int, long, long)public static void nvgImageSize(long ctx,
int image,
int[] w,
int[] h)
ImageSizepublic static float nnvgTextBounds(long ctx,
float x,
float y,
long string,
long end,
float[] bounds)
nnvgTextBounds(long, float, float, long, long, long)public static float nvgTextBounds(long ctx,
float x,
float y,
java.nio.ByteBuffer string,
@Nullable
float[] bounds)
TextBoundspublic static float nvgTextBounds(long ctx,
float x,
float y,
java.lang.CharSequence string,
@Nullable
float[] bounds)
TextBoundspublic static void nnvgTextBoxBounds(long ctx,
float x,
float y,
float breakRowWidth,
long string,
long end,
float[] bounds)
nnvgTextBoxBounds(long, float, float, float, long, long, long)public static void nvgTextBoxBounds(long ctx,
float x,
float y,
float breakRowWidth,
java.nio.ByteBuffer string,
@Nullable
float[] bounds)
TextBoxBoundspublic static void nvgTextBoxBounds(long ctx,
float x,
float y,
float breakRowWidth,
java.lang.CharSequence string,
@Nullable
float[] bounds)
TextBoxBoundspublic static void nnvgTextMetrics(long ctx,
float[] ascender,
float[] descender,
float[] lineh)
nnvgTextMetrics(long, long, long, long)public static void nvgTextMetrics(long ctx,
@Nullable
float[] ascender,
@Nullable
float[] descender,
@Nullable
float[] lineh)
TextMetricsCopyright LWJGL. All Rights Reserved. License terms.