java.lang.Object
com.spinyowl.legui.system.renderer.nvg.util.NvgShapes

public class NvgShapes extends Object
NanoVG Shape utility. Used to draw shapes with NanoVG.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final float
     
    static final org.joml.Vector4fc
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    drawLine(long nvg, float width, org.joml.Vector4f color, int lineCap, float fromX, float fromY, float toX, float toY)
    Used to render line.
    static void
    drawLine(long nvg, float width, org.joml.Vector4f color, int lineCap, org.joml.Vector2fc from, org.joml.Vector2fc to)
    Used to render line.
    static void
    drawRect(long nvg, org.joml.Vector2fc position, org.joml.Vector2fc size, org.joml.Vector4fc bgColor)
    Used to draw rectangle.
    static void
    drawRect(long nvg, org.joml.Vector2fc position, org.joml.Vector2fc size, org.joml.Vector4fc bgColor, float radius)
    Used to draw rectangle.
    static void
    drawRect(long nvg, org.joml.Vector2fc position, org.joml.Vector2fc size, org.joml.Vector4fc bgColor, org.joml.Vector4f radius)
    Used to draw rectangle.
    static void
    drawRect(long nvg, org.joml.Vector4fc rectangle, org.joml.Vector4fc bgColor)
    Used to draw rectangle.
    static void
    drawRect(long nvg, org.joml.Vector4fc rectangle, org.joml.Vector4fc bgColor, float radius)
    Used to draw rectangle.
    static void
    drawRect(long nvg, org.joml.Vector4fc rectangle, org.joml.Vector4fc bgColor, org.joml.Vector4f radius)
    Used to draw rectangle.
    static void
    drawRectStroke(long nvg, org.joml.Vector2fc position, org.joml.Vector2fc size, org.joml.Vector4fc rectStrokeColor, float strokeWidth)
    Used to draw rectangle stroke.
    static void
    drawRectStroke(long nvg, org.joml.Vector2fc position, org.joml.Vector2fc size, org.joml.Vector4fc rectStrokeColor, float strokeWidth, float radius)
    Used to draw rectangle stroke.
    static void
    drawRectStroke(long nvg, org.joml.Vector2fc position, org.joml.Vector2fc size, org.joml.Vector4fc rectStrokeColor, float strokeWidth, org.joml.Vector4f radius)
    Used to draw rectangle stroke.
    static void
    drawRectStroke(long nvg, org.joml.Vector4fc rectangle, org.joml.Vector4fc rectStrokeColor, float strokeWidth)
    Used to draw rectangle stroke.
    static void
    drawRectStroke(long nvg, org.joml.Vector4fc rectangle, org.joml.Vector4fc rectStrokeColor, float strokeWidth, float radius)
    Used to draw rectangle stroke.
    static void
    drawRectStroke(long nvg, org.joml.Vector4fc rectangle, org.joml.Vector4fc rectStrokeColor, float strokeWidth, org.joml.Vector4f radius)
    Used to draw rectangle stroke.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ZERO_CORNDERS

      public static final org.joml.Vector4fc ZERO_CORNDERS
    • MIN_ALPHA

      public static final float MIN_ALPHA
      See Also:
  • Method Details

    • drawRect

      public static void drawRect(long nvg, org.joml.Vector2fc position, org.joml.Vector2fc size, org.joml.Vector4fc bgColor)
      Used to draw rectangle.
      Parameters:
      nvg - nanovg context.
      position - rectangle position.
      size - rectangle size.
      bgColor - rectangle background color.
    • drawRect

      public static void drawRect(long nvg, org.joml.Vector4fc rectangle, org.joml.Vector4fc bgColor)
      Used to draw rectangle.
      Parameters:
      nvg - nanovg context
      rectangle - rectangle size and position.
      bgColor - rectangle background color.
    • drawRect

      public static void drawRect(long nvg, org.joml.Vector2fc position, org.joml.Vector2fc size, org.joml.Vector4fc bgColor, float radius)
      Used to draw rectangle.
      Parameters:
      nvg - nanovg context.
      position - rectangle position.
      size - rectangle size.
      bgColor - rectangle background color.
      radius - cornder radius
    • drawRect

      public static void drawRect(long nvg, org.joml.Vector2fc position, org.joml.Vector2fc size, org.joml.Vector4fc bgColor, org.joml.Vector4f radius)
      Used to draw rectangle.
      Parameters:
      nvg - nanovg context.
      position - rectangle position.
      size - rectangle size.
      bgColor - rectangle background color.
      radius - cornder radius
    • drawRect

      public static void drawRect(long nvg, org.joml.Vector4fc rectangle, org.joml.Vector4fc bgColor, float radius)
      Used to draw rectangle.
      Parameters:
      nvg - nanovg context
      rectangle - rectangle size and position.
      bgColor - rectangle background color.
      radius - cornder radius
    • drawRect

      public static void drawRect(long nvg, org.joml.Vector4fc rectangle, org.joml.Vector4fc bgColor, org.joml.Vector4f radius)
      Used to draw rectangle.
      Parameters:
      nvg - nanovg context
      rectangle - rectangle size and position.
      bgColor - rectangle background color.
      radius - cornder radius
    • drawRectStroke

      public static void drawRectStroke(long nvg, org.joml.Vector2fc position, org.joml.Vector2fc size, org.joml.Vector4fc rectStrokeColor, float strokeWidth)
      Used to draw rectangle stroke.
      Parameters:
      nvg - nanovg context.
      position - rectangle position.
      size - rectangle size.
      rectStrokeColor - rectangle color.
      strokeWidth - stroke width.
    • drawRectStroke

      public static void drawRectStroke(long nvg, org.joml.Vector4fc rectangle, org.joml.Vector4fc rectStrokeColor, float strokeWidth)
      Used to draw rectangle stroke.
      Parameters:
      nvg - nanovg context
      rectangle - rectangle size and position.
      rectStrokeColor - rectangle color.
      strokeWidth - stroke width.
    • drawRectStroke

      public static void drawRectStroke(long nvg, org.joml.Vector4fc rectangle, org.joml.Vector4fc rectStrokeColor, float strokeWidth, org.joml.Vector4f radius)
      Used to draw rectangle stroke.
      Parameters:
      nvg - nanovg context
      rectangle - rectangle size and position.
      rectStrokeColor - rectangle color.
      strokeWidth - stroke width.
      radius - radius vector.
    • drawRectStroke

      public static void drawRectStroke(long nvg, org.joml.Vector2fc position, org.joml.Vector2fc size, org.joml.Vector4fc rectStrokeColor, float strokeWidth, float radius)
      Used to draw rectangle stroke.
      Parameters:
      nvg - nanovg context.
      position - rectangle position.
      size - rectangle size.
      rectStrokeColor - rectangle color.
      radius - corner radius
      strokeWidth - stroke width.
    • drawRectStroke

      public static void drawRectStroke(long nvg, org.joml.Vector2fc position, org.joml.Vector2fc size, org.joml.Vector4fc rectStrokeColor, float strokeWidth, org.joml.Vector4f radius)
      Used to draw rectangle stroke.
      Parameters:
      nvg - nanovg context.
      position - rectangle position.
      size - rectangle size.
      rectStrokeColor - rectangle color.
      strokeWidth - stroke width.
      radius - radius vector.
    • drawRectStroke

      public static void drawRectStroke(long nvg, org.joml.Vector4fc rectangle, org.joml.Vector4fc rectStrokeColor, float strokeWidth, float radius)
      Used to draw rectangle stroke.
      Parameters:
      nvg - nanovg context
      rectangle - rectangle size and position.
      rectStrokeColor - rectangle color.
      strokeWidth - stroke width.
      radius - corner radius.
    • drawLine

      public static void drawLine(long nvg, float width, org.joml.Vector4f color, int lineCap, float fromX, float fromY, float toX, float toY)
      Used to render line.
      Parameters:
      nvg - nanoVG context.
      color - color to render
      width - line width (end of the line)
      lineCap - line cap. One of: BUTT, ROUND, SQUARE, BEVEL, MITER
      fromX - x coordinate of start point of line
      fromY - y coordinate of start point of line
      toX - x coordinate of end point of line
      toY - y coordinate of end point of line
    • drawLine

      public static void drawLine(long nvg, float width, org.joml.Vector4f color, int lineCap, org.joml.Vector2fc from, org.joml.Vector2fc to)
      Used to render line.
      Parameters:
      nvg - nanoVG context.
      color - color to render
      width - line width (end of the line)
      lineCap - line cap. One of: BUTT, ROUND, SQUARE, BEVEL, MITER
      from - start point of line
      to - end point of line