Jump to content

Setting the color and width of a Phaser Line


Mario
 Share

Recommended Posts

You can use graphics to visualize your line:

  var line = new Phaser.Line(0, 0, 100, 100);
  var graphics=game.add.graphics(0,0);
  //var graphics=game.add.graphics(line.start.x,line.start.y);//if you have a static line
  graphics.lineStyle(10, 0xffd900, 1);
  graphics.moveTo(line.start.x,line.start.y);//moving position of graphic if you draw mulitple lines
  graphics.lineTo(line.end.x,line.end.y);
  graphics.endFill();

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...