Skip to content

It is a bug or incorrect usage? Unable to draw lines in 8.1.0 but ok in 7.4.2 #10478

Closed Answered by bigtimebuddy
DevChu asked this question in Q&A
Discussion options

You must be logged in to vote

The syntax for drawing Graphics changed slightly. Try this:

let testRender = () => {
  const graphics = new PIXI.Graphics();
  graphics.drawRect(50, 50, 100, 100);
  graphics.fill(0xde3249);
  let offset = 0;
  for (let i = 0, endRow = 21; i < endRow; i++) {
    let yPos = 20 + offset;
    graphics.moveTo(0, yPos);
    graphics.lineTo(1000, yPos);
    offset = yPos;
  }
  graphics.stroke(0x0);
  app.stage.addChild(graphics);
};

See this migration guide for more information: https://pixijs.com/8.x/guides/migrations/v8?_highlight=migration#graphics-api-overhaul

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by DevChu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants