Skip to content

Web Documentation Inconsistent with each other. #419

@awils27

Description

@awils27

The WebJS Documentation uses different variable names to do the same thing as the data binding web documentation making it hard to follow.

The data binding documentation also uses the variable name rive for the rive instance which as far as i can tell is not possible to do as it tries to access that variable in the same line.

Data binding documentation:

const rive = new rive.Rive({
    autoBind: false, // This should be set to false (default)
    onLoad: () => {
        const vm = rive.viewModelByName("My View Model");
        const vmi = vm.instanceByName("My Instance");
        // Manually bind by applying the instance to the state machine and artboard
        rive.bindViewModelInstance(vmi);
    }
});

WebJS documentation:

const r = new rive.Rive({
        src: "https://cdn.rive.app/animations/vehicles.riv",
        // OR the path to a discoverable and public Rive asset
        // src: '/public/example.riv',
        canvas: document.getElementById("canvas"),
        autoplay: true,
        // artboard: "Artboard", // Optional. If not supplied the default is selected
        stateMachines: "bumpy",
        onLoad: () => {
          r.resizeDrawingSurfaceToCanvas();
        },
    }); 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions