Renderer

Wrapper for Draw2D calls, so that we can keep track of how much is being drawn per frame

Properties

  • nextSceneObjectId (integer)
  • minimumFrameRateTarget (integer) — Frame rate target - the game will reduce quality if this target is not met
  • onlyDrawWhenInFrame (boolean)
  • drawDebugCells (boolean)
  • drawDebugTrianglePoints (boolean)
  • computeOverlapClusters (boolean) — Whether drawScene() computes overlap clusters (BGE.DepthSort.groupIntoClusters) ' this frame. Off by default: nothing in the engine's actual draw path consumes ' getOverlapClusters() yet (that's a future follow-up - see #59's Plan 2), the cost ' of the O(n^2)-ish broad phase across every scene object hasn't been measured ' on-device, and the design's own requirement is that a solo (non-overlapping) ' scene sees zero regression from today's cost. Set this true to opt in (see ' examples/depthsort's ClusterVisualizerRoom, which visualizes the result) - ' TieBreakRoom deliberately does NOT opt in, since it only demonstrates the ' tie-break fix, not clustering. ' ' Known limitation: see drawPendingClusterPrimitives()'s doc comment for a ' disclosed draw-order gap affecting objects excluded from cluster candidacy ' entirely (lines, planes, or anything else with a degenerate bounding-point set).
  • camera (Camera)
  • triangleCache (dynamic)
  • frameCount (integer)
  • bmpPool (BGE.ScratchBitmapPool)
  • game (BGE.Game)
  • name (string)
  • statsString (string)
  • resources (dynamic)
  • dummyScreen (roScreen)

Constructor

new Renderer( draw2d: ifDraw2d, mainGame?: BGE.Game, cam?: BGE.Camera, options?: RendererOptions, ): Renderer

Parameters

  • draw2d (ifDraw2d)
  • mainGame (BGE.Game, optional, default: "invalid")
  • cam (BGE.Camera, optional, default: "invalid")
  • options (RendererOptions, optional, default: "{useBitmapPooling: true}")

Instance Methods

getRightTriangleResource(): BGE.RendererHelpers.TriangleBitmap

The renderer's shared right-triangle texture (see drawTriangleTo's oriented triangle fill), built lazily on first use rather than eagerly in the constructor - this used to be built upfront for every single Renderer constructed (i.e. every single Game), most of which never draw a triangle at all. Cached in resources.rightTriangle after the first call, exactly like resources.circle. See issue #103.

if it couldn't be created

Returns

  • BGE.RendererHelpers.TriangleBitmap — the built triangle resource, or invalid

getCircleResource(): ifDraw2d

The renderer's shared circle texture (see DrawableCircle/DrawableSphere/drawCircle), rasterized lazily on first use rather than eagerly in the constructor - rasterizing it (there is no native filled-circle draw call, so it's approximated with a row-by-row scanline fill) is expensive enough that building one for every single Renderer constructed - which is every single Game constructed, most of which never draw a circle at all - was measurably slowing down the entire test suite. Cached in resources.circle after the first call, exactly like resources.rightTriangle (see getRightTriangleResource(), issue #103), just built on demand instead of upfront.

Returns

  • ifDraw2d — the rasterized circle bitmap, or invalid if it couldn't be created

getCircleRegionWithId(): BGE.RendererHelpers.RegionWithId

The single shared roRegion wrapping getCircleResource(), cached after the first call - every DrawableCircle/DrawableSphere instance draws the exact same region, so SceneObjectCircle fetches this once per renderer instead of calling CreateObject("roRegion", ...) fresh on every single frame for every circle (which measurably tanked FPS with more than a couple on screen at once - unlike SceneObjectImage, which already caches its own region on the drawable at construction, this had no per-instance drawable to cache on, so it lives here).

Returns

  • BGE.RendererHelpers.RegionWithId

setDraw2d(draw2d: ifDraw2d): void

Parameters

  • draw2d (ifDraw2d)

Returns

  • void

setCamera(camera: Camera): void

Parameters

Returns

  • void

resetDrawCallCounter(): void

Returns

  • void

getDrawCallsLastFrame(): integer

How many draw calls have been issued since resetDrawCallCounter() - i.e. over the course of the current frame. Handy when working out how expensive a scene is to draw.

Returns

  • integer — the number of draw calls so far this frame

didSortLastFrame(): boolean

Whether drawScene() actually re-sorted the scene objects last frame, or skipped the sort because nothing that could change draw order happened. Exposed for testing/diagnostics, not meant to drive game logic.

Returns

  • boolean

getSceneObjectCount(): integer

How many SceneObjects are currently registered with this renderer.

Returns

  • integer

getOverlapClusters(): dynamic

This frame's overlap clusters - most objects are alone in a cluster of one. Only computed when computeOverlapClusters is true (off by default - see that field); otherwise this returns whatever was last computed (or [] if never enabled). Plan 2 will use this to decide caching/draw behavior; for now it's purely diagnostic/ visualized by examples/depthsort.

Returns

  • dynamic — each cluster as an array of its member SceneObjects

getSceneObjectIndexById(id: string): integer

The current array index of the SceneObject with the given id, or -1 if none matches. Exposed for testing stable sort order - not meant for game logic.

Parameters

  • id (string)

Returns

  • integer

addSceneObject(sceneObj: SceneObject): void

Parameters

Returns

  • void

addPendingClusterDraw(sceneObj: SceneObject): void

Registers a SceneObject as deferred to the end-of-frame interleaved cluster draw pass - called by SceneObject.draw() when clusterMemberCount > 1. Not meant to be called directly by game code.

Parameters

Returns

  • void

removeSceneObject(sceneObjToRemove: SceneObject): void

Parameters

Returns

  • void

setupCameraForFrame(): void

Returns

  • void

drawScene(): void

Returns

  • void

onSwapBuffers(): void

Returns

  • void

worldPointToCanvasPoint( pWorld: BGE.Math.Vector, ): BGE.Math.Vector

Parameters

  • pWorld (BGE.Math.Vector)

Returns

  • BGE.Math.Vector

getRayFromCameraToWorldPoint( pWorld: BGE.Math.Vector, ): BGE.Math.Vector

Parameters

  • pWorld (BGE.Math.Vector)

Returns

  • BGE.Math.Vector

drawLine( x: float, y: float, endX: float, endY: float, rgba: integer, ): boolean

Parameters

  • x (float)
  • y (float)
  • endX (float)
  • endY (float)
  • rgba (integer)

Returns

  • boolean

drawLineTo( draw2d: ifDraw2d, x: float, y: float, endX: float, endY: float, rgba: integer, ): boolean

Parameters

  • draw2d (ifDraw2d)
  • x (float)
  • y (float)
  • endX (float)
  • endY (float)
  • rgba (integer)

Returns

  • boolean

drawSquare( x: float, y: float, sideLength: float, rgba: integer, ): boolean

Parameters

  • x (float)
  • y (float)
  • sideLength (float)
  • rgba (integer)

Returns

  • boolean

drawSquareTo( draw2d: ifDraw2d, x: float, y: float, sideLength: float, rgba: integer, ): boolean

Parameters

  • draw2d (ifDraw2d)
  • x (float)
  • y (float)
  • sideLength (float)
  • rgba (integer)

Returns

  • boolean

drawRectangle( x: float, y: float, width: float, height: float, rgba: integer, ): boolean

Parameters

  • x (float)
  • y (float)
  • width (float)
  • height (float)
  • rgba (integer)

Returns

  • boolean

drawRectangleTo( draw2d: ifDraw2d, x: float, y: float, width: float, height: float, rgba: integer, ): boolean

Parameters

  • draw2d (ifDraw2d)
  • x (float)
  • y (float)
  • width (float)
  • height (float)
  • rgba (integer)

Returns

  • boolean

drawCircle( x: float, y: float, radius: float, rgba: integer, ): boolean

Draws a filled circle, centered at (x, y). There is no native filled-circle draw call, so this scales the renderer's own pre-rasterized circle resource (see getCircleResource()) rather than rasterizing a polygon fresh every call, the same way drawRectangle draws a native DrawRect instead of rasterizing a quad.

Parameters

  • x (float) — center x
  • y (float) — center y
  • radius (float)
  • rgba (integer) — fill color to tint the circle resource with

Returns

  • boolean — true if anything was drawn

drawCircleTo( draw2d: ifDraw2d, x: float, y: float, radius: float, rgba: integer, ): boolean

Parameters

  • draw2d (ifDraw2d)
  • x (float)
  • y (float)
  • radius (float)
  • rgba (integer)

Returns

  • boolean

drawText( text: string, x: integer, y: integer, color?: integer, font?: roFont, horizAlign?: string, vertAlign?: string, ): boolean

Draws text to the screen

Parameters

  • text (string) — the test to display
  • x (integer)
  • y (integer)
  • color (integer, optional, default: -1) — RGBA color to use
  • font (roFont, optional, default: "invalid") — Font object to use (uses default font if none provided)
  • horizAlign (string, optional, default: "\"left\"") — Horizontal Alignment - "left", "right" or "center"
  • vertAlign (string, optional, default: "\"top\"") — Vertical Alignment - "top", "bottom" or "center"

Returns

  • boolean

drawTextTo( draw2d: ifDraw2d, text: string, x: integer, y: integer, color?: integer, font?: roFont, horizAlign?: string, vertAlign?: string, lineSpace?: integer, ): boolean

Draws text to a canvas

Parameters

  • draw2d (ifDraw2d)
  • text (string) — the test to display
  • x (integer)
  • y (integer)
  • color (integer, optional, default: -1) — RGBA color to use
  • font (roFont, optional, default: "invalid") — Font object to use (uses default font if none provided)
  • horizAlign (string, optional, default: "\"left\"") — Horizontal Alignment - "left", "right" or "center"
  • vertAlign (string, optional, default: "\"top\"") — Vertical Alignment - "top", "bottom" or "center"
  • lineSpace (integer, optional, default: 0) — Additional space between lines

Returns

  • boolean

drawTransformedObject( x: float, y: float, scaleX: float, scaleY: float, theta: float, region: ifDraw2d, rgba?: integer, ): boolean

Draws a region to the canvas at the given scale, rotation and position.

Parameters

  • x (float)
  • y (float)
  • scaleX (float)
  • scaleY (float)
  • theta (float)
  • region (ifDraw2d)
  • rgba (integer, optional, default: -1)

Returns

  • boolean

drawTransformedObjectTo( draw2d: ifDraw2d, x: float, y: float, scale_x: float, scale_y: float, theta: float, region: ifDraw2d, rgba?: integer, ): boolean

Parameters

  • draw2d (ifDraw2d)
  • x (float)
  • y (float)
  • scale_x (float)
  • scale_y (float)
  • theta (float)
  • region (ifDraw2d)
  • rgba (integer, optional, default: -1)

Returns

  • boolean

drawPinnedCorners( cornerPoints: BGE.Math.CornerPoints, drawableRegion: BGE.RendererHelpers.RegionWithId, options?: DrawPinnedCornersOptions, color?: integer, ): boolean

Parameters

  • cornerPoints (BGE.Math.CornerPoints)
  • drawableRegion (BGE.RendererHelpers.RegionWithId)
  • options (DrawPinnedCornersOptions, optional, default: "{}")
  • color (integer, optional, default: -1)

Returns

  • boolean

drawRotatedImageWithCenter( srcRegion: ifDraw2d, srcRotationPoint: BGE.Math.Vector, theta: float, translation?: BGE.Math.Vector, drawScale?: BGE.Math.Vector, ): boolean

Convenience wrapper for drawRotatedImageWithCenterTo that draws to this renderer's own canvas.

Parameters

  • srcRegion (ifDraw2d) — the source region to draw from
  • srcRotationPoint (BGE.Math.Vector) — the position in srcRegion to rotate about, relative to the region's pretranslation
  • theta (float) — the angle to rotate by (in radians)
  • translation (BGE.Math.Vector, optional, default: "BGE.Math.VectorOps.create()") — the translation to apply after rotation
  • drawScale (BGE.Math.Vector, optional, default: "BGE.Math.createScaleVector(1)") — the scale to apply when drawing

Returns

  • boolean — true if the drawing succeeded

drawRotatedImageWithCenterTo( draw2d: ifDraw2d, srcRegion: ifDraw2d, srcRotationPoint: BGE.Math.Vector, theta: float, translation?: BGE.Math.Vector, drawScale?: BGE.Math.Vector, ): boolean

Rotates a region about a point, and draws it to a given draw2d surface with a given scale and translation.

Parameters

  • draw2d (ifDraw2d) — the final destination for the drawing
  • srcRegion (ifDraw2d) — the source region to draw from
  • srcRotationPoint (BGE.Math.Vector) — the position in srcRegion to rotate about, relative to the region's pretranslation
  • theta (float) — the angle to rotate by (in radians)
  • translation (BGE.Math.Vector, optional, default: "BGE.Math.VectorOps.create()") — the translation to apply after rotation
  • drawScale (BGE.Math.Vector, optional, default: "BGE.Math.createScaleVector(1)") — the scale to apply when drawing

Returns

  • boolean — true if the drawing succeeded

makeIntoTriangle( srcRegionWithId: BGE.RendererHelpers.RegionWithId, points: dynamic, makeAcute?: boolean, useCache?: boolean, ): BGE.RendererHelpers.TriangleBitmap

Parameters

  • srcRegionWithId (BGE.RendererHelpers.RegionWithId)
  • points (dynamic)
  • makeAcute (boolean, optional, default: false)
  • useCache (boolean, optional, default: false)

Returns

  • BGE.RendererHelpers.TriangleBitmap

drawBitmapTriangle( srcRegionWithId: BGE.RendererHelpers.RegionWithId, srcPoints: dynamic, destPoints: dynamic, rgba?: integer, ): boolean

Draws a bitmap warped from srcPoints onto destPoints, directly to this renderer's own canvas. See drawBitmapTriangleTo() for the note about staged scratch bitmaps.

Parameters

  • srcRegionWithId (BGE.RendererHelpers.RegionWithId) — the region to draw from
  • srcPoints (dynamic)
  • destPoints (dynamic)
  • rgba (integer, optional, default: -1)

Returns

  • boolean — true if it worked

drawBitmapTriangleTo( draw2d: ifDraw2d, srcRegionWithId: BGE.RendererHelpers.RegionWithId, srcPoints: dynamic, destPoints: dynamic, rgba?: integer, ): boolean

NOTE: This method uses temporary bitmaps. In order not to re-use them for subsequent calls they are staged for return to the bitmap pool. You need to manually call bmpPool.returnStagedRegions() to return them after you're sure all the drawing to the surface is done

Parameters

  • draw2d (ifDraw2d)
  • srcRegionWithId (BGE.RendererHelpers.RegionWithId) — the region to draw from
  • srcPoints (dynamic)
  • destPoints (dynamic)
  • rgba (integer, optional, default: -1)

Returns

  • boolean — true if it worked

drawPinnedCornersTo( draw2d: ifDraw2d, cornerPoints: BGE.Math.CornerPoints, drawableRegion: BGE.RendererHelpers.RegionWithId, options?: DrawPinnedCornersOptions, color?: integer, ): boolean

Parameters

  • draw2d (ifDraw2d)
  • cornerPoints (BGE.Math.CornerPoints)
  • drawableRegion (BGE.RendererHelpers.RegionWithId)
  • options (DrawPinnedCornersOptions, optional, default: "{}")
  • color (integer, optional, default: -1)

Returns

  • boolean

drawCircleOutline( line_count: integer, x: float, y: float, radius: float, rgba: integer, ): boolean

Parameters

  • line_count (integer)
  • x (float)
  • y (float)
  • radius (float)
  • rgba (integer)

Returns

  • boolean

drawRectangleOutline( x: float, y: float, width: float, height: float, rgba: integer, lineWidth?: integer, ): boolean

Draws the outline of an axis-aligned rectangle

Parameters

  • x (float) — left edge
  • y (float) — top edge
  • width (float)
  • height (float)
  • rgba (integer) — color to stroke with
  • lineWidth (integer, optional, default: 1) — stroke thickness in pixels, drawn inwards from the given bounds

Returns

  • boolean — true if anything was drawn

drawRectangleOutlineTo( draw2d: ifDraw2d, x: float, y: float, width: float, height: float, rgba: integer, lineWidth?: integer, ): boolean

Draws the outline of an axis-aligned rectangle to the given surface

Parameters

  • draw2d (ifDraw2d) — surface to draw to
  • x (float) — left edge
  • y (float) — top edge
  • width (float)
  • height (float)
  • rgba (integer) — color to stroke with
  • lineWidth (integer, optional, default: 1) — stroke thickness in pixels, drawn inwards from the given bounds

Returns

  • boolean — true if anything was drawn

drawPolygonOutline( pointsArray: Array.<BGE.Math.Vector>, colorRgba: integer, lineWidth?: integer, ): boolean

Draws the outline of a polygon, connecting each point to the next and the last back to the first

Parameters

  • pointsArray (Array.<BGE.Math.Vector>) — points in outline (perimeter) order, not bounds order
  • colorRgba (integer) — color to stroke with
  • lineWidth (integer, optional, default: 1) — stroke thickness in pixels - approximated by nested outlines shrunk towards the polygon's center

Returns

  • boolean — true if anything was drawn

drawPolygonOutlineTo( draw2d: ifDraw2d, pointsArray: Array.<BGE.Math.Vector>, colorRgba: integer, lineWidth?: integer, ): boolean

Draws the outline of a polygon to the given surface

Parameters

  • draw2d (ifDraw2d) — surface to draw to
  • pointsArray (Array.<BGE.Math.Vector>) — points in outline (perimeter) order, not bounds order
  • colorRgba (integer) — color to stroke with
  • lineWidth (integer, optional, default: 1) — stroke thickness in pixels - approximated by nested outlines shrunk towards the polygon's center

Returns

  • boolean — true if anything was drawn

drawObject( x: integer, y: integer, src: ifDraw2d, rgba?: integer, ): boolean

Parameters

  • x (integer)
  • y (integer)
  • src (ifDraw2d)
  • rgba (integer, optional, default: -1)

Returns

  • boolean

drawObjectTo( draw2d: ifDraw2d, x: integer, y: integer, src: ifDraw2d, rgba?: integer, ): boolean

Parameters

  • draw2d (ifDraw2d)
  • x (integer)
  • y (integer)
  • src (ifDraw2d)
  • rgba (integer, optional, default: -1)

Returns

  • boolean

drawScaledObject( x: integer, y: integer, scaleX: float, scaleY: float, src: ifDraw2d, rgba?: integer, ): boolean

Parameters

  • x (integer)
  • y (integer)
  • scaleX (float)
  • scaleY (float)
  • src (ifDraw2d)
  • rgba (integer, optional, default: -1)

Returns

  • boolean

drawScaledObjectTo( draw2d: ifDraw2d, x: integer, y: integer, scaleX: float, scaleY: float, src: ifDraw2d, rgba?: integer, ): boolean

Parameters

  • draw2d (ifDraw2d)
  • x (integer)
  • y (integer)
  • scaleX (float)
  • scaleY (float)
  • src (ifDraw2d)
  • rgba (integer, optional, default: -1)

Returns

  • boolean

drawRotatedObject( x: integer, y: integer, theta: float, src: ifDraw2d, rgba?: integer, ): boolean

Parameters

  • x (integer)
  • y (integer)
  • theta (float)
  • src (ifDraw2d)
  • rgba (integer, optional, default: -1)

Returns

  • boolean

drawRotatedObjectTo( draw2d: ifDraw2d, x: integer, y: integer, theta: float, src: ifDraw2d, rgba?: integer, ): boolean

Parameters

  • draw2d (ifDraw2d)
  • x (integer)
  • y (integer)
  • theta (float)
  • src (ifDraw2d)
  • rgba (integer, optional, default: -1)

Returns

  • boolean

drawRegion( regionToDraw: ifDraw2d, x: float, y: float, scaleX?: float, scaleY?: float, rotation?: float, rgba?: integer, ): boolean

Parameters

  • regionToDraw (ifDraw2d)
  • x (float)
  • y (float)
  • scaleX (float, optional, default: 1)
  • scaleY (float, optional, default: 1)
  • rotation (float, optional, default: 0)
  • rgba (integer, optional, default: -1)

Returns

  • boolean

drawRegionTo( canvasDrawTo: ifDraw2d, regionToDraw: ifDraw2d, x: float, y: float, scaleX?: float, scaleY?: float, rotation?: float, rgba?: integer, ): boolean

Parameters

  • canvasDrawTo (ifDraw2d)
  • regionToDraw (ifDraw2d)
  • x (float)
  • y (float)
  • scaleX (float, optional, default: 1)
  • scaleY (float, optional, default: 1)
  • rotation (float, optional, default: 0)
  • rgba (integer, optional, default: -1)

Returns

  • boolean

drawTriangle( points: dynamic, x: float, y: float, rgba: integer, allowQuickDraw?: boolean, ): boolean

Parameters

  • points (dynamic)
  • x (float)
  • y (float)
  • rgba (integer)
  • allowQuickDraw (boolean, optional, default: false)

Returns

  • boolean

drawTriangleTo( canvasDrawTo: ifDraw2d, points: dynamic, x: float, y: float, rgba: integer, allowQuickDraw?: boolean, ): boolean

Parameters

  • canvasDrawTo (ifDraw2d)
  • points (dynamic)
  • x (float)
  • y (float)
  • rgba (integer)
  • allowQuickDraw (boolean, optional, default: false)

Returns

  • boolean

drawPolygon( points: dynamic, x: float, y: float, rgba: integer, allowQuickDraw?: boolean, ): boolean

Parameters

  • points (dynamic)
  • x (float)
  • y (float)
  • rgba (integer)
  • allowQuickDraw (boolean, optional, default: false)

Returns

  • boolean

drawPolygonTo( canvasDrawTo: ifDraw2d, points: dynamic, x: float, y: float, rgba: integer, allowQuickDraw?: boolean, ): boolean

Parameters

  • canvasDrawTo (ifDraw2d)
  • points (dynamic)
  • x (float)
  • y (float)
  • rgba (integer)
  • allowQuickDraw (boolean, optional, default: false)

Returns

  • boolean

drawPolygonAsRectangles( canvasDrawTo: ifDraw2d, points: dynamic, x: float, y: float, rgba: integer, options?: LevelOfDetailOptions, ): boolean

Parameters

  • canvasDrawTo (ifDraw2d)
  • points (dynamic)
  • x (float)
  • y (float)
  • rgba (integer)
  • options (LevelOfDetailOptions, optional, default: "{levelOffset: 0, levelOfDetail: 2}")

Returns

  • boolean

drawPolygonAsRectanglesTo( canvasDrawTo: ifDraw2d, points: dynamic, x: float, y: float, rgba: integer, options?: LevelOfDetailOptions, ): boolean

Draw a filled convex polygon with rectangles

Parameters

  • canvasDrawTo (ifDraw2d)
  • points (dynamic)
  • x (float)
  • y (float)
  • rgba (integer)
  • options (LevelOfDetailOptions, optional, default: "{levelOffset: 0, levelOfDetail: 2}")

Returns

  • boolean

drawTriangleAsRaysTo( canvasDrawTo: ifDraw2d, points: dynamic, x: float, y: float, rgba: integer, options?: LevelOfDetailOptions, ): boolean

Parameters

  • canvasDrawTo (ifDraw2d)
  • points (dynamic)
  • x (float)
  • y (float)
  • rgba (integer)
  • options (LevelOfDetailOptions, optional, default: "{levelOffset: 0, levelOfDetail: 2}")

Returns

  • boolean

getCanvasSize(): BGE.Math.Vector

Returns

  • BGE.Math.Vector

getCanvasCenter(): BGE.Math.Vector

Returns

  • BGE.Math.Vector

isInsideCanvas( originalX: float, originalY: float, draw2d: object, x: float, y: float, width: float, height: float, rotation?: float, ): boolean

Checks to see if a rectangle will be in a Draw2d Canvas

Parameters

  • originalX (float)
  • originalY (float)
  • draw2d (object)
  • x (float)
  • y (float)
  • width (float)
  • height (float)
  • rotation (float, optional, default: 0) — in radians

Returns

  • boolean — true if this rectangle overlaps with the canvas

isBoundingBoxOutsideCanvas( points: Array.<BGE.Math.Vector>, ): boolean

Whether the axis-aligned bounding box of the given canvas-space points is entirely outside this renderer's canvas - a cheap, deterministic version of the check shouldDrawTo()/isInsideCanvas() run against a specific draw call's rectangle. A SceneObject already holding its own canvas points (e.g. getAllCanvasPoints()) can use this to tell a draw failure that will keep failing every frame (off-canvas) apart from a transient one, so it's safe to latch the same way a frustum cull does - see SceneObject.isDeterministicDrawFailure().

This assumes shouldDrawTo() would actually reject an off-canvas draw, which is only true while onlyDrawWhenInFrame is left at its default true - there's currently no public way to turn that off, so this holds everywhere in this codebase today. If that ever changes, a caller with onlyDrawWhenInFrame = false could misidentify a genuinely transient failure as deterministic just because it happens to also be off-canvas.

Parameters

  • points (Array.<BGE.Math.Vector>) — canvas-space points

Returns

  • boolean — true if every point lies outside the canvas, with no overlap at all

drawTrianglePoints( points: dynamic, size?: integer, offset?: PositionXY, drawRegardlessOfDebugValue?: boolean, ): boolean

Parameters

  • points (dynamic)
  • size (integer, optional, default: 5)
  • offset (PositionXY, optional, default: "{x: 0, y: 0}")
  • drawRegardlessOfDebugValue (boolean, optional, default: false)

Returns

  • boolean

drawTrianglePointsTo( draw2dRegion: object, points: dynamic, size?: integer, offset?: PositionXY, drawRegardlessOfDebugValue?: boolean, ): boolean

Parameters

  • draw2dRegion (object)
  • points (dynamic)
  • size (integer, optional, default: 5)
  • offset (PositionXY, optional, default: "{x: 0, y: 0}")
  • drawRegardlessOfDebugValue (boolean, optional, default: false)

Returns

  • boolean

drawTriangleOutline( pointsArray: dynamic, colorRgba: integer, offset?: PositionXY, ): boolean

Parameters

  • pointsArray (dynamic)
  • colorRgba (integer)
  • offset (PositionXY, optional, default: "{x: 0, y: 0}")

Returns

  • boolean

drawTriangleOutlineTo( draw2d: ifDraw2d, pointsArray: dynamic, colorRgba: integer, offset?: PositionXY, ): boolean

Parameters

  • draw2d (ifDraw2d)
  • pointsArray (dynamic)
  • colorRgba (integer)
  • offset (PositionXY, optional, default: "{x: 0, y: 0}")

Returns

  • boolean

addDebugCell(region: ifDraw2d, text?: string): void

Parameters

  • region (ifDraw2d)
  • text (string, optional, default: "\"\"")

Returns

  • void

forceDraw(drawSurface: ifDraw2d): void

Parameters

  • drawSurface (ifDraw2d)

Returns

  • void