Exit Full View

Fizzy / docs / ref / Shape.md

Shape

Shape is the basic building block, and comes in three flavours :

Fields

NameTypeComments
DocumentDocument
Child.fooShapeReplace foo with the name of the child shape. See note below.
FillColorPaint
FlipXBoolean
FlipYBoolean
LineColorPaintAn alias for StrokeColor
LineWidthDimension
LocPinDimension2The position of Pin, relative to THIS shape.
NameString
PagePage
ParentPage or ShapeShapes can be children of other shapes
PinDimension2The Shape's position relative to it's parent
RotationAngle
ScaleVector2
SizeDimension
StrokeColorPaint

Child.foo only finds immediate children (not grandchildren etc). To search for a shape where the name is only known at run-time, use findShape( name ) (see below).

Additional fields of Shape1d and Shape2d (i.e. not ShapeText)

NameTypeComments
CornerRadiusDimensionCauses all joins between LineTos to be rounded.
StrokeCapStrokeCap
StrokeJoinStrokeJoin

Additional fields of Shape1d

NameTypeComments
StartDimension2
EndDimension2
StartAngleAngleSee note below
EndAngleAngleSee note below
LengthDimension
IsStartConnectedBooleanIs the start point connected to another shape
IsEndConnectedBooleanIs the end point connected to another shape

StartAngle and EndAngle are relative to their parent. When not connected to anything, these are usually (End-Start).Angle and (Start-End).Angle. However, when the Shape1d is connected to another shape, then it will give the "preferred" angle of the connection. For ConnectionPoints, this is the angle of the ConnectionPoint. When connecting along the Geometry of another Shape, then it is the normal at that point of the Geometry.

Additional fields of ShapeText

NameTypeComments
TextString
FontSizeDouble
AlignXDouble0=Left 0.5=Center 1=Right
AlignYDouble0=Top 0.5=Middle 1=Bottom
ClipBooleanIs the text clipped to the shape's size?
MarginTopDimension
MarginRightDimension
MarginBottomDimension
MarginLeftDimension
TextSizeDimension2The size of the text, not including any margins

Methods

NameParametersReturn TypeComments
findShapename : StringShapeFinds an ancestor with the given name.
findCustomPropertyname : StringCustomPropertyRarely used
findScratchname : StringScratchRarely used
findControlPointname : StringControlPointRarely used
localToParentDimension2Dimension2Converts local coordinates to those of the parent shape (or page)
localToPageDimension2Dimension2Converts local coordinates to those of the page
parentToLocalDimension2Dimension2Converts coordinates of the parent shape/page to local coordinates of this shape
pageToLocalDimension2Dimension2Converts page coordinates to local coordinates of this shape

Additional methods of Shape1d

NameParametersReturn TypeComments
connectToConnectionPoint,
margin : Dimension2
Dimension2Connects to a ConnectionPoint
connectToShapeshape :Shape,
isStart : Boolean,
margin : Dimension
Dimension2Connects to a Shape (Smart)
connectAlongGeometry,
along : Double,
margin : Dimension
Dimension2Connects along the outline (Geometry of a shape

connectTo, connectToShape and connectAlong are used on the start and end points of a line are connected to another shape. These methods are rarely used manually, but are created by the GUI when dragging line ends.

Additional methods of ShapeText

NameParametersReturn TypeComments
textSizeDimension2The size of text, not including margins.

Sections

Additional sections used by Shape1d and Shape2d :