OnViewDefaultMouseDownEvent
적용 버전: VIZWide3D 3.0
마우스 다운 이벤트 등록
Parameters
| Name | Type | Description |
|---|---|---|
| listener | Function | Event Listener |
Example
import VIZCore3DModule from "./VIZCore3D/VIZCore3D.js";
let main = document.createElement('div');
main.className = "VIZWeb_Main";
let view = document.createElement('div');
view.id = "view"
view.className = "VIZCore3D";
main.appendChild(view);
document.body.appendChild(main);
const vizcore = new VIZCore3DModule(view);
let onInitialize = function () {
const fileKey = "example"
const url = "./model/toycar/vizw/toycar_wh.vizw";
let onload = (e) => {
//해당파일 다운로드 성공
console.log("onload::", e);
};
let onerror = function () {
//해당파일 다운로드 실패
console.log("onerror");
};
//모델 열기
vizcore.Model.OpenFile(fileKey, url, onload, onerror);
//마우스 다운 이벤트 추가
let OnViewDefaultMouseDownEvent = function (event) {
// event.data: 브라우저 MouseEvent
console.log(event.data);
}
vizcore.View.OnViewDefaultMouseDownEvent(OnViewDefaultMouseDownEvent);
};
let vizcoreParam = {
event: {
onInit: onInitialize,
}
};
vizcore.Init(vizcoreParam);