鼠标右键或平板三指触摸显示右键菜单。
因为右键菜单因不同项目而不同,Meta2d.js只是发送一个右键菜单消息,开发者去监听,然后显示已写好的右键菜单 dom 元素。
示例:
const showContextMenu = () => {};
const hideContextMenu = () => {};
// 右键菜单
meta2d.on('contextmenu', showContextMenu);
// 点击画布
meta2d.on('click', hideContextMenu);