Skip to content

Commit

Permalink
fix score display
Browse files Browse the repository at this point in the history
  • Loading branch information
cabanier committed Oct 19, 2023
1 parent 7392737 commit 0829beb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions player.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ AFRAME.registerComponent("player", {
enabled: false,
autoRefresh: false
});
this.score = document.createElement("a-entity");
this.score.setAttribute("text", "value: 0; color: #0397ac; align: center; width: 0.9;");
this.score = document.createElement("a-text");
this.score.setAttribute("value", "0")
this.score.setAttribute("color", "#0397ac");
this.score.setAttribute("align", "center");
this.score.setAttribute("width", "0.9;");
this.score.setAttribute("position", "-0.05 0.01 0.11");
this.score.setAttribute("rotation", "-165 80 -90");
this.leftHand.appendChild(this.score);
Expand Down Expand Up @@ -150,7 +153,7 @@ AFRAME.registerComponent("player", {
},

updateScore: function() {
this.score.setAttribute("text", `value: ${this.scoreValue}`);
this.score.setAttribute("value", `${this.scoreValue}`);
},

tick: function(time, timeDelta) {
Expand Down

0 comments on commit 0829beb

Please sign in to comment.