Documentation
    Preparing search index...

    Interface PatternPaint

    A §58 pattern: a texture sampled over the shape's own uv — the [0, 1]² parameterization of its bounding box that every shape geometry already carries — covering two of §58's rows at once, because the texture seam is MaterialTexture: an image pattern binds a Texture, and a render-target texture binds a RenderTarget.colorTexture, with no adapter between them (R-4's seam, exactly as NodeMaterial.setTexture documents it).

    const tiles: PatternPaint = {
    kind: "pattern",
    texture: bricks, // or offscreenTarget.colorTexture
    repeat: { x: 4, y: 2 }, // uv is multiplied, then offset
    };

    Tiling past [0, 1] is the texture's own wrap mode's business (§77) — the paint transforms the coordinate and the sampler decides what lies beyond, so repeat: { x: 4 } tiles a "repeat" texture four times and clamps a "clamp" one, both honestly.

    interface PatternPaint {
        kind: "pattern";
        offset?: Point2D;
        opacity?: number;
        repeat?: Point2D;
        texture: MaterialTexture;
    }
    Index
    kind: "pattern"

    Discriminant (§58 "image pattern" / "render-target texture").

    offset?: Point2D

    Uv offset, applied after repeat; finite (§85), defaults to (0, 0).

    opacity?: number

    See SolidPaint.opacity; multiplies the sampled alpha.

    repeat?: Point2D

    Uv scale; finite and non-zero per axis (§85), defaults to (1, 1).

    What is sampled — a Texture or a RenderTarget.colorTexture (§77).