DrawableCircle

Extends: Drawable

Draws a filled circle via the renderer's shared circle texture (see Renderer.getCircleResource()), with an optional outline stroked as a regular polygon inscribed in the circle's own quad - see SceneObjectCircle.

Like DrawableRectangle, the circle's top left (of its bounding square) sits at the drawable's own world position, extending radius * 2 right and down - so it anchors and composes with the rest of the engine the same way every other drawable does. In the oriented/solid/wireFrame 3D draw modes it foreshortens into an ellipse when viewed at an angle, the same as any other billboard (see DrawableSphere for a circle that never does this).

Properties

  • radius (float)
  • outlineSegments (integer) — Regular-polygon segment count used only for the outline - the fill is a texture ' blit, not a polygon, so this has no effect on fill smoothness.

Constructor

new DrawableCircle( owner: GameEntity, radius: float, args?: roAssociativeArray, ): DrawableCircle

Parameters

  • owner (GameEntity)
  • radius (float)
  • args (roAssociativeArray, optional, default: "{}")

Instance Methods

setRadius(radius: float): void

Resizes the circle. Use this rather than assigning to radius directly - a resize isn't movement, so it has to tell the renderer to recompute this drawable's geometry (see Drawable.invalidateGeometry).

Parameters

  • radius (float) — new radius in world units

Returns

  • void

addToScene(rendererObj: Renderer): BGE.SceneObject

Parameters

Returns