0
當前,當我關注彎曲圖像時,我改變了它的顏色。WebVR使用aframe.io覆蓋曲面圖像
相反,我想覆蓋它與一個圖標,例如播放圖標。
我該如何做到這一點?代碼如下:
HTML
<a-curvedimage id="vid1" material="opacity: 0" data-src="vid1.mp4" selectable height="2" radius="5.3" theta-length="32" position="0 2.2 -0" rotation="0 65 0" scale="0.7 0.7 0.7" src="#tile1">
</a-curvedimage>
JS
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', '');
});
});
}