0
将边框添加到
以下代码将更改图像的材质颜色,但我更愿意添加边框或发光。
AFRAME.registerComponent('selectable', {
init: function() {
var el = this.el;
this.el.addEventListener('mouseenter', function (evt) {
this.setAttribute('material', 'color', 'blue');
});
this.el.addEventListener('mouseleave', function (evt) {
this.setAttribute('material', 'color', '');
});
}
});
这里是一个JSBIN表示用于说明上述