View unanswered posts | View active topics It is currently 2022-10-02 14:29



Reply to topic  [ 2 posts ] 
 位图不能绑定事件吗?为什么没有没有位图绑定事件的用法介绍 
Author Message
新手上路

Joined: 2022-03-10 17:29
Posts: 3
Post 位图不能绑定事件吗?为什么没有没有位图绑定事件的用法介绍
位图不能绑定事件吗?为什么没有没有位图绑定事件的用法介绍


2022-03-15 16:15
Profile
TWaver开发组

Joined: 2022-04-28 17:53
Posts: 13
Post Re: 位图不能绑定事件吗?为什么没有没有位图绑定事件的用法介绍
需要给canvas绑定事件,通过network.getElementAt(e)来获取点击的对象
this.network.getView().addEventListener('click', (e) => {
const ele = this.network.getElementAt(e);
if (ele instanceof twaver.Node) {
// do something
}
});


2022-04-29 9:15
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron