Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphics.drawPolygon() ignores alpha when Polygon has +5 vertices #1770

Closed
darkodraskovic opened this issue May 8, 2015 · 3 comments
Closed
Labels
🕷 Bug Verified that it’s actually a legit bug that exists in the current release.

Comments

@darkodraskovic
Copy link

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.

var stage = new PIXI.Container();
var renderer = PIXI.autoDetectRenderer(800, 600);
document.body.appendChild(renderer.view);

var polyVert4 = new PIXI.Polygon([0, 0, 100, 0, 100, 100, 0, 100]);
var polyVert5 = new PIXI.Polygon([0, 0, 100, 0, 100, 100, 50, 150, 0, 100]);

stage.addChild(Polygon(polyVert4, 200, 200));
stage.addChild(Polygon(polyVert5, 400, 200));

requestAnimationFrame( animate );


function animate() {
    requestAnimationFrame( animate );

    // Render the stage.
    renderer.render(stage);
}

function Polygon (polygon, x, y, props) {   
    var graphics = new PIXI.Graphics();
    graphics.clear();
    graphics.beginFill('0xEE82EE', .5);
    graphics.lineStyle(2, '0x008000', 0.67);
    graphics.drawPolygon(polygon.points);
    graphics.endFill();

    graphics.position.x = x;
    graphics.position.y = y;

    return graphics;
};

link to JSFiddle!

@englercj
Copy link
Member

englercj commented May 8, 2015

Thanks for this, will be sure to look into it soon.

@englercj englercj added 🕷 Bug Verified that it’s actually a legit bug that exists in the current release. Graphics labels May 8, 2015
@adamsoderstrom
Copy link

link to JSFiddle!

Hm... The JSFiddle seems to appear blank for me? 😕

@lock
Copy link

lock bot commented May 31, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators May 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🕷 Bug Verified that it’s actually a legit bug that exists in the current release.
Projects
None yet
Development

No branches or pull requests

3 participants