Answers for "phaser 3 text"

2

phaser 3 text

let text;
let player;
create () {
  player = this.add.sprite(0,0,'player');
  
  const style = { font: "bold 32px Arial", fill: "#fff" };
  text = this.add.text(0, 0, `Player Coords: ${player.x} ${player.y}`, style);
}

update () {
  text.setText(
    `Player Coords: ${player.x} ${player.y}`;
  );
}
Posted by: Guest on June-14-2020
2

phaser 3 text

let text;
let player;
create () {
  player = this.add.sprite(0,0,'player');
  
  const style = { font: "bold 32px Arial", fill: "#fff" };
  text = this.add.text(0, 0, `Player Coords: ${player.x} ${player.y}`, style);
}

update () {
  text.setText(
    `Player Coords: ${player.x} ${player.y}`;
  );
}
Posted by: Guest on June-14-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language