class Grid extends Shape
A node for drawing a two-dimensional grid.
import ...
export default makeScene2D(function* (view) {
const grid = createRef<Grid>();
view.add(
<Grid
ref={grid}
width={'100%'}
height={'100%'}
stroke={'#666'}
start={0}
end={1}
/>,
);
yield* all(
grid().end(0.5, 1).to(1, 1).wait(1),
grid().start(0.5, 1).to(0, 1).wait(1),
);
});
Constructors
constructor
Parameters
props: GridProps
Shape.constructorProperties
absolutePosition
readonly public absolutePosition: SimpleVector2SignalGrid
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.
Shape.absolutePositionabsoluteRotation
readonly public absoluteRotation: SimpleSignalnumberGrid
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 fromShape.absoluteRotationabsoluteScale
readonly public absoluteScale: SimpleVector2SignalGrid
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.
Shape.absoluteScalealignContent
readonly public alignContent: SimpleSignalFlexContentGrid
Shape.alignContentalignItems
readonly public alignItems: SimpleSignalFlexItemsGrid
Shape.alignItemsalignSelf
readonly public alignSelf: SimpleSignalFlexItemsGrid
Shape.alignSelfantialiased
readonly public antialiased: SimpleSignalbooleanGrid
Shape.antialiasedbasis
readonly public basis: SimpleSignalFlexBasisGrid
Shape.basisbottom
readonly public bottom: SimpleVector2SignalGrid
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 fromShape.bottombottomLeft
readonly public bottomLeft: SimpleVector2SignalGrid
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 fromShape.bottomLeftbottomRight
readonly public bottomRight: SimpleVector2SignalGrid
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 fromShape.bottomRightcache
readonly public cache: SimpleSignalbooleanGrid
Shape.cache