Skip to content

Renderer ​

The Renderer namespace provides drawing, text, image, and render-state APIs exposed by the declarations.


Interfaces ​

ClipRect ​

The ClipRect interface describes the corresponding object shape exposed by the declarations.

  • minVector - The min.
  • maxVector - The max.
  • intersectboolean (optional) - The intersect.

DrawOptions ​

The DrawOptions interface describes the corresponding object shape exposed by the declarations.

  • alignEnum.ContentAlign (optional) - The align.
  • timenumber (optional) - The time.
  • prioritynumber (optional) - The priority.
  • clipRectClipRect (optional) - The clip rect.
  • isOnDrawboolean (optional) - The is on draw.
  • drawOverUIboolean (optional) - The draw over ui.

LoadFontOptions ​

The LoadFontOptions interface describes the corresponding object shape exposed by the declarations.

  • Weightnumber (optional) - The weight.
  • Widthnumber (optional) - The width.
  • OpticalSizenumber (optional) - The optical size.
  • GRADnumber (optional) - The grad.
  • Slantnumber (optional) - The slant.
  • XTRAnumber (optional) - The xtra.
  • XOPQnumber (optional) - The xopq.
  • YOPQnumber (optional) - The yopq.
  • YTLCnumber (optional) - The ytlc.
  • YTUCnumber (optional) - The ytuc.
  • YTASnumber (optional) - The ytas.
  • YTDEnumber (optional) - The ytde.
  • YTFInumber (optional) - The ytfi.
  • spacingEMnumber (optional) - The spacing em.
  • spacingPXnumber (optional) - The spacing px.
  • FlagsEnum.FontFlags (optional) - The flags.
  • Sizenumber (optional) - The size.

LoadImageOptions ​

The LoadImageOptions interface describes the corresponding object shape exposed by the declarations.

  • svgWidthnumber (optional) - The svg width.
  • svgHeightnumber (optional) - The svg height.

Vertex ​

The Vertex interface describes the corresponding object shape exposed by the declarations.

  • positionVector - The position.
  • texCoordVector - The tex coord.

BlendStateValue ​

The BlendStateValue interface describes the corresponding object shape exposed by the declarations.


Type Aliases ​

LoadedImageImage ​

Alias for Image.

WARNING

Deprecated. use Image class instead


Functions ​

DrawOutlineRect(x: number, y: number, width: number, height: number, rounding?: number, corners?: Enum.RoundCorners, thickness?: number, type?: Enum.OutlineType)void ​

Draws an outlined rectangle to the screen at the specified x and y coordinates, with the specified width and height.

  • xnumber - The x coordinate of the top-left corner of the rectangle.
  • ynumber - The y coordinate of the top-left corner of the rectangle.
  • widthnumber - The width of the rectangle.
  • heightnumber - The height of the rectangle.
  • roundingnumber (optional) - The radius of the rounded corners of the rectangle, in pixels. (optional)
  • cornersEnum.RoundCorners (optional) - The corners of the rectangle that should be rounded. (optional)
  • thicknessnumber (optional) - The thickness of the outline, in pixels. (optional)
  • typeEnum.OutlineType (optional) - The outline type render

DrawOutlineQuad(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, thickness: number)void ​

Draws the outline quad.

  • x1number - The x1.
  • y1number - The y1.
  • x2number - The x2.
  • y2number - The y2.
  • x3number - The x3.
  • y3number - The y3.
  • x4number - The x4.
  • y4number - The y4.
  • thicknessnumber - The thickness.

DrawWorldOutlineRect(vec: Vector, width: number, height: number, xOffset?: number, yOffset?: number, rounding?: number, corners?: Enum.RoundCorners, thickness?: number)void ​

Draws an outlined rectangle to the screen at the specified position in the world. The xOffset and yOffset parameters can be used to adjust the position of the rectangle on the screen after it has been projected into 2D space. x - xOffset = resultX and y - yOffset = resultY

  • vecVector - The position of the top-left corner of the rectangle in the world.
  • widthnumber - The width of the rectangle.
  • heightnumber - The height of the rectangle.
  • xOffsetnumber (optional) - The amount to offset the x coordinate by. (optional)
  • yOffsetnumber (optional) - The amount to offset the y coordinate by. (optional)
  • roundingnumber (optional) - The radius of the rounded corners of the rectangle, in pixels. (optional)
  • cornersEnum.RoundCorners (optional) - The corners of the rectangle that should be rounded. (optional)
  • thicknessnumber (optional) - The thickness of the outline, in pixels. (optional)

DrawFilledRect(x: number, y: number, width: number, height: number, rounding?: number, corners?: Enum.RoundCorners)void ​

Draws a filled rectangle to the screen at the specified x and y coordinates, with the specified width and height. The optional rounding parameter can be used to round the corners of the rectangle, and the corners parameter can be used to specify which corners to round. The color of the rectangle can be set by calling the SetDrawColor function before calling this function.

  • xnumber - The x coordinate of the top-left corner of the rectangle.
  • ynumber - The y coordinate of the top-left corner of the rectangle.
  • widthnumber - The width of the rectangle.
  • heightnumber - The height of the rectangle.
  • roundingnumber (optional) - The radius of the rounded corners of the rectangle, in pixels. (optional)
  • cornersEnum.RoundCorners (optional) - The corners of the rectangle that should be rounded. (optional)

DrawFilledQuad(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number)void ​

Draws the filled quad.

  • x1number - The x1.
  • y1number - The y1.
  • x2number - The x2.
  • y2number - The y2.
  • x3number - The x3.
  • y3number - The y3.
  • x4number - The x4.
  • y4number - The y4.

DrawWorldFilledRect(vec: Vector, width: number, height: number, xOffset?: number, yOffset?: number, rounding?: number, corners?: Enum.RoundCorners)void ​

Draws the world filled rect.

  • vecVector - The world position vector.
  • widthnumber - The width value.
  • heightnumber - The height value.
  • xOffsetnumber (optional) - The x offset.
  • yOffsetnumber (optional) - The y offset.
  • roundingnumber (optional) - The rounding.
  • cornersEnum.RoundCorners (optional) - The corners.

DrawFilledRectMultiColor(x: number, y: number, width: number, height: number, uprLeft: number, uprRight: number, botRight: number, botLeft: number, rounding?: number, corners?: Enum.RoundCorners)void ​

Draws a filled rectangle to the screen at the specified x and y coordinates, with the specified width and height. The colors of the rectangle's corners can be specified using the uprLeft, uprRight, botRight, and botLeft parameters. The optional rounding and corners parameters work the same as in the DrawFilledRect function.

  • xnumber - The x coordinate of the top-left corner of the rectangle.
  • ynumber - The y coordinate of the top-left corner of the rectangle.
  • widthnumber - The width of the rectangle.
  • heightnumber - The height of the rectangle.
  • uprLeftnumber - The color of the top-left corner of the rectangle.
  • uprRightnumber - The color of the top-right corner of the rectangle.
  • botRightnumber - The color of the bottom-right corner of the rectangle.
  • botLeftnumber - The color of the bottom-left corner of the rectangle.
  • roundingnumber (optional) - The radius of the rounded corners of the rectangle, in pixels. (optional)
  • cornersEnum.RoundCorners (optional) - The corners of the rectangle that should be rounded. (optional)

DrawOutlineCircle(centerX: number, centerY: number, radius: number, thickness?: number, segments?: number, startAngleInDegrees?: number, endAngleInDegrees?: number, pathType?: Enum.CirclePathType)void ​

Draws the outline circle.

  • centerXnumber - The center x.
  • centerYnumber - The center y.
  • radiusnumber - The radius.
  • thicknessnumber (optional) - The thickness.
  • segmentsnumber (optional) - The segments.
  • startAngleInDegreesnumber (optional) - The start angle in degrees.
  • endAngleInDegreesnumber (optional) - The end angle in degrees.
  • pathTypeEnum.CirclePathType (optional) - The path type.

DrawFilledCircle(centerX: number, centerY: number, radius: number, segments?: number, startAngleInDegrees?: number, endAngleInDegrees?: number)void ​

Draws the filled circle.

  • centerXnumber - The center x.
  • centerYnumber - The center y.
  • radiusnumber - The radius.
  • segmentsnumber (optional) - The segments.
  • startAngleInDegreesnumber (optional) - The start angle in degrees.
  • endAngleInDegreesnumber (optional) - The end angle in degrees.

DrawLine(x1: number, y1: number, x2: number, y2: number, thickness?: number)void ​

Draws a minimap line between two positions.

  • x1number - The x1.
  • y1number - The y1.
  • x2number - The x2.
  • y2number - The y2.
  • thicknessnumber (optional) - The thickness.

DrawWorldLine(vec1: Vector, vec2: Vector, thickness?: number)void ​

Draws the world line.

  • vec1Vector - The vec1.
  • vec2Vector - The vec2.
  • thicknessnumber (optional) - The thickness.

LoadFont(name: string, size: number, weight: Enum.FontWeight, flags?: Enum.FontFlags, options?: LoadFontOptions)Font ​

Loads the font.

  • namestring - The name.
  • sizenumber - The size.
  • weightEnum.FontWeight - The weight.
  • flagsEnum.FontFlags (optional) - The flags.
  • optionsLoadFontOptions (optional) - The options.

Returned:

  • Font - The result of the call.

GetTextSize(font: Font, text: string)[number, number] ​

Retrieves the text size.

  • fontFont - The font instance to use.
  • textstring - The text value.

Returned:

  • [number, number] - The requested text size.

DrawText(font: Font, x: number, y: number, text: string)void ​

Draws the text.

  • fontFont - The font instance to use.
  • xnumber - The x coordinate.
  • ynumber - The y coordinate.
  • textstring - The text value.

DrawTextInRect(font: Font, x: number, y: number, width: number, height: number, text: string)void ​

Draws the text in rect.

  • fontFont - The font instance to use.
  • xnumber - The x coordinate.
  • ynumber - The y coordinate.
  • widthnumber - The width value.
  • heightnumber - The height value.
  • textstring - The text value.

DrawTextCentered(font: Font, x: number, y: number, text: string, time?: number)void ​

Draws the text centered.

  • fontFont - The font instance to use.
  • xnumber - The x coordinate.
  • ynumber - The y coordinate.
  • textstring - The text value.
  • timenumber (optional) - The time.

DrawWorldText(font: Font, vec: Vector, text: string, xOffset?: number, yOffset?: number)void ​

Draws the world text.

  • fontFont - The font instance to use.
  • vecVector - The world position vector.
  • textstring - The text value.
  • xOffsetnumber (optional) - The x offset.
  • yOffsetnumber (optional) - The y offset.

LoadImage(fileName: string, svgWidth?: number, svgHeight?: number)Image ​

Loads the image.

  • fileNamestring - The file name.
  • svgWidthnumber (optional) - The svg width.
  • svgHeightnumber (optional) - The svg height.

Returned:

  • Image - The result of the call.

DrawImage(image: Image, x: number, y: number, width: number, height: number, rounding?: number, corners?: Enum.RoundCorners, uvMin?: [number, number], uvMax?: [number, number])void ​

Draws the image.

  • imageImage - The image resource to use.
  • xnumber - The x coordinate.
  • ynumber - The y coordinate.
  • widthnumber - The width value.
  • heightnumber - The height value.
  • roundingnumber (optional) - The rounding.
  • cornersEnum.RoundCorners (optional) - The corners.
  • uvMin[number, number] (optional) - The uv min.
  • uvMax[number, number] (optional) - The uv max.

DrawImageQuad(image: Image, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, uv1?: [number, number], uv2?: [number, number], uv3?: [number, number], uv4?: [number, number])void ​

Draws the image quad.

  • imageImage - The image resource to use.
  • x1number - The x1.
  • y1number - The y1.
  • x2number - The x2.
  • y2number - The y2.
  • x3number - The x3.
  • y3number - The y3.
  • x4number - The x4.
  • y4number - The y4.
  • uv1[number, number] (optional) - The uv1.
  • uv2[number, number] (optional) - The uv2.
  • uv3[number, number] (optional) - The uv3.
  • uv4[number, number] (optional) - The uv4.

DrawWorldImage(image: Image, vec1: Vector, width: number, height: number, xOffset?: number, yOffset?: number)void ​

Draws the world image.

  • imageImage - The image resource to use.
  • vec1Vector - The vec1.
  • widthnumber - The width value.
  • heightnumber - The height value.
  • xOffsetnumber (optional) - The x offset.
  • yOffsetnumber (optional) - The y offset.

SetDrawColor(r: number, g: number, b: number, a: number)void ​

Sets the current drawing color.

  • rnumber - The r.
  • gnumber - The g.
  • bnumber - The b.
  • anumber - The a.

SetDrawColor(color: Color)void ​

Sets the current drawing color.

  • colorColor - The color value to use.

PushDrawOptions(options: DrawOptions)void ​

Pushes the draw options.

  • optionsDrawOptions - The options.

PopDrawOptions(count?: number)void ​

Pops the draw options.

  • countnumber (optional) - The count.

PushDrawPriority(val: number)void ​

alias for PushDrawOptions({priority: val})

  • valnumber - The val.

PushDrawTime(timeInS: number)void ​

alias for PushDrawOptions({time: time})

  • timeInSnumber - The time in s.

PushDrawAlign(align: Enum.ContentAlign)void ​

alias for PushDrawOptions({align: align})


PushDrawCentered()void ​

alias for PushDrawOptions({align: Enum.ContentAlign.CenterXY})


SetTopMost(enable: boolean)void ​

Sets the top most.

  • enableboolean - The enable.

WARNING

Deprecated. use PushDrawPriority


IsOnScreen(x: number, y: number)boolean ​

Checks whether it is on screen.

  • xnumber - The x coordinate.
  • ynumber - The y coordinate.

Returned:

  • boolean - True if the condition is met, false otherwise.

GetScreenSize()[number, number] ​

Retrieves the screen size.

Returned:

  • [number, number] - The requested screen size.

GetFullScreenClipRect()ClipRect ​

Retrieves the full screen clip rect.

Returned:

  • ClipRect - The requested full screen clip rect.

GetMiniMapRect()[number, number, number, number] ​

Retrieves the mini map rect.

Returned:

  • [number, number, number, number] - The requested mini map rect.

GetImagePath(image: Image)string ​

Retrieves the image path.

  • imageImage - The image resource to use.

Returned:

  • string - The requested image path.

GetAlignment()Enum.ContentAlign ​

Retrieves the alignment.

Returned:


GetPriority()number ​

Retrieves the priority.

Returned:

  • number - The requested priority.

WorldToScreen(pos: Vector, onScreenCheck?: boolean)[number, number, boolean] ​

Provides access to world to screen.

  • posVector - The pos.
  • onScreenCheckboolean (optional) - The on screen check.

Returned:

  • [number, number, boolean] - The result of the call.

ScreenToWorld(x: number, y: number)Vector | null ​

Provides access to screen to world.

  • xnumber - The x coordinate.
  • ynumber - The y coordinate.

Returned:

  • Vector | null - The matching object, or null if it is not available.

MapToWorld(x: number, y: number)[number, number] ​

Provides access to map to world.

  • xnumber - The x coordinate.
  • ynumber - The y coordinate.

Returned:

  • [number, number] - The result of the call.

WorldToMap(x: number, y: number)[number, number] ​

Provides access to world to map.

  • xnumber - The x coordinate.
  • ynumber - The y coordinate.

Returned:

  • [number, number] - The result of the call.

GetAlignmentOffset(width: number, height: number, align?: Enum.ContentAlign)[number, number] ​

Retrieves the alignment offset.

  • widthnumber - The width value.
  • heightnumber - The height value.
  • alignEnum.ContentAlign (optional) - The align.

Returned:

  • [number, number] - The requested alignment offset.

DrawPolygon(vertexes: Vertexes, x?: number, y?: number)void ​

Draws the polygon.

  • vertexesVertexes - The vertexes.
  • xnumber (optional) - if pass x argument function will apply x offset for all vertexes before draw
  • ynumber (optional) - if pass y argument function will apply y offset for all vertexes before draw

DrawTexturedPolygon(vertexes: Vertexes, image: Image, x?: number, y?: number)void ​

Draws the textured polygon.

  • vertexesVertexes - The vertexes.
  • imageImage - The image resource to use.
  • xnumber (optional) - if pass x argument function will apply x offset for all vertexes before draw
  • ynumber (optional) - if pass y argument function will apply y offset for all vertexes before draw

PushRenderTarget(texture: Texture)void ​

Pushes the render target.


SetRenderTarget(texture: Texture)void ​

Sets the render target.

WARNING

Deprecated. use PushRenderTarget instead


PopRenderTarget()void ​

Pops the render target.


SetOriginalRenderTarget()void ​

Sets the original render target.

WARNING

Deprecated. use PopRenderTarget instead


PushShader(shader: Shader)void ​

Pushes the shader.


PopShader()void ​

Pops the shader.


PushBlendState(blendState: BlendState)void ​

Pushes the blend state.


PopBlendState()void ​

Pops the blend state.


DrawScreenRegion(screenX: number, screenY: number, screenW: number, screenH: number, drawX: number, drawY: number, drawW: number, drawH: number)void ​

Draws the screen region.

  • screenXnumber - The screen x.
  • screenYnumber - The screen y.
  • screenWnumber - The screen w.
  • screenHnumber - The screen h.
  • drawXnumber - The draw x.
  • drawYnumber - The draw y.
  • drawWnumber - The draw w.
  • drawHnumber - The draw h.