RPE Chart Utils
    Preparing search index...

    Module position

    Position computation utilities for RPE charts.

    Replicates the coordinate system used by the player at a fixed scene size of 1350×900. Provides functions to compute:

    • Line positions (from event layers + parent chains)
    • Note positions relative to their line (local coordinates)
    • Note positions relative to the scene (world coordinates)
    Concept Value
    Scene width 1350 units (WIDTH)
    Scene height 900 units (HEIGHT)
    Origin Top-left corner
    Chart X=0 Horizontal center
    Chart Y=0 Vertical center
    Positive Y Up (in math space); down in screen pixels

    Use p / o / d / w / h to convert between chart space and scene pixels (mirroring the game's Game.p/o/d/w/h helpers).

    import { getLineState, getNotePosition, preprocess } from './chart-utils';

    preprocess(chart);

    // Where is line 0 at beat 8?
    const state = getLineState(chart, 0, 8);
    console.log(state.sceneX, state.sceneY, state.rotationRad);

    // Where is note 3 on line 0 at beat 8?
    const pos = getNotePosition(chart, 0, 3, 8);
    if (pos) console.log(pos.sceneX, pos.sceneY);

    // Find the note closest to clicked pixel (700, 450)
    const closest = findClosestNote(chart, { x: 700, y: 450 }, 8, 0, 50);

    Interfaces

    LineState
    NotePosition

    Variables

    WIDTH
    HEIGHT

    Functions

    p
    o
    d
    w
    h
    getLineState
    getNotePosition
    getNoteJudgmentPosition
    getAllNotePositions
    getAllNotePositionsInChart
    findClosestNote