Realot StudioDocs
Components

ShapeRenderer

Realot Studio ShapeRenderer component reference: fields, script API, behavior and examples.

View as Markdownllms.txt
ScopeThis page documents the ShapeRenderer component in Realot Studio. Runtime fields are serialized scene data; the Script API section lists only members intentionally exposed to game scripts.
Where to find it in the editorCreate directly from top GameObject → Shape → Square/Circle/Capsule/Triangle, or Inspector → Add Component → Shape Renderer.

#What it does

Draw a procedural 2D shape without requiring a sprite asset.

Component setup & editor toolsUse ShapeRenderer when you want a procedural shape without importing an image.

#How to add and use ShapeRenderer

Editor path: Select the target entity in the Hierarchy (left side) → look at the Inspector (right side) → click Add Component at the bottom of the Inspector → search for ShapeRenderer → click the component row. The Add Component picker is a centered modal with a search box; it only lists components not already attached.

For components with a dedicated editor tool, the tool is opened or activated from the location described below. Do not assume that adding the component alone activates its editor; some systems require a separate window, panel, or viewport tool.

#Component setup & editor tools

  • Inspector → ShapeRenderer: choose the shape type and edit its dimensions. For triangle/freeform shapes, the corresponding viewport gizmo is used when available.

#What you should see after adding it

The component appears as its own section in the Inspector. Its serialized settings are listed in the Component data table below. If a field is conditional, it appears only when the relevant mode/type is selected. If a field is a runtime state field (for example grounded or resolved velocity), treat it as read-only diagnostic state unless the API reference explicitly documents it as writable.

#How to read the settings

For every setting below, the documentation distinguishes type, default, meaning, and tuning direction where behavior is known. When a value represents a direction, use the engine's coordinate convention documented in Coordinate system; do not substitute Unity/Godot conventions.

#Component data

FieldTypePurposeDefault
shapeTypeShapeType enum: Square | Circle | Triangle | CapsuleSquare, Circle, Triangle or Capsule.Square
widthnumberSquare100
heightnumberSquare height.100
radiusnumberCircle50
capsuleHalfHeightnumberCapsule: a "stadium" shape (rectangle with semicircle caps), same halfHeight/radius convention as Collider2D's capsule so the two stay easy to eyeball-match if a user wants a visual capsule over a capsule collider.50
capsuleRadiusnumberCapsule cap radius.30
trianglePointsarrayTriangle: 3 points in the entity's LOCAL space (same space Collider2D.trianglePoints uses), user-editable via draggable gizmo handles in the Scene view.[{x:-50,y:50}, {x:50,y:50}, {x:0,y:-50}]
fillColorhex color stringFill color.#3a8ede
visualRotationnumberVisual-only rotation in degrees, added to Transform.rotation when drawing.0
opacitynumberOpacity.1
outlineEnabledbooleanEnable outline.false
outlineColorhex color stringOutline color.#ffffff
outlineWidthnumberOutline width.2

#Script API

MemberKindDescription
capsuleHalfHeightProperty (read/write)The `this.shape` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
capsuleRadiusProperty (read/write)The `this.shape` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
fillColorProperty (read/write)The `this.shape` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
heightProperty (read/write)The `this.shape` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
opacityProperty (read/write)The `this.shape` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
outlineColorProperty (read/write)The `this.shape` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
outlineEnabledProperty (read/write)The `this.shape` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
outlineWidthProperty (read/write)The `this.shape` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
radiusProperty (read/write)The `this.shape` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
shapeTypeProperty (read/write)The `this.shape` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
visualRotationProperty (read/write)The `this.shape` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
widthProperty (read/write)The `this.shape` sub-object exposed to user scripts (see scripting/ScriptAPI.js).

#Examples

js
this.shape.fillColor = "#22c55e";
js
this.shape.shapeType = "Circle";
js
this.shape.radius = 32;
Need the full workflow?Components: complete workflow covers adding, configuring, testing, combining, and removing components.