geom

GeomQuad2DGeom.Nodes.Quad2D

Inherits: Node2D

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

A quad through four points on the canvas, in order.

From code

The code used to generate this page's thumbnail.

# A quad's corners go where you put them.
var quad := GeomQuad2D.new()
quad.position = c
quad.point_a = Vector2(-r * 0.95, -r * 0.55)
quad.point_b = Vector2(r, -r * 0.85)
quad.point_c = Vector2(r * 0.8, r * 0.8)
quad.point_d = Vector2(-r * 0.7, r * 0.5)
quad.color = EMBER
add_child(quad)
// A quad's corners go where you put them.
var quad = Geom.Nodes.Quad2D();
quad.Position = c;
quad.Set("point_a", new Vector2(-r * 0.95f, -r * 0.55f));
quad.Set("point_b", new Vector2(r, -r * 0.85f));
quad.Set("point_c", new Vector2(r * 0.8f, r * 0.8f));
quad.Set("point_d", new Vector2(-r * 0.7f, r * 0.5f));
quad.Set("color", EMBER);
AddChild(quad);

Properties

BlendMode blend_mode Geom.BLEND_TRANSPARENTGeom.BlendMode.Transparent
bool border false
Color color Color(1, 1, 1, 1)
Resource fill null
Vector2 point_a Vector2(-90, -55)
Vector2 point_b Vector2(90, -55)
Vector2 point_c Vector2(90, 55)
Vector2 point_d Vector2(-90, 55)
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.

Property descriptions

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.

bool border = false

Draw an outline of thickness instead of a fill.

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

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

Resource fill = null

A gradient in place of color. Takes GeomFillLinear or GeomFillCorners.

Vector2 point_a = Vector2(-90, -55)

First corner.

Vector2 point_b = Vector2(90, -55)

Second corner.

Vector2 point_c = Vector2(90, 55)

Third corner.

Vector2 point_d = Vector2(-90, 55)

Fourth corner.

float thickness = 8.0

Outline thickness. Used only when border is set.

ThicknessSpace thickness_space = Geom.SPACE_WORLDGeom.ThicknessSpace.World

How thickness is measured.