Jump to content

Using Graphics.drawPolygon()


TMichel
 Share

Recommended Posts

Hi,

 

I just started testing Phaser and i am trying to render a simple polygon on screen:

var g = new Phaser.Graphics(game);var p = new Phaser.Polygon(10,10,70,70,70,10,10,10);g.drawPolygon( p );

Using v2.0.6. Am i missing something?

Link to comment
Share on other sites

Thank you. Polygon does not have fill() method but as stated in the Graphics doc, drawPolygon() "Draws a {Phaser.Polygon} or a {PIXI.Polygon} filled". Graphics object does not seem to provide that neither.

 
Anyway my intention is not even fill it or show it, i will use it only for debuging purposes, as i want to use its points to replicate the behaviour on the chained tweens example.
 
I usually do this in Turbulenz by enabling the 2DDebug viewport. Apparently in Phaser i must use game.debug.geom() for that purpose but i see that only accepts basic shapes and lines as a parameter, am i right?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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