Class Scissor

All child objects are clipped to the provided bounds.

Example

// Not in screen space, with an array of renderables.
new Scissor(cg, 0, 0, 1, 1, false, [
new LineStrip(cg, xs, ys, {
colors: [1, 0.5, 0, 1],
widths: 3,
}),
new Circles(cg, xs, ys, {
colors: [1, 0.5, 0, 1],
radii: 6.0,
borderWidths: 0,
}),
new Circles(cg, xs, ys, {
colors: [0, 0, 0.25, 1],
radii: 3.0,
borderWidths: 0,
}),
]),

Example

// In screen space, with a single renderable (not an array).
new Scissor(cg, 32, 32, viewport.width - 48, viewport.width - 48, true,
new LineStrip(cg, xs, ys, {
colors: [1, 0.5, 0, 1],
widths: 3,
}),
),

Hierarchy

Constructors

Properties

Methods

Constructors

  • Parameters

    • cg: CandyGraph
    • x: number

      The x-coordinate of the bottom-left corner of the scissor region.

    • y: number

      The y-coordinate of the bottom-left corner of the scissor region.

    • width: number

      The width of the scissor region.

    • height: number

      The height of the scissor region.

    • screenSpace: boolean

      Whether or not the scissor region is defined in screen space.

    • children: Renderable

      One or more Renderables to be rendered with the scissor.

    Returns Scissor

Properties

_children: Renderable
height: number
scope: DrawCommand<DefaultContext, {}>
screenSpace: boolean
width: number
x: number
y: number

Methods

  • Releases all GPU resources and renders this instance unusable. Also disposes any children.

    Returns void

Generated using TypeDoc