Jump to content

Using Graphics.drawPolygon()

Recommended Posts

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 post
Share on other sites

Phaser.Polygon is an abstract object meant to represent collision areas and so on - it's not a graphics object as such. To draw polygons on a Graphics object you should see this example, as Phaser.Graphics is an extension of pixi's Graphics object: http://www.goodboydigital.com/pixijs/examples/13/

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...