geom

GeomDashGeom.Resources.Dash

Inherits: Resource

C#: Properties are not wrapped. use Set and Get with the names below. The class itself is registered as GeomDash in Godot.

Dash settings for a shape's dash slot.

From code

The code used to generate this page's thumbnail.

var dash := GeomDash.new()
dash.space = Geom.DASH_FIXED_COUNT
dash.size = 11.0
dash.spacing = 0.45
var ring := GeomDisc2D.new()
ring.position = c
ring.radius = r
ring.disc_type = Geom.DISC_RING
ring.thickness = vp.y * 0.075
ring.color = AMBER
ring.dash = dash
add_child(ring)
var dash = Geom.Resources.Dash();
dash.Set("space", (int)Geom.DashSpace.FixedCount);
dash.Set("size", 11.0f);
dash.Set("spacing", 0.45f);
var ring = Geom.Nodes.Disc2D();
ring.Position = c;
ring.Set("radius", r);
ring.Set("disc_type", (int)Geom.DiscType.Ring);
ring.Set("thickness", vp.Y * 0.075f);
ring.Set("color", AMBER);
ring.Set("dash", dash);
AddChild(ring);

Properties

DashType dash_type Geom.DASH_BASICGeom.DashType.Basic
float modifier 0.0
float offset 0.0
float size 1.0
DashSnap snap Geom.SNAP_TILINGGeom.DashSnap.Tiling
DashSpace space Geom.DASH_RELATIVEGeom.DashSpace.Relative
float spacing 1.0

Enumerations

enum Geom.DashSpace

Geom.DASH_WORLDGeom.DashSpace.World = 0
Dash size and spacing are lengths in world units.
Geom.DASH_RELATIVEGeom.DashSpace.Relative = 1
Dash size and spacing are multiples of the thickness.
Geom.DASH_FIXED_COUNTGeom.DashSpace.FixedCount = 2
Dash size is a number of dashes. Spacing is the gap relative to the dash.

enum Geom.DashSnap

Geom.SNAP_OFFGeom.DashSnap.Off = 0
The pattern is cut wherever the shape ends.
Geom.SNAP_TILINGGeom.DashSnap.Tiling = 1
A whole number of dashes around the shape, so the pattern has no seam.
Geom.SNAP_END_TO_ENDGeom.DashSnap.EndToEnd = 2
A whole dash at each end of a line or arc.

enum Geom.DashType

Geom.DASH_BASICGeom.DashType.Basic = 0
Square dash ends.
Geom.DASH_ANGLEDGeom.DashType.Angled = 1
Dash ends sheared into a parallelogram by dash_modifier on GeomDraw or modifier on GeomDash. At 0 it looks like DASH_BASIC.
Geom.DASH_ROUNDEDGeom.DashType.Rounded = 2
Rounded dash ends.

Property descriptions

DashType dash_type = Geom.DASH_BASICGeom.DashType.Basic

Dash shape: Basic, Angled or Rounded.

float modifier = 0.0

Shear for angled dashes, -1 to 1. At 0, Angled looks like Basic.

float offset = 0.0

Shifts the pattern along the shape, as a fraction of one dash and gap.

float size = 1.0

Length of one dash, measured as per space.

DashSnap snap = Geom.SNAP_TILINGGeom.DashSnap.Tiling

Whether the pattern is stretched to fit the shape. Tiling fits a whole number of dashes around a closed shape, so it has no seam. End To End puts a whole dash at each end.

DashSpace space = Geom.DASH_RELATIVEGeom.DashSpace.Relative

What size and spacing are measured in: World, Relative as multiples of the thickness, or Fixed Count. Defaults to Relative.

float spacing = 1.0

Gap between dashes, measured like size. Equal size and spacing give equal dash and gap in every space.