CompositionDrawer

class CompositionDrawer(documentBounds: CompositionDimensions = defaultCompositionDimensions, composition: Composition? = null, cursor: GroupNode? = composition?.root as? GroupNode)(source)

A Drawer-like interface for the creation of Compositions This should be easier than creating Compositions manually

Constructors

Link copied to clipboard
constructor(documentBounds: CompositionDimensions = defaultCompositionDimensions, composition: Composition? = null, cursor: GroupNode? = composition?.root as? GroupNode)

Functions

Link copied to clipboard
fun circle(circle: Circle, closed: Boolean = true, insert: Boolean = true): ShapeNode?
fun circle(position: Vector2, radius: Double, closed: Boolean = true, insert: Boolean = true): ShapeNode?
fun circle(x: Double, y: Double, radius: Double, closed: Boolean = true, insert: Boolean = true): ShapeNode?
Link copied to clipboard
fun circles(circles: List<Circle>, insert: Boolean = true): List<ShapeNode?>
fun circles(positions: List<Vector2>, radius: Double, insert: Boolean = true): List<ShapeNode?>
fun circles(positions: List<Vector2>, radii: List<Double>, insert: Boolean = true): List<ShapeNode?>
Link copied to clipboard
Link copied to clipboard
fun contour(contour: ShapeContour, insert: Boolean = true): ShapeNode?
Link copied to clipboard
fun contours(contours: List<ShapeContour>, insert: Boolean = true): List<ShapeNode?>
Link copied to clipboard
fun difference(shape: Shape, searchFrom: CompositionNode = composition.root as GroupNode): Shape
Link copied to clipboard
fun distances(point: Vector2, searchFrom: CompositionNode = composition.root as GroupNode): List<ShapeNodeNearestContour>

Find distances to each contour in the composition tree (or starting node)

Link copied to clipboard
Link copied to clipboard

Returns a deep copy of a CompositionNode. If insert is true the copy is inserted at cursor.

Link copied to clipboard
fun group(insert: Boolean = true, id: String? = null, builder: CompositionDrawer.() -> Unit): GroupNode

Create a group node and run builder inside its context

Link copied to clipboard
fun image(image: ColorBuffer, x: Double = 0.0, y: Double = 0.0, insert: Boolean = true): ImageNode

Adds an image to the composition tree

Link copied to clipboard
fun intersections(shape: Shape, searchFrom: CompositionNode = composition.root as GroupNode, mergeThreshold: Double = 0.5): List<ShapeNodeIntersection>

Test a given shape against org.openrndr.shape.contours in the composition tree

fun intersections(contour: ShapeContour, searchFrom: CompositionNode = composition.root as GroupNode, mergeThreshold: Double = 0.5): List<ShapeNodeIntersection>

Test a given contour against org.openrndr.shape.contours in the composition tree

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun lineLoop(points: List<Vector2>, insert: Boolean = true): ShapeNode?
Link copied to clipboard
fun lineSegment(lineSegment: LineSegment, insert: Boolean = true): ShapeNode?
fun lineSegment(start: Vector2, end: Vector2, insert: Boolean = true): ShapeNode?
fun lineSegment(startX: Double, startY: Double, endX: Double, endY: Double, insert: Boolean = true): ShapeNode?
Link copied to clipboard
fun lineSegments(lineSegments: List<LineSegment>, insert: Boolean = true): List<ShapeNode?>
Link copied to clipboard
fun lineStrip(points: List<Vector2>, insert: Boolean = true): ShapeNode?
Link copied to clipboard
fun nearest(point: Vector2, searchFrom: CompositionNode = composition.root as GroupNode): ShapeNodeNearestContour?

Search for a point on a contour in the composition tree that's nearest to point

Link copied to clipboard
Link copied to clipboard
fun popModel()
Link copied to clipboard
fun popStyle()
Link copied to clipboard
fun pushModel()
Link copied to clipboard
fun pushStyle()
Link copied to clipboard
fun rectangle(rectangle: Rectangle, closed: Boolean = true, insert: Boolean = true): ShapeNode?
fun rectangle(x: Double, y: Double, width: Double, height: Double, closed: Boolean = true, insert: Boolean = true): ShapeNode?
Link copied to clipboard
fun rectangles(rectangles: List<Rectangle>, insert: Boolean = true): List<ShapeNode?>
fun rectangles(positions: List<Vector2>, dimensions: List<Vector2>, insert: Boolean): List<ShapeNode?>
fun rectangles(positions: List<Vector2>, width: Double, height: Double, insert: Boolean = true): List<ShapeNode?>
Link copied to clipboard
fun rotate(rotationInDegrees: Double)
Link copied to clipboard
fun CompositionNode.rotate(angleInDegrees: Double, pivot: Vector2 = Vector2.ZERO)
Link copied to clipboard
fun scale(s: Double)
fun scale(x: Double, y: Double)
Link copied to clipboard
fun CompositionNode.scale(scale: Double, pivot: Vector2 = Vector2.ZERO)
Link copied to clipboard
fun segment(segment: Segment, insert: Boolean = true): ShapeNode?
fun segment(start: Vector2, end: Vector2, insert: Boolean = true): ShapeNode?
fun segment(start: Vector2, c0: Vector2, end: Vector2, insert: Boolean = true): ShapeNode?
fun segment(start: Vector2, c0: Vector2, c1: Vector2, end: Vector2, insert: Boolean = true): ShapeNode?
Link copied to clipboard
fun segments(segments: List<Segment>, insert: Boolean = true): List<ShapeNode?>
Link copied to clipboard
fun shape(shape: Shape, insert: Boolean = true): ShapeNode?
Link copied to clipboard
fun shapes(shapes: List<Shape>, insert: Boolean = true): List<ShapeNode?>
Link copied to clipboard
fun text(text: String, position: Vector2, insert: Boolean = true): TextNode
Link copied to clipboard
fun textOnContour(text: String, contour: ShapeContour, insert: Boolean = true): TextNode
Link copied to clipboard
fun texts(text: List<String>, positions: List<Vector2>): List<TextNode>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var mask: Shape?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard