Add: print sample - graph, ranking

This commit is contained in:
2018-08-10 18:16:15 +09:00
parent d97dbaa20f
commit ae42c35807
10 changed files with 188 additions and 14 deletions
+54
View File
@@ -0,0 +1,54 @@
/////////////////////////////
// Chart
class AnnounceBox {
constructor(x, y) {
console.log("x : " + x + ", y : " + y);
this.posX = x;
this.posY = y;
}
drawText(posX, posY, text) {
const style = { font: "24px Arial", fill: "#fff", align: "left", boundsAlignH: "center", boundsAlignV: "middle" };
let textObject = game.add.text(
posX, posY,
text, style
);
textObject.anchor.set(0.5);
textObject.stroke = "#333";
textObject.strokeThickness = 3;
return textObject;
}
getFontStyle() {
return { font: "32px Arial", fill: "#fff" };
}
drawBox(text) {
this.graphics = game.add.graphics(this.posX, this.posY);
this.graphics.alpha = 0.8;
this.graphics.beginFill(0x303030);
this.graphics.lineStyle(4, 0x880000, 1);
this.graphics.moveTo(0, -190);
this.graphics.lineTo(game.world.width / 2, -170);
this.graphics.lineTo(game.world.width - this.posX * 2, -190);
this.graphics.lineTo(game.world.width - this.posX * 2, 50);
this.graphics.lineTo(game.world.width / 2, 30);
this.graphics.lineTo(0, 50);
this.graphics.endFill();
let announceText = this.drawText(
game.world.width / 2, this.posY - 75,
text
);
announceText.addColor("#ff0000", 0);
announceText.stroke = "#fff";
}
}
+2
View File
@@ -47,6 +47,8 @@ class Chart {
textObject.anchor.set(0.5);
textObject.stroke = "#333";
textObject.strokeThickness = 3;
return textObject;
}
getFontStyle() {