RPE Chart Utils
    Preparing search index...

    Class LineBuilder

    Fluent wrapper around a single JudgeLine.

    Exposes methods for adding notes, events (by channel), and event layers. All mutating methods return this for chaining unless prefixed with get / new, which return more specific builders.

    .moveX(), .moveY(), .rotate(), .alpha(), .speed(), .incline(), .scaleX(), .scaleY(), .colorEvent(), .textEvent(), .gifEvent()

    .addNote(), .addNotes(), .removeNote(), .clearNotes()

    .setName(), .setParent(), .setZOrder(), .addLayer(), .notes() (NoteIterator), .events() (EventIterator)

    const lb = new LineBuilder(chart, 0);

    // Animate the line and add notes
    lb.moveX(0, 4, 0, 675, 'cubicOut')
    .rotate(0, 4, 0, 90, 'sineInOut')
    .alpha(0, 1, 0, 255)
    .addNote(2, { type: 1 })
    .addNote(3, { type: 3 });

    // Color transition: white → red over beats 4–8
    lb.colorEvent(4, 8, [255, 255, 255], [255, 0, 0]);

    // Attach a text overlay
    lb.textEvent(0, 4, 'Hello', 'World');
    Index

    Constructors

    Properties

    chart: RpeJson

    Reference to the parent chart.

    index: number

    Index of this line in chart.judgeLineList.

    Accessors

    • get noteCount(): number

      Number of notes on this line.

      Returns number

    Methods

    • Set this line's name.

      Parameters

      • name: string

      Returns this

    • Set this line's texture.

      Parameters

      • texture: string

      Returns this

    • Set this line's group index.

      Parameters

      • group: number

      Returns this

    • Set the Z-order for rendering.

      Parameters

      • z: number

      Returns this

    • Set whether this line is a cover.

      Parameters

      • cover: 0 | 1

      Returns this

    • Set BPM factor.

      Parameters

      • factor: number

      Returns this

    • Set the parent line index (-1 for no parent).

      Parameters

      • parentIndex: number

      Returns this

    • Set rotateWithFather.

      Parameters

      • value: boolean

      Returns this

    • Set anchor.

      Parameters

      • x: number
      • y: number

      Returns this

    • Remove a note at noteIndex from this line.

      Parameters

      • noteIndex: number

      Returns Note | undefined

      The removed Note, or undefined.

    • Remove all notes matching a predicate.

      Parameters

      • predicate: (note: Note, index: number) => boolean

      Returns Note[]

      Array of removed notes.

    • Remove an event layer by index.

      Parameters

      • layerIndex: number

      Returns EventLayer | null | undefined

      The removed EventLayer, or undefined.

    • Add a moveX event on layer 0.

      Parameters

      • startBeat: number

        Start beat.

      • endBeat: number

        End beat.

      • from: number

        Start X value.

      • to: number

        End X value.

      • easing:
            | number
            | "linear"
            | "sineOut"
            | "sineIn"
            | "quadOut"
            | "quadIn"
            | "sineInOut"
            | "quadInOut"
            | "cubicOut"
            | "cubicIn"
            | "quartOut"
            | "quartIn"
            | "cubicInOut"
            | "quartInOut"
            | "quintOut"
            | "quintIn"
            | "expoOut"
            | "expoIn"
            | "circOut"
            | "circIn"
            | "backOut"
            | "backIn"
            | "circInOut"
            | "backInOut"
            | "elasticOut"
            | "elasticIn"
            | "bounceOut"
            | "bounceIn"
            | "bounceInOut" = 1

        Easing type (default: 1 = linear).

      • index: number = 0

        Layer index (default: 0).

      • options: EventOptions = {}

      Returns this

    • Add a moveY event on layer 0.

      Parameters

      • startBeat: number
      • endBeat: number
      • from: number
      • to: number
      • easing:
            | number
            | "linear"
            | "sineOut"
            | "sineIn"
            | "quadOut"
            | "quadIn"
            | "sineInOut"
            | "quadInOut"
            | "cubicOut"
            | "cubicIn"
            | "quartOut"
            | "quartIn"
            | "cubicInOut"
            | "quartInOut"
            | "quintOut"
            | "quintIn"
            | "expoOut"
            | "expoIn"
            | "circOut"
            | "circIn"
            | "backOut"
            | "backIn"
            | "circInOut"
            | "backInOut"
            | "elasticOut"
            | "elasticIn"
            | "bounceOut"
            | "bounceIn"
            | "bounceInOut" = 1
      • index: number = 0
      • options: EventOptions = {}

      Returns this

    • Add a rotate event on layer 0.

      Parameters

      • startBeat: number
      • endBeat: number
      • from: number
      • to: number
      • easing:
            | number
            | "linear"
            | "sineOut"
            | "sineIn"
            | "quadOut"
            | "quadIn"
            | "sineInOut"
            | "quadInOut"
            | "cubicOut"
            | "cubicIn"
            | "quartOut"
            | "quartIn"
            | "cubicInOut"
            | "quartInOut"
            | "quintOut"
            | "quintIn"
            | "expoOut"
            | "expoIn"
            | "circOut"
            | "circIn"
            | "backOut"
            | "backIn"
            | "circInOut"
            | "backInOut"
            | "elasticOut"
            | "elasticIn"
            | "bounceOut"
            | "bounceIn"
            | "bounceInOut" = 1
      • index: number = 0
      • options: EventOptions = {}

      Returns this

    • Add an alpha event on layer 0.

      Parameters

      • startBeat: number
      • endBeat: number
      • from: number
      • to: number
      • easing:
            | number
            | "linear"
            | "sineOut"
            | "sineIn"
            | "quadOut"
            | "quadIn"
            | "sineInOut"
            | "quadInOut"
            | "cubicOut"
            | "cubicIn"
            | "quartOut"
            | "quartIn"
            | "cubicInOut"
            | "quartInOut"
            | "quintOut"
            | "quintIn"
            | "expoOut"
            | "expoIn"
            | "circOut"
            | "circIn"
            | "backOut"
            | "backIn"
            | "circInOut"
            | "backInOut"
            | "elasticOut"
            | "elasticIn"
            | "bounceOut"
            | "bounceIn"
            | "bounceInOut" = 1
      • index: number = 0
      • options: EventOptions = {}

      Returns this

    • Add a speed event on layer 0.

      Parameters

      • startBeat: number
      • endBeat: number
      • from: number
      • to: number
      • easing:
            | number
            | "linear"
            | "sineOut"
            | "sineIn"
            | "quadOut"
            | "quadIn"
            | "sineInOut"
            | "quadInOut"
            | "cubicOut"
            | "cubicIn"
            | "quartOut"
            | "quartIn"
            | "cubicInOut"
            | "quartInOut"
            | "quintOut"
            | "quintIn"
            | "expoOut"
            | "expoIn"
            | "circOut"
            | "circIn"
            | "backOut"
            | "backIn"
            | "circInOut"
            | "backInOut"
            | "elasticOut"
            | "elasticIn"
            | "bounceOut"
            | "bounceIn"
            | "bounceInOut" = 1
      • index: number = 0
      • options: SpeedEventOptions = {}

      Returns this

    • Add an incline event.

      Parameters

      • startBeat: number
      • endBeat: number
      • from: number
      • to: number
      • easing:
            | number
            | "linear"
            | "sineOut"
            | "sineIn"
            | "quadOut"
            | "quadIn"
            | "sineInOut"
            | "quadInOut"
            | "cubicOut"
            | "cubicIn"
            | "quartOut"
            | "quartIn"
            | "cubicInOut"
            | "quartInOut"
            | "quintOut"
            | "quintIn"
            | "expoOut"
            | "expoIn"
            | "circOut"
            | "circIn"
            | "backOut"
            | "backIn"
            | "circInOut"
            | "backInOut"
            | "elasticOut"
            | "elasticIn"
            | "bounceOut"
            | "bounceIn"
            | "bounceInOut" = 1
      • options: EventOptions = {}

      Returns this

    • Add a scaleX event.

      Parameters

      • startBeat: number
      • endBeat: number
      • from: number
      • to: number
      • easing:
            | number
            | "linear"
            | "sineOut"
            | "sineIn"
            | "quadOut"
            | "quadIn"
            | "sineInOut"
            | "quadInOut"
            | "cubicOut"
            | "cubicIn"
            | "quartOut"
            | "quartIn"
            | "cubicInOut"
            | "quartInOut"
            | "quintOut"
            | "quintIn"
            | "expoOut"
            | "expoIn"
            | "circOut"
            | "circIn"
            | "backOut"
            | "backIn"
            | "circInOut"
            | "backInOut"
            | "elasticOut"
            | "elasticIn"
            | "bounceOut"
            | "bounceIn"
            | "bounceInOut" = 1
      • options: EventOptions = {}

      Returns this

    • Add a scaleY event.

      Parameters

      • startBeat: number
      • endBeat: number
      • from: number
      • to: number
      • easing:
            | number
            | "linear"
            | "sineOut"
            | "sineIn"
            | "quadOut"
            | "quadIn"
            | "sineInOut"
            | "quadInOut"
            | "cubicOut"
            | "cubicIn"
            | "quartOut"
            | "quartIn"
            | "cubicInOut"
            | "quartInOut"
            | "quintOut"
            | "quintIn"
            | "expoOut"
            | "expoIn"
            | "circOut"
            | "circIn"
            | "backOut"
            | "backIn"
            | "circInOut"
            | "backInOut"
            | "elasticOut"
            | "elasticIn"
            | "bounceOut"
            | "bounceIn"
            | "bounceInOut" = 1
      • options: EventOptions = {}

      Returns this

    • Add a color event.

      Parameters

      • startBeat: number
      • endBeat: number
      • startColor: [number, number, number]

        [r, g, b] at start.

      • endColor: [number, number, number]

        [r, g, b] at end.

      • easing:
            | number
            | "linear"
            | "sineOut"
            | "sineIn"
            | "quadOut"
            | "quadIn"
            | "sineInOut"
            | "quadInOut"
            | "cubicOut"
            | "cubicIn"
            | "quartOut"
            | "quartIn"
            | "cubicInOut"
            | "quartInOut"
            | "quintOut"
            | "quintIn"
            | "expoOut"
            | "expoIn"
            | "circOut"
            | "circIn"
            | "backOut"
            | "backIn"
            | "circInOut"
            | "backInOut"
            | "elasticOut"
            | "elasticIn"
            | "bounceOut"
            | "bounceIn"
            | "bounceInOut" = 1
      • options: EventOptions = {}

      Returns this

    • Add a text event.

      Parameters

      • startBeat: number
      • endBeat: number
      • startText: string
      • endText: string
      • easing:
            | number
            | "linear"
            | "sineOut"
            | "sineIn"
            | "quadOut"
            | "quadIn"
            | "sineInOut"
            | "quadInOut"
            | "cubicOut"
            | "cubicIn"
            | "quartOut"
            | "quartIn"
            | "cubicInOut"
            | "quartInOut"
            | "quintOut"
            | "quintIn"
            | "expoOut"
            | "expoIn"
            | "circOut"
            | "circIn"
            | "backOut"
            | "backIn"
            | "circInOut"
            | "backInOut"
            | "elasticOut"
            | "elasticIn"
            | "bounceOut"
            | "bounceIn"
            | "bounceInOut" = 1
      • options: EventOptions = {}

      Returns this

    • Add a GIF frame event.

      Parameters

      • startBeat: number
      • endBeat: number
      • startFrame: number
      • endFrame: number
      • easing:
            | number
            | "linear"
            | "sineOut"
            | "sineIn"
            | "quadOut"
            | "quadIn"
            | "sineInOut"
            | "quadInOut"
            | "cubicOut"
            | "cubicIn"
            | "quartOut"
            | "quartIn"
            | "cubicInOut"
            | "quartInOut"
            | "quintOut"
            | "quintIn"
            | "expoOut"
            | "expoIn"
            | "circOut"
            | "circIn"
            | "backOut"
            | "backIn"
            | "circInOut"
            | "backInOut"
            | "elasticOut"
            | "elasticIn"
            | "bounceOut"
            | "bounceIn"
            | "bounceInOut" = 1
      • options: GifEventOptions = {}

      Returns this

    • Set scaleOnNotes: 0 = off, 1 = scale x-only, 2 = scale x+y.

      Parameters

      • value: 0 | 1 | 2

      Returns this

    • Set appearanceOnAttach: 0 = always show, 1 = white colored, 2 = FC/AP colored.

      Parameters

      • value: 0 | 1 | 2

      Returns this

    • Set whether speed event easings are integrated.

      Parameters

      • value: boolean

      Returns this

    • Set the Z-index override (distinct from zOrder). Pass undefined to remove it.

      Parameters

      • z: number | undefined

      Returns this

    • Set the attachUI element.

      Parameters

      • ui:
            | "pause"
            | "combonumber"
            | "combo"
            | "score"
            | "bar"
            | "name"
            | "level"
            | null
            | undefined

      Returns this

    • Set the constant default value in the first event of the given channel on the specified event layer (default: layer 0).

      If the layer or channel has no events yet, a constant event spanning beats 0→1 is created automatically. This is the preferred way to change the initial state of a line (e.g., starting position, opacity, speed) without adding a full timing event.

      Parameters

      • channel: EventChannel

        One of 'moveX', 'moveY', 'rotate', 'alpha', 'speed'.

      • value: number

        The constant value to apply.

      • layerIndex: number = 0

        Event layer index (default: 0).

      Returns this

      line.setDefaultValue('moveX', -200); // line starts at X = -200
      line.setDefaultValue('alpha', 0); // line starts invisible
      line.setDefaultValue('speed', 5); // initial note speed = 5
    • Set the default X position (first moveX event in layer 0).

      Parameters

      • value: number
      • layerIndex: number = 0

      Returns this

      setDefaultValue

    • Set the default Y position (first moveY event in layer 0).

      Parameters

      • value: number
      • layerIndex: number = 0

      Returns this

      setDefaultValue

    • Set the default rotation angle in degrees (first rotate event in layer 0).

      Parameters

      • value: number
      • layerIndex: number = 0

      Returns this

      setDefaultValue

    • Set the default alpha opacity 0–255 (first alpha event in layer 0).

      Parameters

      • value: number
      • layerIndex: number = 0

      Returns this

      setDefaultValue

    • Set the default note scroll speed (first speed event in layer 0).

      Parameters

      • value: number
      • layerIndex: number = 0

      Returns this

      setDefaultValue