aframe-outline

v0.0.2

based upon an example by Lee Stemkoski.


screenshot


Schema

Property Type Description Default Value
color string color name or value 'red'
scale number relative size to entity 1.05
pulse boolean whether to pulse false
frequency number rate of pulse 1

Methods

.setColor()

entity.components.outline.setColor('purple');

.pulse()

entity.components.outline.pulse(1.5);

.stopPulse()

entity.components.outline.stopPulse();

Include Component in Head after AFRAME library:

<script src="aframe-outline.min.js"></script>


Use default in HTML


<a-sphere outline></a-sphere>


Use custom in HTML


<a-sphere outline="color:green ; pulse:true"></a-sphere>



Use dynamically in JavaScript


const s = document.createElement('a-sphere');
s.setAttribute('outline','color:orange');

setTimeout( _=>{

 s.components.outline.setColor('yellow');
 s.components.outline.pulse();

} , 5000);