RQOE2STHW6BJO2M6LPKAGZMVAUL7N2KYXNYYLLF5XDY6BO3YW5KAC
A2OAPAN7NT7NCAVYQ3PEPJNEECXVXP3TQ2WJOPKKIO2E5USDGDSQC
VG7NEAKILCJJNIATKAPEOTUHKBZJJMPMS6HYT6QFPSF6ZB2ADWUQC
YJ3YEICSBUHMDVJB6W3ZOOVWLTAXRDCIKOGNN6HRP6N3HWQTDGVAC
AAKN4XJLZ2GARZMUFYX3CJZKYHTRRZDYNTFRLMY7VPAY7K6W4N3QC
5SWO57MM5QKEXDPNI7DOBBW6A6PLTP4PEHHJQ7QOGWLINJ6GIOUQC
MK5LPGJ3HSEHGWOZFPY6QMFVMHWRXQZ6PUQEXFWNOBAK4SUQT56AC
KREAAF4L5GTC6F55ZKEGBZ43DASWW4JBAYLR3GKI53VQY4FLJELQC
// TODO(bowei): move this code outta here!!
// generate a texture
let g = new Pixi.Graphics();
g.beginFill(0xff8080);
g.drawRoundedRect(
- RenderedChunk.NODE_SIZE_PX / 2,
- RenderedChunk.NODE_SIZE_PX / 2,
RenderedChunk.NODE_SIZE_PX,
RenderedChunk.NODE_SIZE_PX,
RenderedChunk.NODE_ROUNDED_PX
);
// g.x = 200;
// g.y = 200;
// this.app.stage.addChild(g);
let texture = this.app.renderer.generateTexture(g, Pixi.SCALE_MODES.NEAREST, 1);
// const sprite = new Pixi.Sprite(texture);
// sprite.x = 300;
// sprite.y = 300;
// this.app.stage.addChild(sprite);
let g = new Pixi.Graphics();
this.renderedNodes.put(node, g);
g.beginFill(0xff8080);
if (node.x == 0 && node.y == 0) {
g.beginFill(0xff0000);
let g: Pixi.Graphics | Pixi.Sprite = new Pixi.Graphics();
if (!texture) {
// g.beginFill(0xff8080);
// // if (node.x == 0 && node.y == 0) {
// // g.beginFill(0xff0000);
// // }
// g.drawRoundedRect(
// node.x * RenderedChunk.SPACING_PX - RenderedChunk.NODE_SIZE_PX / 2,
// node.y * RenderedChunk.SPACING_PX - RenderedChunk.NODE_SIZE_PX / 2,
// RenderedChunk.NODE_SIZE_PX,
// RenderedChunk.NODE_SIZE_PX,
// RenderedChunk.NODE_ROUNDED_PX
// );
// this.renderedNodes.put(node, g);
} else {
g = new Pixi.Sprite(texture);
g.anchor.x = 0.5;
g.anchor.y = 0.5;
g.x = node.x * RenderedChunk.SPACING_PX;
g.y = node.y * RenderedChunk.SPACING_PX;
this.renderedNodes.put(node, g);
g.drawRoundedRect(
node.x * RenderedChunk.SPACING_PX - RenderedChunk.NODE_SIZE_PX / 2,
node.y * RenderedChunk.SPACING_PX - RenderedChunk.NODE_SIZE_PX / 2,
RenderedChunk.NODE_SIZE_PX,
RenderedChunk.NODE_SIZE_PX,
RenderedChunk.NODE_ROUNDED_PX
);