package vendor:nanovg

⌘K
Ctrl+K
or
/

    Index

    Variables (1)
    Procedures (107)
    Procedure Groups (1)

    Types

    AlignHorizontal ¶

    AlignHorizontal :: fontstash.AlignHorizontal

    AlignVertical ¶

    AlignVertical :: fontstash.AlignVertical

    BlendFactor ¶

    BlendFactor :: enum int {
    	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, 
    }
    Related Procedures With Parameters

    Codepoint_Type ¶

    Codepoint_Type :: enum int {
    	Space, 
    	Newline, 
    	Char, 
    	CJK, 
    }

    Color ¶

    Color :: [4]f32

    Commands ¶

    Commands :: enum int {
    	MOVE_TO, 
    	LINE_TO, 
    	BEZIER_TO, 
    	CLOSE, 
    	WINDING, 
    }

    CompositeOperation ¶

    CompositeOperation :: enum int {
    	SOURCE_OVER, 
    	SOURCE_IN, 
    	SOURCE_OUT, 
    	ATOP, 
    	DESTINATION_OVER, 
    	DESTINATION_IN, 
    	DESTINATION_OUT, 
    	DESTINATION_ATOP, 
    	LIGHTER, 
    	COPY, 
    	XOR, 
    }
    Related Procedures With Parameters

    CompositeOperationState ¶

    CompositeOperationState :: struct {
    	srcRGB:   BlendFactor,
    	dstRGB:   BlendFactor,
    	srcAlpha: BlendFactor,
    	dstAlpha: BlendFactor,
    }

    Context ¶

    Context :: struct {
    	params:         Params,
    	commands:       [dynamic]f32,
    	commandx:       f32,
    	commandy:       f32,
    	states:         [32]State,
    	nstates:        int,
    	cache:          PathCache,
    	tessTol:        f32,
    	distTol:        f32,
    	fringeWidth:    f32,
    	devicePxRatio:  f32,
    	// font
    	fs:             fontstash.FontContext,
    	fontImages:     [4]int,
    	fontImageIdx:   int,
    	// stats
    	drawCallCount:  int,
    	fillTriCount:   int,
    	strokeTriCount: int,
    	textTriCount:   int,
    	// flush texture
    	textureDirty:   bool,
    }
    Related Procedures With Parameters
    Related Procedures With Returns

    Glyph_Position ¶

    Glyph_Position :: struct {
    	str:  int,
    	x:    f32,
    	minx: f32,
    	maxx: f32,
    }

    ImageFlag ¶

    ImageFlag :: enum int {
    	GENERATE_MIPMAPS, 
    	REPEAT_X, 
    	REPEAT_Y, 
    	FLIP_Y, 
    	PREMULTIPLIED, 
    	NEAREST, 
    	NO_DELETE, 
    }

    ImageFlags ¶

    ImageFlags :: bit_set[ImageFlag]

    LineCapType ¶

    LineCapType :: enum int {
    	BUTT, 
    	ROUND, 
    	SQUARE, 
    	BEVEL, 
    	MITER, 
    }
    Related Procedures With Parameters

    Matrix ¶

    Matrix :: [6]f32

    Paint ¶

    Paint :: struct {
    	xform:      [6]f32,
    	extent:     [2]f32,
    	radius:     f32,
    	feather:    f32,
    	innerColor: [4]f32,
    	outerColor: [4]f32,
    	image:      int,
    }
    Related Procedures With Parameters
    Related Procedures With Returns

    Params ¶

    Params :: struct {
    	userPtr:              rawptr,
    	edgeAntiAlias:        bool,
    	// callbacks to fill out
    	renderCreate:         proc(uptr: rawptr) -> bool,
    	renderDelete:         proc(uptr: rawptr),
    	// textures calls
    	renderCreateTexture:  proc(uptr: rawptr, type: Texture, w, h: int, imageFlags: bit_set[ImageFlag], data: []u8) -> int,
    	renderDeleteTexture:  proc(uptr: rawptr, image: int) -> bool,
    	renderUpdateTexture:  proc(uptr: rawptr, image: int, x, y: int, w, h: int, data: []u8) -> bool,
    	renderGetTextureSize: proc(uptr: rawptr, image: int, w, h: ^int) -> bool,
    	// rendering calls
    	renderViewport:       proc(uptr: rawptr, width, height, devicePixelRatio: f32),
    	renderCancel:         proc(uptr: rawptr),
    	renderFlush:          proc(uptr: rawptr),
    	renderFill:           proc(uptr: rawptr, paint: ^Paint, compositeOperation: CompositeOperationState, scissor: ^ScissorT, fringe: f32, bounds: [4]f32, paths: []Path),
    	renderStroke:         proc(uptr: rawptr, paint: ^Paint, compositeOperation: CompositeOperationState, scissor: ^ScissorT, fringe: f32, strokeWidth: f32, paths: []Path),
    	renderTriangles:      proc(uptr: rawptr, paint: ^Paint, compositeOperation: CompositeOperationState, scissor: ^ScissorT, verts: [][4]f32, fringe: f32),
    }
    Related Procedures With Parameters

    Path ¶

    Path :: struct {
    	first:   int,
    	count:   int,
    	closed:  bool,
    	nbevel:  int,
    	fill:    [][4]f32,
    	stroke:  [][4]f32,
    	winding: Winding,
    	convex:  bool,
    }

    PathCache ¶

    PathCache :: struct {
    	points: [dynamic]Point,
    	paths:  [dynamic]Path,
    	verts:  [dynamic][4]f32,
    	bounds: [4]f32,
    }

    Point ¶

    Point :: struct {
    	x:     f32,
    	y:     f32,
    	dx:    f32,
    	dy:    f32,
    	len:   f32,
    	dmx:   f32,
    	dmy:   f32,
    	flags: bit_set[PointFlag],
    }

    PointFlag ¶

    PointFlag :: enum int {
    	CORNER, 
    	LEFT, 
    	BEVEL, 
    	INNER_BEVEL, 
    }

    PointFlags ¶

    PointFlags :: bit_set[PointFlag]

    ScissorT ¶

    ScissorT :: struct {
    	xform:  [6]f32,
    	extent: [2]f32,
    }

    Solidity ¶

    Solidity :: enum int {
    	SOLID = 1, // CCW
    	HOLE,      // CW
    }
    Related Procedures With Parameters

    State ¶

    State :: struct {
    	compositeOperation: CompositeOperationState,
    	shapeAntiAlias:     bool,
    	fill:               Paint,
    	stroke:             Paint,
    	strokeWidth:        f32,
    	miterLimit:         f32,
    	lineJoin:           LineCapType,
    	lineCap:            LineCapType,
    	alpha:              f32,
    	xform:              [6]f32,
    	scissor:            ScissorT,
    	// font state
    	fontSize:           f32,
    	letterSpacing:      f32,
    	lineHeight:         f32,
    	fontBlur:           f32,
    	alignHorizontal:    fontstash.AlignHorizontal,
    	alignVertical:      fontstash.AlignVertical,
    	fontId:             int,
    }

    Text_Row ¶

    Text_Row :: struct {
    	start: int,
    	end:   int,
    	next:  int,
    	width: f32,
    	minx:  f32,
    	maxx:  f32,
    }
     

    text row with relative byte offsets into a string

    Texture ¶

    Texture :: enum int {
    	Alpha, 
    	RGBA, 
    }

    Vertex ¶

    Vertex :: [4]f32
     

    x,y,u,v

    Winding ¶

    Winding :: enum int {
    	CCW = 1, 
    	CW, 
    }
    Related Procedures With Parameters

    Constants

    INIT_COMMANDS_SIZE ¶

    INIT_COMMANDS_SIZE :: 256

    INIT_FONTIMAGE_SIZE ¶

    INIT_FONTIMAGE_SIZE :: 512

    INIT_PATH_SIZE ¶

    INIT_PATH_SIZE :: 16

    INIT_POINTS_SIZE ¶

    INIT_POINTS_SIZE :: 128

    INIT_VERTS_SIZE ¶

    INIT_VERTS_SIZE :: 26

    KAPPA ¶

    KAPPA :: 0.5522847493

    MAX_FONTIMAGES ¶

    MAX_FONTIMAGES :: 4

    MAX_FONTIMAGE_SIZE ¶

    MAX_FONTIMAGE_SIZE :: 2048

    MAX_STATES ¶

    MAX_STATES :: 32

    Variables

    OP_STATE_TABLE ¶

    OP_STATE_TABLE: [CompositeOperation][2]BlendFactor = …
     

    state table instead of if else chains

    Procedures

    AddFallbackFont ¶

    AddFallbackFont :: proc(ctx: ^Context, base_font: string, fallback_font: string) -> bool {…}
     

    Adds a fallback font by name.

    AddFallbackFontId ¶

    AddFallbackFontId :: proc(ctx: ^Context, base_font, fallback_font: int) -> bool {…}
     

    Adds a fallback font by handle.

    Arc ¶

    Arc :: proc(
    	ctx:               ^Context, 
    	cx, cy, r, a0, a1: f32, 
    	dir:               Winding, 
    ) {…}
     

    Creates new circle arc shaped sub-path. The arc center is at cx,cy, the arc radius is r, and the arc is drawn from angle a0 to a1, and swept in direction dir (NVG_CCW, or NVG_CW). Angles are specified in radians.

    ArcTo ¶

    ArcTo :: proc(
    	ctx:    ^Context, 
    	x1, y1: f32, 
    	x2, y2: f32, 
    	radius: f32, 
    ) {…}
     

    Adds an arc segment at the corner defined by the last path point, and two specified points.

    BeginFrame ¶

    BeginFrame :: proc(ctx: ^Context, windowWidth: f32, windowHeight: f32, devicePixelRatio: f32) {…}
     

    Begin drawing a new frame

    Calls to nanovg drawing API should be wrapped in nvgBeginFrame() & nvgEndFrame()
    nvgBeginFrame() 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.
    

    BeginPath ¶

    BeginPath :: proc(ctx: ^Context) {…}
     

    Clears the current path and sub-paths.

    BezierTo ¶

    BezierTo :: proc(
    	ctx:      ^Context, 
    	c1x, c1y: f32, 
    	c2x, c2y: f32, 
    	x, 
    	y:        f32, 
    ) {…}
     

    Adds cubic bezier segment from last point in the path via two control points to the specified point.

    BoxGradient ¶

    BoxGradient :: proc(
    	x, y: f32, 
    	w, h: f32, 
    	r:    f32, 
    	f:    f32, 
    	icol: [4]f32, 
    	ocol: [4]f32, 
    ) -> (p: Paint) {…}
     

    Creates and returns a radial gradient. Parameters (cx,cy) specify the center, inr and outr specify

    the inner and outer radius of the gradient, icol specifies the start color and ocol the end color.
    The gradient is transformed by the current transform when it is passed to nvgFillPaint() or nvgStrokePaint().
    

    CancelFrame ¶

    CancelFrame :: proc(ctx: ^Context) {…}
     

    Cancels drawing the current frame.

    Circle ¶

    Circle :: proc(ctx: ^Context, cx, cy: f32, radius: f32) {…}
     

    Creates new circle shaped sub-path.

    ClosePath ¶

    ClosePath :: proc(ctx: ^Context) {…}
     

    Closes current sub-path with a line segment.

    ColorHex ¶

    ColorHex :: proc(color: u32) -> (res: [4]f32) {…}
     

    hex to 0xAARRGGBB color

    CreateFont ¶

    CreateFont :: proc(ctx: ^Context, name, filename: string) -> int {…}
     

    Creates font by loading it from the disk from specified file name. Returns handle to the font.

    CreateFontMem ¶

    CreateFontMem :: proc(ctx: ^Context, name: string, slice: []u8, free_loaded_data: bool) -> int {…}
     

    Creates font by loading it from the specified memory chunk. Returns handle to the font.

    CreateImageMem ¶

    CreateImageMem :: proc(ctx: ^Context, data: []u8, imageFlags: bit_set[ImageFlag]) -> int {…}
     

    Creates image by loading it from the specified chunk of memory. Returns handle to the image.

    CreateImagePath ¶

    CreateImagePath :: proc(ctx: ^Context, filename: cstring, imageFlags: bit_set[ImageFlag]) -> int {…}
     

    Creates image by loading it from the disk from specified file name. Returns handle to the image.

    CreateImageRGBA ¶

    CreateImageRGBA :: proc(ctx: ^Context, w, h: int, imageFlags: bit_set[ImageFlag], data: []u8) -> int {…}
     

    Creates image from specified image data. Returns handle to the image.

    CreateInternal ¶

    CreateInternal :: proc(params: Params) -> (ctx: ^Context) {…}

    CurrentTransform ¶

    CurrentTransform :: proc(ctx: ^Context, xform: ^[6]f32) {…}
     

    Stores the top part (a-f) of the current transformation matrix in to the specified buffer.

      [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.
    

    DebugDumpPathCache ¶

    DebugDumpPathCache :: proc(ctx: ^Context) {…}

    DegToRad ¶

    DegToRad :: proc(deg: f32) -> f32 {…}

    DeleteImage ¶

    DeleteImage :: proc(ctx: ^Context, image: int) {…}
     

    Deletes created image.

    DeleteInternal ¶

    DeleteInternal :: proc(ctx: ^Context) {…}

    Ellipse ¶

    Ellipse :: proc(ctx: ^Context, cx, cy, rx, ry: f32) {…}
     

    Creates new ellipse shaped sub-path.

    EndFrame ¶

    EndFrame :: proc(ctx: ^Context) {…}
     

    Ends drawing flushing remaining render state.

    Fill ¶

    Fill :: proc(ctx: ^Context) {…}
     

    Fills the current path with current fill style.

    FillColor ¶

    FillColor :: proc(ctx: ^Context, color: [4]f32) {…}
     

    Sets current fill style to a solid color.

    FillPaint ¶

    FillPaint :: proc(ctx: ^Context, paint: Paint) {…}
     

    Sets current fill style to a paint, which can be a one of the gradients or a pattern.

    FillScoped ¶

    FillScoped :: proc(ctx: ^Context) {…}

    FillStrokeScoped ¶

    FillStrokeScoped :: proc(ctx: ^Context) {…}

    FindFont ¶

    FindFont :: proc(ctx: ^Context, name: string) -> int {…}
     

    Finds a loaded font of specified name, and returns handle to it, or -1 if the font is not found.

    FontBlur ¶

    FontBlur :: proc(ctx: ^Context, blur: f32) {…}
     

    Sets the blur of current text style.

    FontFace ¶

    FontFace :: proc(ctx: ^Context, font: string) {…}
     

    Sets the font face based on specified name of current text style.

    FontFaceId ¶

    FontFaceId :: proc(ctx: ^Context, font: int) {…}
     

    Sets the font face based on specified name of current text style.

    FontSize ¶

    FontSize :: proc(ctx: ^Context, size: f32) {…}
     

    Sets the font size of current text style.

    FrameScoped ¶

    FrameScoped :: proc(ctx: ^Context, windowWidth: f32, windowHeight: f32, devicePixelRatio: f32) -> ^Context {…}

    GlobalAlpha ¶

    GlobalAlpha :: proc(ctx: ^Context, alpha: f32) {…}
     

    Sets the transparency applied to all rendered shapes. Already transparent paths will get proportionally more transparent as well.

    GlobalCompositeBlendFunc ¶

    GlobalCompositeBlendFunc :: proc(ctx: ^Context, sfactor, dfactor: BlendFactor) {…}
     

    Sets the composite operation with custom pixel arithmetic. The parameters should be one of NVGblendFactor.

    GlobalCompositeBlendFuncSeparate ¶

    GlobalCompositeBlendFuncSeparate :: proc(ctx: ^Context, srcRGB: BlendFactor, dstRGB: BlendFactor, srcAlpha: BlendFactor, dstAlpha: BlendFactor) {…}
     

    Sets the composite operation with custom pixel arithmetic for RGB and alpha components separately. The parameters should be one of NVGblendFactor.

    GlobalCompositeOperation ¶

    GlobalCompositeOperation :: proc(ctx: ^Context, op: CompositeOperation) {…}
     

    Sets the composite operation. The op parameter should be one of NVGcompositeOperation.

    HSL ¶

    HSL :: proc(h, s, l: f32) -> [4]f32 {…}
     

    Returns color value specified by hue, saturation and lightness. HSL values are all in range [0..1], alpha will be set to 255.

    HSLA ¶

    HSLA :: proc(hue, saturation, lightness: f32, a: u8) -> (col: [4]f32) {…}
     

    Returns color value specified by hue, saturation and lightness and alpha. HSL values are all in range [0..1], alpha in range [0..255]

    ImagePattern ¶

    ImagePattern :: proc(
    	cx, cy: f32, 
    	w, h:   f32, 
    	angle:  f32, 
    	image:  int, 
    	alpha:  f32, 
    ) -> (p: Paint) {…}
     

    Creates and returns an image pattern. Parameters (ox,oy) specify the left-top location of the image pattern,

    (ex,ey) the size of one image, angle rotation around the top-left corner, image is handle to the image to render.
    The gradient is transformed by the current transform when it is passed to nvgFillPaint() or nvgStrokePaint().
    

    ImageSize ¶

    ImageSize :: proc(ctx: ^Context, image: int) -> (w, h: int) {…}
     

    Returns the dimensions of a created image.

    IntersectScissor ¶

    IntersectScissor :: proc(ctx: ^Context, x, y, w, h: f32) {…}
     

    Intersects current scissor rectangle with the specified rectangle.

    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.
    

    LerpRGBA ¶

    LerpRGBA :: proc(c0, c1: [4]f32, u: f32) -> (cint: [4]f32) {…}
     

    Linearly interpolates from color c0 to c1, and returns resulting color value.

    LineCap ¶

    LineCap :: proc(ctx: ^Context, cap: LineCapType) {…}
     

    Sets how the end of the line (cap) is drawn, Can be one of: NVG_BUTT (default), NVG_ROUND, NVG_SQUARE.

    LineJoin ¶

    LineJoin :: proc(ctx: ^Context, join: LineCapType) {…}
     

    Sets how sharp path corners are drawn. Can be one of NVG_MITER (default), NVG_ROUND, NVG_BEVEL.

    LineTo ¶

    LineTo :: proc(ctx: ^Context, x, y: f32) {…}
     

    Adds line segment from the last point in the path to the specified point.

    LinearGradient ¶

    LinearGradient :: proc(
    	sx, sy: f32, 
    	ex, ey: f32, 
    	icol:   [4]f32, 
    	ocol:   [4]f32, 
    ) -> (p: Paint) {…}
     

    Creates and returns a linear gradient. Parameters (sx,sy)-(ex,ey) specify the start and end coordinates

    of the linear gradient, icol specifies the start color and ocol the end color.
    The gradient is transformed by the current transform when it is passed to nvgFillPaint() or nvgStrokePaint().
    

    MiterLimit ¶

    MiterLimit :: proc(ctx: ^Context, limit: f32) {…}
     

    Sets the miter limit of the stroke style. Miter limit controls when a sharp corner is beveled.

    MoveTo ¶

    MoveTo :: proc(ctx: ^Context, x, y: f32) {…}
     

    Starts new sub-path with specified point as first point.

    PathSolidity ¶

    PathSolidity :: proc(ctx: ^Context, solidity: Solidity) {…}
     

    same as path_winding but with different enum

    PathWinding ¶

    PathWinding :: proc(ctx: ^Context, direction: Winding) {…}
     

    Sets the current sub-path winding, see NVGwinding and NVGsolidity.

    QuadTo ¶

    QuadTo :: proc(ctx: ^Context, cx, cy, x, y: f32) {…}
     

    Adds quadratic bezier segment from last point in the path via a control point to the specified point.

    RGB ¶

    RGB :: proc(r, g, b: u8) -> [4]f32 {…}
     

    Returns a color value from red, green, blue values. Alpha will be set to 255 (1.0f).

    RGBA ¶

    RGBA :: proc(r, g, b, a: u8) -> (res: [4]f32) {…}
     

    Returns a color value from red, green, blue and alpha values.

    RadToDeg ¶

    RadToDeg :: proc(rad: f32) -> f32 {…}

    RadialGradient ¶

    RadialGradient :: proc(
    	cx, cy: f32, 
    	inr:    f32, 
    	outr:   f32, 
    	icol:   [4]f32, 
    	ocol:   [4]f32, 
    ) -> (p: Paint) {…}
     

    Creates and returns a box gradient. Box gradient is a feathered rounded rectangle, it is useful for rendering

    drop shadows or highlights for boxes. Parameters (x,y) define the top-left corner of the rectangle,
    (w,h) define the size of the rectangle, r defines the corner radius, and f feather. Feather defines how blurry
    the border of the rectangle is. Parameter icol specifies the inner color and ocol the outer color of the gradient.
    The gradient is transformed by the current transform when it is passed to nvgFillPaint() or nvgStrokePaint().
    

    Rect ¶

    Rect :: proc(ctx: ^Context, x, y, w, h: f32) {…}
     

    Creates new rectangle shaped sub-path.

    Reset ¶

    Reset :: proc(ctx: ^Context) {…}
     

    Resets current render state to default values. Does not affect the render state stack.

    ResetFallbackFonts ¶

    ResetFallbackFonts :: proc(ctx: ^Context, base_font: string) {…}
     

    Resets fallback fonts by name.

    ResetFallbackFontsId ¶

    ResetFallbackFontsId :: proc(ctx: ^Context, base_font: int) {…}
     

    Resets fallback fonts by handle.

    ResetScissor ¶

    ResetScissor :: proc(ctx: ^Context) {…}
     

    Reset and disables scissoring.

    ResetTransform ¶

    ResetTransform :: proc(ctx: ^Context) {…}
     

    Resets current transform to a identity matrix.

    Restore ¶

    Restore :: proc(ctx: ^Context) {…}
     

    Pops and restores current render state.

    Rotate ¶

    Rotate :: proc(ctx: ^Context, angle: f32) {…}
     

    Rotates current coordinate system. Angle is specified in radians.

    RoundedRect ¶

    RoundedRect :: proc(
    	ctx:        ^Context, 
    	x, y, w, h, 
    	radius:     f32, 
    ) {…}
     

    Creates new rounded rectangle shaped sub-path.

    RoundedRectVarying ¶

    RoundedRectVarying :: proc(
    	ctx:                 ^Context, 
    	x, y:                f32, 
    	w, h:                f32, 
    	radius_top_left:     f32, 
    	radius_top_right:    f32, 
    	radius_bottom_right: f32, 
    	radius_bottom_left:  f32, 
    ) {…}
     

    Creates new rounded rectangle shaped sub-path with varying radii for each corner.

    Save ¶

    Save :: proc(ctx: ^Context) {…}
     

    Pushes and saves the current render state into a state stack. A matching nvgRestore() must be used to restore the state.

    SaveScoped ¶

    SaveScoped :: proc(ctx: ^Context) {…}
     

    NOTE useful helper

    Scale ¶

    Scale :: proc(ctx: ^Context, x, y: f32) {…}
     

    Scales the current coordinate system.

    Scissor ¶

    Scissor :: proc(ctx: ^Context, x, y: f32, width, height: f32) {…}
     

    Sets the current scissor rectangle. The scissor rectangle is transformed by the current transform.

    ShapeAntiAlias ¶

    ShapeAntiAlias :: proc(ctx: ^Context, enabled: bool) {…}
     

    Sets whether to draw antialias for nvgStroke() and nvgFill(). It's enabled by default.

    SkewX ¶

    SkewX :: proc(ctx: ^Context, angle: f32) {…}
     

    Skews the current coordinate system along X axis. Angle is specified in radians.

    SkewY ¶

    SkewY :: proc(ctx: ^Context, angle: f32) {…}
     

    Skews the current coordinate system along Y axis. Angle is specified in radians.

    Stroke ¶

    Stroke :: proc(ctx: ^Context) {…}
     

    Fills the current path with current stroke style.

    StrokeColor ¶

    StrokeColor :: proc(ctx: ^Context, color: [4]f32) {…}
     

    Sets current stroke style to a solid color.

    StrokePaint ¶

    StrokePaint :: proc(ctx: ^Context, paint: Paint) {…}
     

    Sets current stroke style to a paint, which can be a one of the gradients or a pattern.

    StrokeScoped ¶

    StrokeScoped :: proc(ctx: ^Context) {…}

    StrokeWidth ¶

    StrokeWidth :: proc(ctx: ^Context, width: f32) {…}
     

    Sets the stroke width of the stroke style.

    Text ¶

    Text :: proc(ctx: ^Context, x, y: f32, text: string) -> f32 {…}
     

    Draws text string at specified location. If end is specified only the sub-string up to the end is drawn.

    TextAlign ¶

    TextAlign :: proc(ctx: ^Context, ah: fontstash.AlignHorizontal, av: fontstash.AlignVertical) {…}
     

    Sets the text align of current text style, see NVGalign for options.

    TextAlignHorizontal ¶

    TextAlignHorizontal :: proc(ctx: ^Context, align: fontstash.AlignHorizontal) {…}
     

    Sets the horizontal text align of current text style

    TextAlignVertical ¶

    TextAlignVertical :: proc(ctx: ^Context, align: fontstash.AlignVertical) {…}
     

    Sets the vertical text align of current text style

    TextBounds ¶

    TextBounds :: proc(ctx: ^Context, x, y: f32, input: string, bounds: ^[4]f32 = nil) -> (advance: f32) {…}
     

    Measures the specified text string. 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] Returns the horizontal advance of the measured text (i.e. where the next character should drawn). Measured values are returned in local coordinate space.

    TextBox ¶

    TextBox :: proc(ctx: ^Context, x, y: f32, break_row_width: f32, input: string) {…}
     

    Draws multi-line text string at specified location wrapped at the specified width. If 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).

    TextBoxBounds ¶

    TextBoxBounds :: proc(
    	ctx:           ^Context, 
    	x, y:          f32, 
    	breakRowWidth: f32, 
    	input:         string, 
    	bounds:        ^[4]f32, 
    ) {…}
     

    Measures the specified multi-text string. 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.

    TextBreakLines ¶

    TextBreakLines :: proc(ctx: ^Context, text: ^string, break_row_width: f32, rows: ^[]Text_Row) -> (nrows: int, last: string, ok: bool) {…}
     

    NOTE text break lines works relative to the string in byte indexes now, instead of on pointers Breaks the specified text into lines 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).

    TextGlyphPositions ¶

    TextGlyphPositions :: proc(ctx: ^Context, x, y: f32, text: string, positions: ^[]Glyph_Position) -> int {…}
     

    Calculates the glyph x positions of the specified text. Measured values are returned in local coordinate space.

    TextIcon ¶

    TextIcon :: proc(ctx: ^Context, xpos, ypos: f32, codepoint: rune) -> f32 {…}
     

    draw a single codepoint, useful for icons

    TextLetterSpacing ¶

    TextLetterSpacing :: proc(ctx: ^Context, spacing: f32) {…}
     

    Sets the letter spacing of current text style.

    TextLineHeight ¶

    TextLineHeight :: proc(ctx: ^Context, lineHeight: f32) {…}
     

    Sets the proportional line height of current text style. The line height is specified as multiple of font size.

    TextMetrics ¶

    TextMetrics :: proc(ctx: ^Context) -> (ascender, descender, lineHeight: f32) {…}
     

    Returns the vertical metrics based on the current text style. Measured values are returned in local coordinate space.

    Transform ¶

    Transform :: proc(
    	ctx:           ^Context, 
    	a, b, c, d, e, 
    	f:             f32, 
    ) {…}

    TransformIdentity ¶

    TransformIdentity :: proc(t: ^[6]f32) {…}
     

    Sets the transform to identity matrix.

    TransformInverse ¶

    TransformInverse :: proc(inv: ^[6]f32, t: [6]f32) -> bool {…}
     

    Sets the destination to inverse of specified transform. Returns true if the inverse could be calculated, else false.

    TransformMultiply ¶

    TransformMultiply :: proc(t: ^[6]f32, s: [6]f32) {…}
     

    Sets the transform to the result of multiplication of two transforms, of A = A*B.

    TransformPoint ¶

    TransformPoint :: proc(dx: ^f32, dy: ^f32, t: [6]f32, sx: f32, sy: f32) {…}
     

    Transform a point by given transform.

    TransformPremultiply ¶

    TransformPremultiply :: proc(t: ^[6]f32, s: [6]f32) {…}
     

    Sets the transform to the result of multiplication of two transforms, of A = B*A.

    TransformRotate ¶

    TransformRotate :: proc(t: ^[6]f32, a: f32) {…}
     

    Sets the transform to rotate matrix. Angle is specified in radians.

    TransformScale ¶

    TransformScale :: proc(t: ^[6]f32, sx, sy: f32) {…}
     

    Sets the transform to scale matrix.

    TransformSkewX ¶

    TransformSkewX :: proc(t: ^[6]f32, a: f32) {…}
     

    Sets the transform to skew-x matrix. Angle is specified in radians.

    TransformSkewY ¶

    TransformSkewY :: proc(t: ^[6]f32, a: f32) {…}
     

    Sets the transform to skew-y matrix. Angle is specified in radians.

    TransformTranslate ¶

    TransformTranslate :: proc(t: ^[6]f32, tx, ty: f32) {…}
     

    Sets the transform to translation matrix matrix.

    Translate ¶

    Translate :: proc(ctx: ^Context, x, y: f32) {…}
     

    Translates current coordinate system.

    UpdateImage ¶

    UpdateImage :: proc(ctx: ^Context, image: int, data: []u8) {…}
     

    Updates image data specified by image handle.

    Procedure Groups

    Source Files

    Generation Information

    Generated with odin version dev-2024-04 (vendor "odin") Windows_amd64 @ 2024-04-26 21:08:59.764426700 +0000 UTC