[About macOS Sequoia] (Updated October 22, 2024)
Live2D Cubism Editor 5.1.02 now supports macOS Sequoia.
Other Live2D Cubism products currently released are not guaranteed to work on macOS Sequoia.
Please refrain from upgrading macOS, as it may not operate properly.
Question - add event listeners to parts
How do you add event listeners to parts?
eg, if I click the head, then head should nod; if I click the arm, the arm should sway.
Currently I am just using different dumb rectangular hit-areas. Is there a better way?
Thank you in advance
0 ·
Comments
I hope the following picture can illustrate my question better.
If I click at the green cross, then it causes the head to nod.
But if I click on the blue cross, it will not cause the head to nod.
I am just hoping to achieve that.
It had been mistaken to be able to check the collision detection in Live2D Viewer.
Live2DViewer the only display of collision detection , could not operation check .
Please forget .
I just added a reply to another thread that is thematically related to this topic. In the source code, that I posted there, you'll find a comment on how you could implement a more precise collision detection. You'd, however, have to test whether the performance of that approach is sufficient for your purposes. Here's the link to the thread anyway: http://community.live2d.com/discussion/287/how-to-make-character-respond-to-touch#latest
However, is there a simpler way of doing it?
All I want is the following:
" If a Part of a live2d model (eg. head) gets clicked, then a event would be triggered" .
I just learnt how to adjust the opacity of individual Parts of a live2d model. So wouldn't it be possible to determine whether a specific Part got clicked on?
Thanks in advance)
I think that it is better to make a multiple of around judgment in Cubism Modeler .
http://sites.cybernoids.jp/cubism2/modeler/models/collision
But then, how do I grab the reference ID when I'm programming in JS using Cubism SDK?
I struggle to find the relevant functions in here: http://doc.live2d.com/api/core/cpp2.0e/
Next, you will modify the hit area definition of model.json .
Finally, modify the program .
It is very easy . Good Luck!!