SplineEvent to have all infos of the target #105
Unanswered
Prasanna-kumar-Patra
asked this question in
Q&A
Replies: 1 comment 3 replies
-
You can get the event object info like this: import Spline from '@splinetool/react-spline';
export default function App() {
const spline = useRef();
function onLoad(splineApp) {
spline.current = splineApp;
}
function onMouseDown(e) {
const obj = spline.current.findObjectById(e.target.id)
console.log(obj) // it has position, parent ecc..
}
return (
<div>
<Spline
scene="https://prod.spline.design/6Wq1Q7YGyM-iab9i/scene.splinecode"
onLoad={onLoad}
onMouseDown={onMouseDown}
/>
</div>
);
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
SplineEvent to have all infos of the target
like parent info, position and coordinates event type and all that we get in normal DOM level events
Beta Was this translation helpful? Give feedback.
All reactions