Jump to content

V3 bug? Graphics.drawPolygon() ignores alpha when Polygon has +5 vertices


Recommended Posts

Hello. Since I've migrated to V3, I have a strange issue with polygon drawing. Every time I want to draw a polygon object that has 5 or more vertices, the given alpha value to the .beginFill is ignored and alpha = 1 is used insted. Here is the code chunk from my game framework Dodo:

DODO.drawPolygon = function (graphics, polygon, props) {    _.isObject(props) || (props = {});        graphics.clear();    graphics.beginFill(props.fillColor || DODO.Colors.violet, props.fillAlpha || 0.5);    graphics.lineStyle(props.lineWidth || 2, props.lineColor || DODO.Colors.green, props.lineAlpha || 0.67);    graphics.drawPolygon(polygon.points);    graphics.endFill();};

I use it for debug purposes to draw a collision mask:




Or the other example:



Link to comment
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...