Skip to content
Snippets Groups Projects
Commit 3bec72f0 authored by Brian Peiris's avatar Brian Peiris
Browse files

rename component

parent 2a731a11
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<script id="nametag-template" type="text/html"> <script id="nametag-template" type="text/html">
<a-entity <a-entity
class="nametag" class="nametag"
nametag="follow: .head" nametag-transform="follow: .head"
text="side:double;align:center;" text="side:double;align:center;"
position="0 2.5 0" position="0 2.5 0"
scale="6 6 6"></a-entity> scale="6 6 6"></a-entity>
......
AFRAME.registerComponent("nametag", { AFRAME.registerComponent("nametag-transform", {
schema: { schema: {
follow: {type: "string"} follow: {type: "string"}
}, },
init: function() { init: function() {
this.vector = new THREE.Vector3(); this.vector = new THREE.Vector3();
// TODO this traversal kinda feels like a hack. Should probably change networked-aframe to support it properly.
// traverse up to the networked player rig and find the networked head. // traverse up to the networked player rig and find the networked head.
var head = this._findParent(this.el, '[networked]').parentNode.querySelector(this.data.follow); var head = this._findParent(this.el, '[networked]').parentNode.querySelector(this.data.follow);
// traverse up to the head's networked parent and get its object3D // traverse up to the head's networked parent and get its object3D
......
...@@ -5,7 +5,7 @@ import "./components/axis-dpad"; ...@@ -5,7 +5,7 @@ import "./components/axis-dpad";
import "./components/snap-rotation"; import "./components/snap-rotation";
import "./components/mute-mic"; import "./components/mute-mic";
import "./components/audio-feedback"; import "./components/audio-feedback";
import "./components/billboard"; import "./components/nametag-transform";
import { generateName } from "./utils"; import { generateName } from "./utils";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment