Renderer
Wrapper for Draw2D calls, so that we can keep track of how much is being drawn per frame
Properties
minimumFrameRateTarget(integer) — Frame rate target - the game will reduce quality if this target is not metonlyDrawWhenInFrame(boolean)drawDebugCells(boolean)drawDebugTrianglePoints(boolean)computeOverlapClusters(boolean) — Whether render() computes overlap clusters (BGE.DepthSort.groupIntoClusters)occlusionCullingEnabled(boolean) — Whether static drawables flagged isOccluder hide what's behind them.occlusionBandCount(integer) — Number of vertical bands in the occlusion span map.maxOccluders(integer) — The most occluders considered per frame.occlusionMargin(float) — Pixels added around each tested object's canvas box (plus its outline width) beforeshowOcclusionDebug(boolean) — Whether to draw the occlusion debug overlay (see Game.debugDrawOcclusion()).occluderDrawPolicy(BGE.OccluderDrawPolicy) — How occluders trade exactness for speed - see BGE.OccluderDrawPolicy. Takes effectprofileStages(boolean) — When true, render() times each of its stages, and each scene object type's draws -fogSilhouettesDrawnLastFrame(integer) — Fog silhouettes (see BGE.Fog) drawn and worked out last frame; 0 worked out means the lastfogSilhouettesProjectedLastFrame(integer)camera(Camera)quadColumns(dynamic) — Draws textured quads as projected texture columns (see drawTexturedQuadTo())maxQuadColumnTextures(integer) — Most textures getQuadColumnTexture() keeps before starting over (each holds its bitmap)frameCount(integer)bmpPool(BGE.ScratchBitmapPool)qualitySettings(BGE.RenderQualitySettings) — The draw-quality values this renderer uses.Gamesets these from the currentfixedDrawDistance(boolean) — Draw out to the camera's maxDrawDistance at every quality level (see BGE.SceneQualityOptions).projectedPointCount(integer) — For tests: points projected by paths that don't call worldPointToCanvasPoint()qualityVersion(integer) — Bumped by every setQualitySettings() call, so scene objects know to redraw theirlights(Array.<BGE.Light>) — The lights shading this renderer'sisShadeddrawables - see addLight(). With nolightingVersion(integer) — Bumped whenever a light is added, removed or changed, so scene objects know togame(BGE.Game)name(string)statsString(string)resourcesdummyScreen(roScreen)
Constructor
new Renderer(
draw2d: ifDraw2d,
mainGame?: BGE.Game,
cam?: BGE.Camera,
options?: RendererOptions,
): RendererTurns on alpha blending on draw2d (SetAlphaEnable(true)), which scene objects need - so later drawing of your own onto that surface blends too.
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.
Returns
BGE.RendererHelpers.TriangleBitmap— the built triangle resource, or invalid if it couldn't be created
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
Points this renderer at a different surface. Turns on alpha blending on it, which scene objects need.
Parameters
draw2d(ifDraw2d)
Returns
void
setCamera(camera: Camera): void
Parameters
camera(Camera)
Returns
void
setPlaneDrawDistanceRange(scale: float, override: float): void
Sets how far a ground plane reaches: the largest draw-distance scale and override any quality level uses. RenderQualityManager calls this; without it the ground reaches this renderer's own level's distance.
Parameters
scale(float)override(float) — 0 for none
Returns
void
addLight(light: BGE.Light): void
Adds a light that shades this renderer's isShaded drawables. Adding the first light switches shading from camera-facing to these lights.
Parameters
light(BGE.Light) — e.g.new BGE.DirectionalLight(BGE.Math.VectorOps.create(1, -1, -1))
Returns
void
removeLight(light: BGE.Light): boolean
Removes a light added with addLight().
Parameters
light(BGE.Light)
Returns
boolean— true if it was found
clearLights(): void
Removes every light, returning shading to camera-facing.
Returns
void
hasLights(): boolean
Whether shading uses this renderer's lights (at least one is enabled) as of this frame.
Returns
boolean
getPreparedLights(): Array.<BGE.Lighting.PreparedLight>
This frame's enabled lights, ready for BGE.Lighting.computeLightAmount().
Returns
Array.<BGE.Lighting.PreparedLight>
updateLighting(): void
Picks up any light change since last frame. render() calls this first; lights are compared by value, so changing a light's fields directly is noticed too.
Returns
void
setQualitySettings(settings: BGE.RenderQualitySettings): void
Replaces this renderer's draw-quality values. Takes effect from the next draw. Use this rather than assigning qualitySettings directly.
Parameters
settings(BGE.RenderQualitySettings) — e.g.BGE.getRenderQualityPreset(BGE.RenderQualityLevel.high)
Returns
void
getTriangleQuickDrawParams(): TriangleQuickDrawParams
The triangle fill parameters in effect for this quality level.
Returns
TriangleQuickDrawParams— {skipSize, maxBands, step}
getLossyTriangleFillCount(): integer
How many triangles this renderer has drawn with a coarse (or skipped) fill so far. Compare it before and after drawing to tell whether that drawing needs redoing exactly once the object stops moving.
Returns
integer
getQuickDrawFillError(): float
How far, in pixels, a triangle filled with allowQuickDraw may fall short of its exact edges: the coarse band size, or 0 when quick drawing never coarsens a fill.
Returns
float
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 render() 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(): Array.<Array.<BGE.SceneObject>>
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
Array.<Array.<BGE.SceneObject>>— 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
sceneObj(SceneObject)
Returns
void
getVoxelTerrain(): dynamic
The voxel terrain scene object drawn this frame (a BGE.SceneObjectVoxelTerrain), or invalid if none drew.
Returns
dynamic
getWalls(): dynamic
The walls scene object drawn this frame (a BGE.SceneObjectWalls), or invalid if none drew - e.g. none is registered, it's disabled, or the camera is a Camera2d.
Returns
dynamic
isBehindWalls(point: BGE.Math.Vector): boolean
Whether a world point is hidden behind the walls, as seen from the camera, so a game can hide its own overlays. As of the last render(): false when no walls drew then. drawWorldBar/drawWorldPolyline (and so drawWorldCircle/drawWorldArc) already use this.
Parameters
point(BGE.Math.Vector) — world space
Returns
boolean
markOccluder(sceneObj: SceneObject): void
Registers a SceneObject as an occluder, so it can hide objects behind it. Called automatically by addSceneObject() for a Drawable with isOccluder set on a static entity - exposed publicly so a SceneObject with no owning GameEntity can opt in directly. Declines (with a warning) a type that can't occlude, or a drawable drawn in a screen-aligned mode (its own, or the camera's for matchCamera).
Parameters
sceneObj(SceneObject)
Returns
void
hasOccluders(): boolean
Whether any occluder is currently registered.
Returns
boolean
getOcclusionMap(): BGE.OcclusionSpanMap
The occlusion span map built from this frame's occluders, for debug drawing and tests.
Returns
BGE.OcclusionSpanMap— invalid until occlusion culling has first had work to do
getOcclusionMapBuildCount(): integer
How many times the occlusion map has been built. It's only rebuilt when the camera, an occluder, the canvas or an occlusion setting changes.
Returns
integer
getOccludedCountLastFrame(): integer
How many scene objects occlusion culling or the walls hid in the last rendered frame.
Returns
integer
getOcclusionMsLastFrame(): integer
How long occlusion culling took in the last rendered frame, in whole milliseconds.
Returns
integer
getOcclusionTestsLastFrame(): integer
How many scene objects were fully tested against the occlusion map in the last rendered frame - those not ruled out by a cheaper check first.
Returns
integer
markStatic(sceneObj: SceneObject): void
Marks a SceneObject as static geometry and schedules a tree rebuild. Called automatically by addSceneObject() when the object's owning GameEntity is isStatic - exposed publicly so a SceneObject with no owning GameEntity (e.g. examples/rendererTest, which builds scene objects directly - see SkyboxTest.bs) can still opt in directly.
Self-guards on isEligibleForStaticBsp(): a type that doesn't support static BSP (v1 supports SceneObjectImage/SceneObjectRectangle only) is declined rather than flagged isStatic, since buildStaticGeometryTree() would otherwise call getWorldPoints() on it (base-class default invalid) and crash on the next rebuild. This guard lives here rather than only at addSceneObject()'s call site so a direct call to this public method gets the same protection.
Parameters
sceneObj(SceneObject)
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
sceneObj(SceneObject)
Returns
void
removeSceneObject(sceneObjToRemove: SceneObject): void
Parameters
sceneObjToRemove(SceneObject)
Returns
void
getFogSilhouetteRgbas(): Array.<integer>
Each fog silhouette box's RGBA, as drawn last frame (see BGE.Fog). Don't change it.
Returns
Array.<integer>
addStageMs(name: string, ms: integer): void
Adds ms to a stage while profileStages is on - see getStageMsLastFrame(). For the engine's own profiling.
Parameters
name(string)ms(integer)
Returns
void
getProfileClockMs(): integer
A free-running millisecond clock for timing stages - see addStageMs().
Returns
integer
getStageMsLastFrame(): roAssociativeArray
Milliseconds each stage of the last render() took, by name, while profileStages is on: "update", "occlusion" (of which "occlusionBuild" rebuilt the span map), "sort" (overlap clusters and the depth sort), "skybox", "planes", "walls" (of which "wallsWalk", "wallsShade" and "wallsStrips"), "objects" (everything else, including the static geometry walk), "clusters" and "finish", plus "draw" for each SceneObjectType drawn (e.g. "drawModel", "drawBillboard") - those are part of "objects". Readings are whole milliseconds, so average them over many frames.
Returns
roAssociativeArray— stage name to milliseconds
getStageCountsLastFrame(): roAssociativeArray
How many times each stage in getStageMsLastFrame() ran last frame - for a "draw" stage, how many objects of that type were drawn.
Returns
roAssociativeArray— stage name to count
hasStaticGeometryTree(): boolean
Whether any static geometry has ever been registered on this renderer - true even if every static object has since been removed (see hasStaticGeometry's own doc comment). Exposed for tests/diagnostics, not meant for game logic.
Returns
boolean
getSceneObjectsCopy(): Array.<BGE.SceneObject>
A shallow copy of every currently-registered SceneObject - for diagnostics/tests (see Task 6's rendererTest benchmark) that need to enumerate them without a direct reference to the live internal array.
Returns
Array.<BGE.SceneObject>
setupCameraForFrame(): void
Returns
void
render(): void
Draws one frame: updates every SceneObject, depth-sorts them, and draws them to this renderer's surface. Game calls this for you each frame; call it yourself only when using a Renderer without a Game.
Returns
void
onSwapBuffers(): void
Call once per frame, after the screen is swapped (Game does this). Scratch bitmaps used this frame are only reused after it, so a Renderer used without a Game must call it too.
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
drawWorldPolyline(
points: Array.<BGE.Math.Vector>,
rgba: integer,
closed?: boolean,
): boolean
Draws lines joining world-space points, e.g. a path or a zone on the ground in a debug overlay. A segment is skipped when either end can't be projected (behind a Camera3d) or is behind the walls.
Parameters
points(Array.<BGE.Math.Vector>) — world spacergba(integer)closed(boolean, optional, default: false) — also join the last point back to the first
Returns
boolean— true if every segment was drawn
drawWorldCircle(
center: BGE.Math.Vector,
radius: float,
rgba: integer,
segments?: integer,
): boolean
Draws a flat ring on the ground plane (XZ) through center, at center's height.
Parameters
center(BGE.Math.Vector) — world spaceradius(float) — world unitsrgba(integer)segments(integer, optional, default: 24)
Returns
boolean— true if every segment was drawn
drawWorldArc(
center: BGE.Math.Vector,
radius: float,
fromHeading: float,
toHeading: float,
rgba: integer,
wedge?: boolean,
segments?: integer,
): boolean
Draws an arc on the ground plane (XZ) round center, from one heading to another (see BGE.Math.headingForward() for the convention), e.g. a melee attack's reach.
Parameters
center(BGE.Math.Vector) — world spaceradius(float) — world unitsfromHeading(float) — radianstoHeading(float) — radiansrgba(integer)wedge(boolean, optional, default: false) — also draw both edges back to the centre, like a pie slicesegments(integer, optional, default: 16)
Returns
boolean— true if every segment was drawn
drawWorldBar(
worldPoint: BGE.Math.Vector,
width: float,
height: float,
fraction: float,
fillColor: integer,
backColor: integer,
border?: integer,
): boolean
Draws a screen-aligned bar (e.g. a health bar) at a world point, centred on it horizontally with its bottom edge on it, so a point at the top of an entity's head puts the bar just above. Its size is in canvas pixels, whatever the distance. The fill is inset by border pixels, leaving a frame in backColor. Skipped when the point is behind a Camera3d or the walls.
Parameters
worldPoint(BGE.Math.Vector) — world spacewidth(float) — canvas pixels, including the borderheight(float) — canvas pixels, including the borderfraction(float) — how full, clamped to 0..1fillColor(integer) — rgbabackColor(integer) — rgba, behind the fill and as the borderborder(integer, optional, default: 1) — pixels between the edge and the fill
Returns
boolean— true if the bar was drawn
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 xy(float) — center yradius(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
getDraw2d(): ifDraw2d
Exposes the underlying draw surface to a helper that needs to draw without going through a Renderer.draw* call (e.g. BGE.QrCode.draw()) - see that function's own doc comment for why it takes a Renderer instead of Renderer exposing a drawQRCode() of its own.
Returns
ifDraw2d
incrementDrawCalls(count?: integer): void
Lets an external helper that draws directly to getDraw2d() (bypassing every normal Renderer.draw* call) still contribute to the same per-frame draw-call count as everything else - see getDraw2d()'s doc comment.
Parameters
count(integer, optional, default: 1)
Returns
void
getCircleQuadrantRegions(): dynamic
The renderer's four cached quadrant roRegions of getCircleResource(), one per rounded corner - built lazily on first use and cached in resources.circleQuadrants exactly like getCircleRegionWithId(), so drawRoundedRectangle doesn't re-run CreateObject("roRegion", ...) on every single call.
Returns
dynamic— an associative array with topLeft/topRight/bottomLeft/bottomRight roRegion keys, or invalid if the circle resource couldn't be created
drawRoundedRectangle(
x: float,
y: float,
width: float,
height: float,
radius: float,
rgba: integer,
): boolean
Draws a filled rectangle with rounded corners, top-left anchored at (x, y). The four corners are quadrant sections of the renderer's shared circle resource (see getCircleResource()/getCircleQuadrantRegions()) scaled to radius, composited with native DrawRect calls for the straight edges/fill - the same "reuse the pre-rasterized circle instead of rasterizing fresh" approach drawCircle takes.
Parameters
x(float) — top-left xy(float) — top-left ywidth(float)height(float)radius(float) — corner radius - clamped to at most half of width/height, so an oversized radius degrades to a "stadium"/circle shape rather than drawing garbagergba(integer) — fill color (also tints the corner regions, matching drawCircle)
Returns
boolean— true if anything was drawn
drawRoundedRectangleTo(
draw2d: ifDraw2d,
x: float,
y: float,
width: float,
height: float,
radius: float,
rgba: integer,
): boolean
Parameters
draw2d(ifDraw2d)x(float)y(float)width(float)height(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 displayx(integer)y(integer)color(integer, optional, default: -1) — RGBA color to usefont(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 displayx(integer)y(integer)color(integer, optional, default: -1) — RGBA color to usefont(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
beginBlitCapture(): void
Starts watching the draw calls a SceneObject's draw makes, so that if it's exactly one blit, the object can repeat it on later frames while nothing it depends on changes (see SceneObject.draw()). For the engine's own scene objects.
Returns
void
endBlitCapture(): object
Stops watching (see beginBlitCapture()).
Returns
object— the one blit made since beginBlitCapture(), or invalid if it drew anything else, or drew more than once
cancelBlitCapture(): void
Rules out repeating the current capture: for a draw that also drew something the capture can't see, or blitted from a scratch bitmap that won't last the frame.
Returns
void
markCapturedBlitWithoutPretranslation(): void
Records that the blit just captured was drawn with its source region's pretranslation set to 0 for the call, so replayBlit() does the same.
Returns
void
replayBlit(blit: object): boolean
Repeats a blit endBlitCapture() returned.
Parameters
blit(object)
Returns
boolean— true if it drew
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
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 fromsrcRotationPoint(BGE.Math.Vector) — the position in srcRegion to rotate about, relative to the region's pretranslationtheta(float) — the angle to rotate by (in radians)translation(BGE.Math.Vector, optional, default: "BGE.Math.VectorOps.create()") — the translation to apply after rotationdrawScale(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 drawingsrcRegion(ifDraw2d) — the source region to draw fromsrcRotationPoint(BGE.Math.Vector) — the position in srcRegion to rotate about, relative to the region's pretranslationtheta(float) — the angle to rotate by (in radians)translation(BGE.Math.Vector, optional, default: "BGE.Math.VectorOps.create()") — the translation to apply after rotationdrawScale(BGE.Math.Vector, optional, default: "BGE.Math.createScaleVector(1)") — the scale to apply when drawing
Returns
boolean— true if the drawing succeeded
getQuadColumnTexture(
texture: BGE.RendererHelpers.RegionWithId,
): BGE.QuadColumnTexture
The column texture for texture, cut once and cached by its id (an empty id isn't cached). The id must name the pixels: a cached one is only rechecked for its region's place and size.
Parameters
texture(BGE.RendererHelpers.RegionWithId)
Returns
clearQuadColumnTextures(): void
Forgets every cached column texture, releasing their bitmaps.
Returns
void
drawTexturedQuadTo(
target: ifDraw2D,
corners: Array.<BGE.Math.Vector>,
texture: BGE.RendererHelpers.RegionWithId,
colors?: Array.<integer>,
): integer
Draws a texture onto a world-space quad as projected texture columns (perspective correct, no scratch bitmaps), with as many columns as render quality allows. Needs a Camera3d.
Parameters
target(ifDraw2D) — an roBitmap or roScreencorners(Array.<BGE.Math.Vector>) — the texture's top-left, top-right, bottom-left and bottom-right in world spacetexture(BGE.RendererHelpers.RegionWithId)colors(Array.<integer>, optional, default: "[-1]") — one RGBA tint, or one per corner (blended across the quad)
Returns
integer— columns drawn
drawColumnTextureTo(
target: ifDraw2D,
corners: Array.<BGE.Math.Vector>,
columnTexture: BGE.QuadColumnTexture,
colors?: Array.<integer>,
targetOrigin?: BGE.Math.Vector,
repeatU?: float,
repeatV?: float,
): integer
drawTexturedQuadTo() with an already cut column texture.
Parameters
target(ifDraw2D) — an roBitmap or roScreencorners(Array.<BGE.Math.Vector>) — the texture's top-left, top-right, bottom-left and bottom-right in world spacecolumnTexture(BGE.QuadColumnTexture)colors(Array.<integer>, optional, default: "[-1]") — one RGBA tint, or one per cornertargetOrigin(BGE.Math.Vector, optional, default: "invalid") — for a target smaller than the canvas: where its (0,0) sits on the canvasrepeatU(float, optional, default: "1.0") — times the texture repeats across, rather than stretching (see QuadColumnDrawer.drawTiledTo())repeatV(float, optional, default: "1.0") — times the texture repeats down
Returns
integer— columns drawn
drawTriangleColumnsTo(
target: ifDraw2D,
vertices: Array.<BGE.Math.Vector>,
cuts: BGE.TriangleColumnCuts,
rgba?: integer,
targetOrigin?: BGE.Math.Vector,
): integer
Draws a textured triangle (a model face) as texture strips cut to it, perspective correct, with no scratch bitmaps. Needs a Camera3d.
Parameters
target(ifDraw2D) — an roBitmap or roScreenvertices(Array.<BGE.Math.Vector>) — the triangle's 3 world-space vertices, in the order of the texture pointscutswas made fromcuts(BGE.TriangleColumnCuts)rgba(integer, optional, default: -1) — tinttargetOrigin(BGE.Math.Vector, optional, default: "invalid") — for a target smaller than the canvas: where its (0,0) sits on the canvas
Returns
integer— strips drawn, or -1 if it can't be drawn this way (see QuadColumnDrawer.drawTriangleTo())
drawTriangleColumns(
vertices: Array.<BGE.Math.Vector>,
cuts: BGE.TriangleColumnCuts,
rgba?: integer,
): integer
drawTriangleColumnsTo() on this renderer's canvas.
Parameters
vertices(Array.<BGE.Math.Vector>) — the triangle's 3 world-space verticescuts(BGE.TriangleColumnCuts)rgba(integer, optional, default: -1) — tint
Returns
integer— strips drawn, or -1 if it can't be drawn this way
beginTriangleColumnsTo(
target: ifDraw2D,
targetOrigin: BGE.Math.Vector,
): void
Sets the column drawer's projection for drawing into target, whose (0,0) is at targetOrigin on the canvas (invalid for the canvas), before drawCameraTriangleColumnsTo().
Parameters
target(ifDraw2D)targetOrigin(BGE.Math.Vector)
Returns
void
drawCameraTriangleColumnsTo(
target: ifDraw2D,
cameraVertices: Array.<float>,
cuts: BGE.TriangleColumnCuts,
rgba: integer,
): integer
drawTriangleColumnsTo() for a triangle already in camera space, after beginTriangleColumnsTo() for the same target - for many faces of one model.
Parameters
target(ifDraw2D)cameraVertices(Array.<float>) — 9 floats: x, y, z of each vertex in camera spacecuts(BGE.TriangleColumnCuts)rgba(integer) — tint
Returns
integer— strips drawn, or -1 if it can't be drawn this way
drawColumnTexture(
corners: Array.<BGE.Math.Vector>,
columnTexture: BGE.QuadColumnTexture,
colors?: Array.<integer>,
repeatU?: float,
repeatV?: float,
): integer
Draws a column texture onto a world-space quad on this renderer's canvas (see drawTexturedQuadTo()).
Parameters
corners(Array.<BGE.Math.Vector>) — the texture's top-left, top-right, bottom-left and bottom-right in world spacecolumnTexture(BGE.QuadColumnTexture)colors(Array.<integer>, optional, default: "[-1]") — one RGBA tint, or one per cornerrepeatU(float, optional, default: "1.0") — times the texture repeats acrossrepeatV(float, optional, default: "1.0") — times the texture repeats down
Returns
integer— columns drawn
getWhiteColumnTexture(): BGE.QuadColumnTexture
A shared white texture, tinted to fill solid quads as columns.
Returns
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 edgey(float) — top edgewidth(float)height(float)rgba(integer) — color to stroke withlineWidth(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 tox(float) — left edgey(float) — top edgewidth(float)height(float)rgba(integer) — color to stroke withlineWidth(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 ordercolorRgba(integer) — color to stroke withlineWidth(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 topointsArray(Array.<BGE.Math.Vector>) — points in outline (perimeter) order, not bounds ordercolorRgba(integer) — color to stroke withlineWidth(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: Array.<BGE.Math.Vector>,
x: float,
y: float,
rgba: integer,
allowQuickDraw?: boolean,
bandAcrossY?: dynamic,
): boolean
Parameters
points(Array.<BGE.Math.Vector>)x(float)y(float)rgba(integer)allowQuickDraw(boolean, optional, default: false)bandAcrossY(dynamic, optional, default: "invalid")
Returns
boolean
drawTriangleTo(
canvasDrawTo: ifDraw2d,
points: Array.<BGE.Math.Vector>,
x: float,
y: float,
rgba: integer,
allowQuickDraw?: boolean,
bandAcrossY?: dynamic,
): boolean
Fills a triangle with a flat color, picking the cheapest way to do it well: small triangles are filled with DrawRect bands (see drawTriangleAsSpansTo()), larger ones with drawTriangleExactTo().
Parameters
canvasDrawTo(ifDraw2d)points(Array.<BGE.Math.Vector>) — the triangle's 3 cornersx(float) — offset added to every pointy(float) — offset added to every pointrgba(integer) — fill colorallowQuickDraw(boolean, optional, default: false) — allow a coarser fill (or skipping a tiny triangle) for something that's moving - seegetLossyTriangleFillCount()bandAcrossY(dynamic, optional, default: "invalid") — band direction if banded - pass the same value for triangles sharing an edge (seedrawTriangleAsSpansTo())
Returns
boolean— true if the triangle was drawn (or deliberately skipped)
drawTriangleExactTo(
canvasDrawTo: ifDraw2d,
points: Array.<BGE.Math.Vector>,
x: float,
y: float,
rgba: integer,
): boolean
Fills a triangle with two DrawTransformedObject calls of a shared right-triangle texture - a fixed cost whatever the triangle's size.
Parameters
canvasDrawTo(ifDraw2d)points(Array.<BGE.Math.Vector>) — the triangle's 3 cornersx(float) — offset added to every pointy(float) — offset added to every pointrgba(integer) — fill color
Returns
boolean— true if both draws worked
drawPolygon(
points: Array.<BGE.Math.Vector>,
x: float,
y: float,
rgba: integer,
allowQuickDraw?: boolean,
): boolean
Parameters
points(Array.<BGE.Math.Vector>)x(float)y(float)rgba(integer)allowQuickDraw(boolean, optional, default: false)
Returns
boolean
drawPolygonTo(
canvasDrawTo: ifDraw2d,
points: Array.<BGE.Math.Vector>,
x: float,
y: float,
rgba: integer,
allowQuickDraw?: boolean,
): boolean
Fills the convex hull of points with a flat color the cheapest way it can be done well: DrawRect bands (drawConvexPolygonAsSpansTo()) when the polygon is short enough across its narrower axis for its number of sides, else a fan of triangles (drawPolygonAsTrianglesTo()). See POLYGON_SPAN_BANDS_PER_TRIANGLE.
Parameters
canvasDrawTo(ifDraw2d)points(Array.<BGE.Math.Vector>) — the polygon's corners (any order: their hull is filled)x(float) — offset added to every pointy(float) — offset added to every pointrgba(integer) — fill colorallowQuickDraw(boolean, optional, default: false) — allow a coarser fill (or skipping a tiny polygon) for something that's moving - seegetLossyTriangleFillCount()
Returns
boolean— true if anything was drawn (or deliberately skipped)
drawPolygonAsTrianglesTo(
canvasDrawTo: ifDraw2d,
points: Array.<BGE.Math.Vector>,
x: float,
y: float,
rgba: integer,
allowQuickDraw?: boolean,
): boolean
Fills a convex polygon as a fan of triangles from its first corner, each with drawTriangleTo().
Parameters
canvasDrawTo(ifDraw2d)points(Array.<BGE.Math.Vector>) — the polygon's corners in order around itx(float) — offset added to every pointy(float) — offset added to every pointrgba(integer) — fill colorallowQuickDraw(boolean, optional, default: false) — seedrawTriangleTo()
Returns
boolean— true
drawPolygonAsRectangles(
canvasDrawTo: ifDraw2d,
points: Array.<BGE.Math.Vector>,
x: float,
y: float,
rgba: integer,
options?: LevelOfDetailOptions,
): boolean
Parameters
canvasDrawTo(ifDraw2d)points(Array.<BGE.Math.Vector>)x(float)y(float)rgba(integer)options(LevelOfDetailOptions, optional, default: "{levelOffset: 0, levelOfDetail: 2}")
Returns
boolean
drawPolygonAsRectanglesTo(
canvasDrawTo: ifDraw2d,
points: Array.<BGE.Math.Vector>,
x: float,
y: float,
rgba: integer,
options?: LevelOfDetailOptions,
): boolean
Draw a filled convex polygon with rectangles
Parameters
canvasDrawTo(ifDraw2d)points(Array.<BGE.Math.Vector>)x(float)y(float)rgba(integer)options(LevelOfDetailOptions, optional, default: "{levelOffset: 0, levelOfDetail: 2}")
Returns
boolean
drawTriangleAsSpansTo(
canvasDrawTo: ifDraw2d,
points: Array.<BGE.Math.Vector>,
x: float,
y: float,
rgba: integer,
bandSize?: integer,
bandAcrossY?: dynamic,
): boolean
Fills a triangle with DrawRect bands of bandSize pixels (see drawConvexPolygonAsSpansTo()), banding across whichever axis of its bounding box is shorter (fewest rects) unless bandAcrossY says which. Two triangles sharing an edge (a quad) neither overlap nor leave a seam as long as they band across the same axis - pass the same bandAcrossY for both. Edges come out stepped by up to bandSize pixels.
Parameters
canvasDrawTo(ifDraw2d)points(Array.<BGE.Math.Vector>) — the triangle's 3 cornersx(float) — offset added to every pointy(float) — offset added to every pointrgba(integer) — fill colorbandSize(integer, optional, default: 1) — band thickness in pixelsbandAcrossY(dynamic, optional, default: "invalid") — true for horizontal bands, false for vertical, invalid to pick by the triangle's own shape
Returns
boolean— true if anything was drawn
drawConvexPolygonAsSpansTo(
canvasDrawTo: ifDraw2d,
points: Array.<BGE.Math.Vector>,
x: float,
y: float,
rgba: integer,
bandSize?: integer,
bandAcrossY?: dynamic,
): integer
Fills a convex polygon with one DrawRect per band of bandSize pixels (bands with the same span merge into one rect), banding across whichever axis of its bounding box is shorter unless bandAcrossY says which. Each band's span is the polygon's cross-section at the band's middle, so at 1px it's as accurate as the exact fill; edges come out stepped by up to bandSize pixels. Bands off the canvas are skipped.
Parameters
canvasDrawTo(ifDraw2d)points(Array.<BGE.Math.Vector>) — the polygon's corners in order around it (e.g. fromBGE.QuickHull.QuickHull())x(float) — offset added to every pointy(float) — offset added to every pointrgba(integer) — fill colorbandSize(integer, optional, default: 1) — band thickness in pixelsbandAcrossY(dynamic, optional, default: "invalid") — true for horizontal bands, false for vertical, invalid to pick by the polygon's own shape
Returns
integer— rects drawn
drawConcavePolygon(
points: Array.<BGE.Math.Vector>,
x: float,
y: float,
rgba: integer,
allowQuickDraw?: boolean,
fillRule?: BGE.PolygonFillRule,
): boolean
Parameters
points(Array.<BGE.Math.Vector>)x(float)y(float)rgba(integer)allowQuickDraw(boolean, optional, default: false)fillRule(BGE.PolygonFillRule, optional, default: "BGE.PolygonFillRule.nonZero")
Returns
boolean
drawConcavePolygonTo(
canvasDrawTo: ifDraw2d,
points: Array.<BGE.Math.Vector>,
x: float,
y: float,
rgba: integer,
allowQuickDraw?: boolean,
fillRule?: BGE.PolygonFillRule,
): boolean
Fills points as drawn - concave, or self-intersecting by fillRule - rather than their hull. Points already convex in order go to drawPolygonTo(). Anything else is filled with DrawRect bands (drawPolygonAsSpansTo()): 1px at rest; with allowQuickDraw, coarser past CONCAVE_SPAN_QUICK_MAX_BANDS across, and skipped when tiny (both lossy).
Parameters
canvasDrawTo(ifDraw2d)points(Array.<BGE.Math.Vector>) — the outline's corners in orderx(float) — offset added to every pointy(float) — offset added to every pointrgba(integer) — fill colorallowQuickDraw(boolean, optional, default: false) — allow a coarser fill (or skipping a tiny polygon) for something that's moving - seegetLossyTriangleFillCount()fillRule(BGE.PolygonFillRule, optional, default: "BGE.PolygonFillRule.nonZero") — what's inside a self-intersecting outline
Returns
boolean— true if anything was drawn (or deliberately skipped)
drawPolygonAsSpansTo(
canvasDrawTo: ifDraw2d,
points: Array.<BGE.Math.Vector>,
x: float,
y: float,
rgba: integer,
bandSize?: integer,
bandAcrossY?: dynamic,
fillRule?: BGE.PolygonFillRule,
): integer
Fills any polygon - concave, or self-intersecting by fillRule - with one DrawRect per run of matching band spans (BGE.ScanlinePolygonFill). Spans never overlap, so a translucent fill blends once. At 1px it's accurate; edges come out stepped by up to bandSize pixels. Bands off the canvas are skipped.
Parameters
canvasDrawTo(ifDraw2d)points(Array.<BGE.Math.Vector>) — the outline's corners in orderx(float) — offset added to every pointy(float) — offset added to every pointrgba(integer) — fill colorbandSize(integer, optional, default: 1) — band thickness in pixelsbandAcrossY(dynamic, optional, default: "invalid") — true for horizontal bands, false for vertical, invalid to pick by the polygon's own shapefillRule(BGE.PolygonFillRule, optional, default: "BGE.PolygonFillRule.nonZero") — what's inside a self-intersecting outline
Returns
integer— rects drawn
shouldBandAcrossY(points: Array.<BGE.Math.Vector>): boolean
Whether a set of points is cheaper to band across y (horizontal bands) than across x.
Parameters
points(Array.<BGE.Math.Vector>)
Returns
boolean
drawTriangleAsRaysTo(
canvasDrawTo: ifDraw2d,
points: Array.<BGE.Math.Vector>,
x: float,
y: float,
rgba: integer,
options?: LevelOfDetailOptions,
): boolean
Parameters
canvasDrawTo(ifDraw2d)points(Array.<BGE.Math.Vector>)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: Array.<BGE.Math.Vector>,
size?: integer,
offset?: PositionXY,
drawRegardlessOfDebugValue?: boolean,
): boolean
Parameters
points(Array.<BGE.Math.Vector>)size(integer, optional, default: 5)offset(PositionXY, optional, default: "{x: 0, y: 0}")drawRegardlessOfDebugValue(boolean, optional, default: false)
Returns
boolean
drawTrianglePointsTo(
draw2dRegion: object,
points: Array.<BGE.Math.Vector>,
size?: integer,
offset?: PositionXY,
drawRegardlessOfDebugValue?: boolean,
): boolean
Parameters
draw2dRegion(object)points(Array.<BGE.Math.Vector>)size(integer, optional, default: 5)offset(PositionXY, optional, default: "{x: 0, y: 0}")drawRegardlessOfDebugValue(boolean, optional, default: false)
Returns
boolean
drawTriangleOutline(
pointsArray: Array.<BGE.Math.Vector>,
colorRgba: integer,
offset?: PositionXY,
): boolean
Parameters
pointsArray(Array.<BGE.Math.Vector>)colorRgba(integer)offset(PositionXY, optional, default: "{x: 0, y: 0}")
Returns
boolean
drawTriangleOutlineTo(
draw2d: ifDraw2d,
pointsArray: Array.<BGE.Math.Vector>,
colorRgba: integer,
offset?: PositionXY,
): boolean
Parameters
draw2d(ifDraw2d)pointsArray(Array.<BGE.Math.Vector>)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