replaceViewportEvent
Replaces an event of the viewport with a custom one.
Signatures
- Paramate.Viewport.replaceViewportEvent( eventName, eventHandler )
Details
The function replaces a default event on the viewport with a custom one. To reset the original behavior, the resetViewportEventfunction can be used.
Example
[...]
var viewPort = new Paramate.Viewport({ /.../ });
[...]
configurator.initialize( function(){
// Replace default mouse-down behavior with an alert
viewPort.replaceViewportEvent('mousedown', function() { alert('mouse button pressed down'); });
});
Parameters
- eventName
-
Name of the event to add, e.g. "mousedown".
- eventHandler
-
Function that is called when the event gets triggered.