It is a bug or incorrect usage? Unable to draw lines in 8.1.0 but ok in 7.4.2 #10478
-
Hi, I try to draw lines by using Graphics. I wonder if it is a bug or just my incorrect usage. |
Beta Was this translation helpful? Give feedback.
Answered by
bigtimebuddy
Apr 26, 2024
Replies: 1 comment
-
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 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
DevChu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The syntax for drawing Graphics changed slightly. Try this:
See this migration guide for more information: https://pixijs.com/8.x/guides/migrations/v8?_highlight=migration#graphics-api-overhaul