geom

GeomDisc2DGeom.Nodes.Disc2D

Inherits: Node2D

C#: make one with the Geom.Nodes.Disc2D() factory, then set and read its properties by name with Set and Get, or in the Inspector, where the node is GeomDisc2D.

A disc, pie, ring or arc placed on the canvas.

From code

The code used to generate this page's thumbnail.

var disc := GeomDisc2D.new()
disc.position = c
disc.radius = r
disc.color = EMBER
add_child(disc)
var disc = Geom.Nodes.Disc2D();
disc.Position = c;
disc.Set("radius", r);
disc.Set("color", EMBER);
AddChild(disc);

Properties

float angle_end_degrees 270.0
float angle_start_degrees 0.0
bool arc_end_cap_round false
BlendMode blend_mode Geom.BLEND_TRANSPARENTGeom.BlendMode.Transparent
Color color Color(1, 1, 1, 1)
GeomDash dash null
DiscType disc_type Geom.DISC_DISCGeom.DiscType.Disc
Resource fill null
float radius 64.0
ThicknessSpace radius_space Geom.SPACE_WORLDGeom.ThicknessSpace.World
float thickness 8.0
ThicknessSpace thickness_space Geom.SPACE_WORLDGeom.ThicknessSpace.World

Enumerations

enum Geom.ThicknessSpace

Geom.SPACE_WORLDGeom.ThicknessSpace.World = 0
World units, the same as a node's position.
Geom.SPACE_VIEWPORT_PIXELSGeom.ThicknessSpace.ViewportPixels = 1
The viewport's pixels. Constant size on screen at any zoom.
Geom.SPACE_VIEWPORT_PERCENTGeom.ThicknessSpace.ViewportPercent = 2
Percent of the viewport's shorter side. Like CSS vmin.

enum Geom.BlendMode

Geom.BLEND_OPAQUEGeom.BlendMode.Opaque = 0
Sorts by position. Hard edges: no anti-aliasing, and alpha is ignored.
Geom.BLEND_TRANSPARENTGeom.BlendMode.Transparent = 1
Standard alpha blending. The default.
Geom.BLEND_ADDITIVEGeom.BlendMode.Additive = 2
Adds this color to what is behind.
Geom.BLEND_MULTIPLYGeom.BlendMode.Multiply = 3
Multiplies what is behind by this color.
Geom.BLEND_SUBTRACTGeom.BlendMode.Subtract = 4
Subtracts this color from the background.
Geom.BLEND_TRANSPARENT_DEPTHGeom.BlendMode.TransparentDepth = 5
Transparent, but writes depth, so shapes with alpha 1 sort by position with anti-aliased edges. A translucent color behaves like Transparent.

enum Geom.DiscType

Geom.DISC_DISCGeom.DiscType.Disc = 0
Filled circle.
Geom.DISC_PIEGeom.DiscType.Pie = 1
Filled circular sector, bounded by the start and end angle.
Geom.DISC_RINGGeom.DiscType.Ring = 2
Hollow ring. radius is to the middle of the wall.
Geom.DISC_ARCGeom.DiscType.Arc = 3
A section of a ring, bounded by the start and end angle.

Property descriptions

float angle_end_degrees = 270.0

Where a Pie or Arc ends. The sweep runs forward from the start and wraps, so 350 to 10 is a 20 degree arc.

float angle_start_degrees = 0.0

Where a Pie or Arc starts, in degrees counterclockwise from +X.

bool arc_end_cap_round = false

Round off an Arc's ends.

BlendMode blend_mode = Geom.BLEND_TRANSPARENTGeom.BlendMode.Transparent

How the shape blends with what is behind it. Transparent Depth acts like Transparent on the canvas.

Color color = Color(1, 1, 1, 1)

Fill color, or the outline's color when border is set.

GeomDash dash = null

A dash pattern.

DiscType disc_type = Geom.DISC_DISCGeom.DiscType.Disc

Disc, Pie, Ring or Arc.

Resource fill = null

A gradient in place of color. Takes GeomFillRadial, GeomFillAngular, GeomFillLinear or GeomFillCorners.

float radius = 64.0

Center to edge. For Ring and Arc, center to the middle of the wall.

ThicknessSpace radius_space = Geom.SPACE_WORLDGeom.ThicknessSpace.World

How radius is measured.

float thickness = 8.0

Wall thickness for Ring and Arc.

ThicknessSpace thickness_space = Geom.SPACE_WORLDGeom.ThicknessSpace.World

How thickness is measured.