Default text looks poor in front of planes. Have render-order component?
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 17.6k
- Forks
- 4.4k
- PR merge metrics
- No merged PRs in 30d
Description
Description:
Without render-order:

Controlling render-order:

AFRAME.registerSystem('render-order', {
schema: {type: 'array'},
init: function () {
this.el.renderer.sortObjects = true;
},
update: function () {
this.order = {};
for (i = 0; i < this.data.length; i++) {
this.order[this.data[i]] = i;
}
}
});
Example render order component:
```js
AFRAME.registerComponent('render-order', {
schema: {type: 'string'},
init: function () {
this.set = this.set.bind(this);
this.el.addEventListener('object3dset', evt => {
evt.detail.object.traverse(this.set);
});
},
update: function () {
this.el.object3D.traverse(this.set);
},
set: function (node) {
// String (named order).
if (isNaN(this.data)) {
node.renderOrder = this.system.order[this.data];
} else {
node.renderOrder = parseFloat(this.data);
}
}
});
<a-scene render-order="background, menu, menutext">
<a-entity render-order="menu" geometry></a-entity>
<a-entity render-order="menutext" text></a-entity>
<a-entity render-order="2.5"></a-entity>
</a-scene>
- A-Frame Version:
- Platform / Device:
- Reproducible Code Snippet or URL:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file or test is named. Start with the supplied render-order system and component examples, then inspect how A-Frame exposes the renderer and object3D behavior. Done means a render-order component can control text placement relative to planes and reproduces the improved result shown in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100