-
Notifications
You must be signed in to change notification settings - Fork 357
H3D Events and Interactivity
Yuxiao Mao edited this page Oct 29, 2024
·
2 revisions
Making objects interactive is done creating a h3d.scene.Interactive instance. You give it a target object and attach it to a parent.
var interaction = new h3d.scene.Interactive(collider, s3d);
interaction.onOver = function(event) {
trace("over");
}
interaction.onOut = function(event) {
trace("out");
}
interaction.onClick = function(event) {
trace("click!");
}
interaction.onPush = function(event) {
trace("down!");
}
interaction.onRelease = function(event) {
trace("up!");
}
interaction.onClick = function(event) {
trace("click!");
}All events callbacks receive a hxd.Event instance, which contains info about the event.