Discussions

Use Snapshot

const takeSnapshot = useSnapshot();

Overview

The useSnapshot should provides functionality to takeSnapshots of the view in the Threekit Player.

Code Examples

import { useSnapshot } from '@threekit-tools/treble';

const SnapshotComponent = () => {
  const takeSnapshots = useSnapshot();

  const handleClickSnapshot = () => {
    takeSnapshots(undefined, { output: 'download' });
  };

  return (
    <button type="button" onClick={() => handleClickSnapshot()}>
      Download Snapshot
    </button>
  );
};