My question is about moving lines and rects using absolute coords.
- I created line:
const line = new PIXI.Graphics();
line.lineStyle(2, 0xffffff);
line.moveTo(100, 200);
line.lineTo(300, 200);
app.stage.addChild(line);
But if I will try to set coords by changing x/y it will be relative to created pos:
line.x = 200; // real x will be 300
line.y = 200; // real y will be 400
How should I move this line if i need to set absolute coords on view? Should I always calc absolute coords using current?
- Same question about rect, I create it like this:
const blueBox = new PIXI.Graphics();
blueBox.beginFill(0x0000ff);
blueBox.drawRect(50, 50, 50, 50);
blueBox.endFill();
app.stage.addChild(blueBox);
If i will try to move it using x/y i will do same as line - x/y are relative, ok. I can always draw rects at 0/0 point and then move them, but is it correct desigin, is there other way?