supermedium/superframe

state component ignores some data in bound component

Closed this issue · 1 comments

Bug:

I'm creating an entity the following way:

        const plane = document.createElement('a-entity');
        plane.setAttribute('geometry', 'primitive: plane; width: auto; height: auto');
        plane.setAttribute('material', 'opacity: 0.5; color: #000');
        plane.setAttribute('position', '0 -2 -5');
        plane.setAttribute('rotation', '0 0 0');
        plane.setAttribute('bind__text', 'color: white; width: 5; align: center; value: enemy.health');
        camera.appendChild(plane);  

The text gets updated fine, but the align data attribute is being ignored. When for testing reason I used text instead of bind__text, the displayed text was moved to center as expected. I've seen the same behavior, but in a custom component: the color attribute was ignored.

values are not bound

plane.setAttribute('text', 'color: white; width: 5; align: center');
plane.setAttribute('bind__text', 'value: enemy.health');