circle
Canonical ID: graphics.circle. Nederlands: cirkel.
Draws a filled circle centered at x,y. Radius is measured in logical pixels and must be strictly positive. The call adds drawing to the current frame; it does not clear earlier shapes or return a sprite or collision object. Use the 3D sphere API for a world-space sphere.
Signature
circle(x, y, radius, color)
Arguments
| Parameter | Type | Requirement |
|---|---|---|
x |
Number | Finite horizontal coordinate in logical pixels. |
y |
Number | Finite vertical coordinate in logical pixels. |
radius |
Number | Finite and greater than 0. |
color |
Text | Nonempty; use portable English/Dutch names or #RGB/#RRGGBB. |
Return value
None.
Example
# language: en
clearCanvas("white")
circle(200, 180, 30, "red")
circle(400, 180, 60, "blauw")
Two circles with different centers and radii.
Notes and common mistakes
Use the function name for your source language. Its canonical ID is a shared documentation label; you do not type that ID as a call. Giving your own variable or function the same name can hide the built-in. Supply the documented arguments and value types. Pliro reports mismatches when checking can detect them, or when the call runs.
A host is the app or environment running your program. To see a drawing, it needs a renderer, the part that draws on screen. The command-line command pliro run shows text but does not draw these graphics. The host support table explains which effects work in the IDE, browser, native app, and phone preview. A native build reports an unsupported capability instead of leaving it out.
2D uses a 640 × 360 scene with a top-left origin, +X right and +Y down. Both English and Dutch portable color names work in either syntax locale, as do #RGB and #RRGGBB. Other nonempty 2D color text is host-dependent.
Related entries
clearCanvas · rectangle · drawLine · drawText · Programming guides · Host support · Calls and arguments
