class CubicBezier extends Bezier
A node for drawing a cubic Bézier curve.
import ...
export default makeScene2D(function* (view) {
const bezier = createRef<CubicBezier>();
view.add(
<CubicBezier
ref={bezier}
lineWidth={4}
stroke={'lightseagreen'}
p0={[-200, -100]}
p1={[100, -100]}
p2={[-100, 100]}
p3={[200, 100]}
end={0}
/>
);
yield* bezier().end(1, 1);
yield* bezier().start(1, 1).to(0, 1);
});
Constructors
constructor
Parameters
props: CubicBezierProps
Bezier.constructorProperties
absolutePosition
readonly public absolutePosition: SimpleVector2SignalCubicBezier
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.
Bezier.absolutePositionabsoluteRotation
readonly public absoluteRotation: SimpleSignalnumberCubicBezier
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 fromBezier.absoluteRotationabsoluteScale
readonly public absoluteScale: SimpleVector2SignalCubicBezier
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.
Bezier.absoluteScalealignContent
readonly public alignContent: SimpleSignalFlexContentCubicBezier
Bezier.alignContentalignItems
readonly public alignItems: SimpleSignalFlexItemsCubicBezier
Bezier.alignItemsalignSelf
readonly public alignSelf: SimpleSignalFlexItemsCubicBezier
Bezier.alignSelfantialiased
readonly public antialiased: SimpleSignalbooleanCubicBezier
Bezier.antialiasedarrowSize
readonly public arrowSize: SimpleSignalnumberCubicBezier
Controls the size of the end and start arrows.
To make the arrows visible make sure to enable startArrow and/or
endArrow.
Bezier.arrowSizebasis
readonly public basis: SimpleSignalFlexBasisCubicBezier
Bezier.basisbottom
readonly public bottom: SimpleVector2SignalCubicBezier
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 fromBezier.bottombottomLeft
readonly public bottomLeft: SimpleVector2SignalCubicBezier
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 fromBezier.bottomLeftbottomRight
readonly public bottomRight: SimpleVector2SignalCubicBezier
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 fromBezier.bottomRightcache
readonly public cache: SimpleSignalbooleanCubicBezier
Bezier.cachecachePadding
readonly public cachePadding: SpacingSignalCubicBezier
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.
Bezier.cachePaddingchildren
readonly public children: SignalComponentChildrenNode[]CubicBezierSignalContextComponentChildrenNode[]CubicBezier
Bezier.childrenclip
readonly public clip: SimpleSignalbooleanCubicBezier
Bezier.clipclosed
readonly public closed: SimpleSignalbooleanCubicBezier
Whether the curve should be closed.
Closed curves have their start and end points connected.
Inherited fromBezier.closedcomposite
readonly public composite: SimpleSignalbooleanCubicBezier
Bezier.compositecompositeOperation
readonly public compositeOperation: SimpleSignalGlobalCompositeOperationCubicBezier
Bezier.compositeOperation