class Ray extends Curve
A node for drawing an individual line segment.
import ...
export default makeScene2D(function* (view) {
const ray = createRef<Ray>();
view.add(
<Ray
ref={ray}
lineWidth={8}
endArrow
stroke={'lightseagreen'}
fromX={-200}
toX={200}
/>,
);
yield* ray().start(1, 1);
yield* ray().start(0).end(0).start(1, 1);
});
Constructors
constructor
Parameters
props: RayProps
Curve.constructorProperties
absolutePosition
readonly public absolutePosition: SimpleVector2SignalRay
A helper signal for operating on the position in world space.
Retrieving the position using this signal returns the position in world space. Similarly, setting the position using this signal transforms the new value to local space.
If the new value is a function, the position of this node will be continuously updated to always match the position returned by the function. This can be useful to "pin" the node in a specific place or to make it follow another node's position.
Unlike position, this signal is not compound - it doesn't contain
separate signals for the x and y components.
Curve.absolutePositionabsoluteRotation
readonly public absoluteRotation: SimpleSignalnumberRay
A helper signal for operating on the rotation in world space.
Retrieving the rotation using this signal returns the rotation in world space. Similarly, setting the rotation using this signal transforms the new value to local space.
If the new value is a function, the rotation of this node will be continuously updated to always match the rotation returned by the function.
Inherited fromCurve.absoluteRotationabsoluteScale
readonly public absoluteScale: SimpleVector2SignalRay
A helper signal for operating on the scale in world space.
Retrieving the scale using this signal returns the scale in world space. Similarly, setting the scale using this signal transforms the new value to local space.
If the new value is a function, the scale of this node will be continuously updated to always match the position returned by the function.
Unlike scale, this signal is not compound - it doesn't contain
separate signals for the x and y components.
Curve.absoluteScalealignContent
readonly public alignContent: SimpleSignalFlexContentRay
Curve.alignContentalignItems
readonly public alignItems: SimpleSignalFlexItemsRay
Curve.alignItemsalignSelf
readonly public alignSelf: SimpleSignalFlexItemsRay
Curve.alignSelfantialiased
readonly public antialiased: SimpleSignalbooleanRay
Curve.antialiasedarrowSize
readonly public arrowSize: SimpleSignalnumberRay
Controls the size of the end and start arrows.
To make the arrows visible make sure to enable startArrow and/or
endArrow.
Curve.arrowSizebasis
readonly public basis: SimpleSignalFlexBasisRay
Curve.basisbottom
readonly public bottom: SimpleVector2SignalRay
The position of the bottom edge of this node.
When set, this shortcut property will modify the node's position so that the bottom edge ends up in the given place.
When retrieved, it will return the position of the bottom edge in the parent space.
Inherited fromCurve.bottombottomLeft
readonly public bottomLeft: SimpleVector2SignalRay
The position of the bottom left corner of this node.
When set, this shortcut property will modify the node's position so that the bottom left corner ends up in the given place.
When retrieved, it will return the position of the bottom left corner in the parent space.
Inherited fromCurve.bottomLeftbottomRight
readonly public bottomRight: SimpleVector2SignalRay
The position of the bottom right corner of this node.
When set, this shortcut property will modify the node's position so that the bottom right corner ends up in the given place.
When retrieved, it will return the position of the bottom right corner in the parent space.
Inherited fromCurve.bottomRightcache
readonly public cache: SimpleSignalbooleanRay
Curve.cachecachePadding
readonly public cachePadding: SpacingSignalRay
Controls the padding of the cached canvas used by this node.
By default, the size of the cache is determined based on the bounding box
of the node and its children. That includes effects such as stroke or
shadow. This property can be used to expand the cache area further.
Usually used to account for custom effects created by shaders.
Curve.cachePaddingchildren
readonly public children: SignalComponentChildrenNode[]RaySignalContextComponentChildrenNode[]Ray
Curve.childrenclip
readonly public clip: SimpleSignalbooleanRay
Curve.clipclosed
readonly public closed: SimpleSignalbooleanRay
Whether the curve should be closed.
Closed curves have their start and end points connected.
Inherited fromCurve.closedcomposite
readonly public composite: SimpleSignalbooleanRay
Curve.compositecompositeOperation
readonly public compositeOperation: SimpleSignalGlobalCompositeOperationRay
Curve.compositeOperationcreationStack
readonly public creationStack?: string
Curve.creationStackdirection
readonly public direction: SimpleSignalFlexDirectionRay
Curve.directionelement
public element: HTMLElement
Curve.elementend
readonly public end: SimpleSignalnumberRay
A percentage from the start after which the curve should be clipped.
The portion of the curve that comes after the given percentage will be made invisible.
This property is usefully for animating the curve appearing on the screen.
The value of 0 means the very start of the curve (accounting for the
startOffset) while 1 means the very end (accounting for the
endOffset).
Curve.endendArrow
readonly public endArrow: SimpleSignalbooleanRay
Whether to display an arrow at the end of the visible curve.
Use arrowSize to control the size of the arrow.
Curve.endArrowendOffset
readonly public endOffset: SimpleSignalnumberRay
The offset in pixels from the end of the curve.
This property lets you specify where along the defined curve the actual
visible portion ends. For example, setting it to 20 will make the last
20 pixels of the curve invisible.
This property is useful for trimming the curve using a fixed distance.
If you want to animate the curve appearing on the screen, use end
instead.
Curve.endOffsetfill
readonly public fill: CanvasStyleSignalRay
Curve.fillfilters
readonly public filters: FiltersSignalRay
Curve.filtersfontFamily
readonly public fontFamily: SimpleSignalstringRay
Curve.fontFamilyfontSize
readonly public fontSize: SimpleSignalnumberRay
Curve.fontSizefontStyle
readonly public fontStyle: SimpleSignalstringRay
Curve.fontStylefontWeight
readonly public fontWeight: SimpleSignalnumberRay
Curve.fontWeightfrom
readonly public from: Vector2SignalRay
The starting point of the ray.
gap
readonly public gap: Vector2LengthSignalRay
Curve.gapgrow
readonly public grow: SimpleSignalnumberRay
Curve.growisClass
public isClass: boolean
Curve.isClassjustifyContent
readonly public justifyContent: SimpleSignalFlexContentRay
Curve.justifyContentkey
readonly public key: string
Curve.keylayout
readonly public layout: SimpleSignalLayoutModeRay
Curve.layoutleft
readonly public left: SimpleVector2SignalRay
The position of the left edge of this node.
When set, this shortcut property will modify the node's position so that the left edge ends up in the given place.
When retrieved, it will return the position of the left edge in the parent space.
Inherited fromCurve.leftletterSpacing
readonly public letterSpacing: SimpleSignalnumberRay
Curve.letterSpacinglineCap
readonly public lineCap: SimpleSignalCanvasLineCapRay
Curve.lineCaplineDash
readonly public lineDash: SimpleSignalnumber[]Ray
Curve.lineDashlineDashOffset
readonly public lineDashOffset: SimpleSignalnumberRay
Curve.lineDashOffsetlineHeight
readonly public lineHeight: SimpleSignalLengthRay
Curve.lineHeightlineJoin
readonly public lineJoin: SimpleSignalCanvasLineJoinRay
Curve.lineJoinlineWidth
readonly public lineWidth: SimpleSignalnumberRay
Curve.lineWidthmargin
readonly public margin: SpacingSignalRay
Curve.marginmaxHeight
readonly public maxHeight: SimpleSignalLengthLimitRay
Curve.maxHeightmaxWidth
readonly public maxWidth: SimpleSignalLengthLimitRay
Curve.maxWidthmiddle
readonly public middle: SimpleVector2SignalRay
The position of the center of this node.
When set, this shortcut property will modify the node's position so that the center ends up in the given place.
If the offset has not been changed, this will be the same as the
position.
When retrieved, it will return the position of the center in the parent space.
Inherited fromCurve.middleminHeight
readonly public minHeight: SimpleSignalLengthLimitRay
Curve.minHeightminWidth
readonly public minWidth: SimpleSignalLengthLimitRay
Curve.minWidthoffset
readonly public offset: Vector2SignalRay
Represents the offset of this node's origin.
By default, the origin of a node is located at its center. The origin serves as the pivot point when rotating and scaling a node, but it doesn't affect the placement of its children.
The value is relative to the size of this node. A value of 1 means as far
to the right/bottom as possible. Here are a few examples of offsets:
[-1, -1]- top left corner[1, -1]- top right corner[0, 1]- bottom edge[-1, 1]- bottom left corner
Curve.offsetopacity
readonly public opacity: SimpleSignalnumberRay
Represents the opacity of this node in the range 0-1.
The value is clamped to the range 0-1.
Inherited fromCurve.opacitypadding
readonly public padding: SpacingSignalRay
Curve.paddingparent
readonly public parent: SimpleSignalnullNodevoid = ...
Curve.parentposition
readonly public position: Vector2SignalRay
Represents the position of this node in local space of its parent.
Examples
Inherited fromCurve.positionproperties
readonly public properties: RecordstringPropertyMetadataany = ...
Curve.propertiesratio
readonly public ratio: SimpleSignalnullnumberRay
Curve.ratioright
readonly public right: SimpleVector2SignalRay
The position of the right edge of this node.
When set, this shortcut property will modify the node's position so that the right edge ends up in the given place.
When retrieved, it will return the position of the right edge in the parent space.
Inherited fromCurve.rightrotation
readonly public rotation: SimpleSignalnumberRay
Represents the rotation (in degrees) of this node relative to its parent.
Inherited fromCurve.rotationscale
readonly public scale: Vector2SignalRay
Represents the scale of this node in local space of its parent.
Examples
Inherited fromCurve.scale