added a whole lot of crap

Signed-off-by: Pascal Syma <pascal@syma.dev>
This commit is contained in:
2020-07-15 23:47:44 +02:00
parent 4edf8453d1
commit e3b9eff67d
25 changed files with 4490 additions and 59 deletions
+22
View File
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2020. Antonio Martinez Casadesus and Pascal Syma.
* All rights reserved.
*/
export default class TextElement {
constructor(scene, item) {
scene.add.text(item.x, item.y, item.text.text, {
fontFamily: item.text.fontfamily || "Consolas",
fontSize: item.text.pixelsize || 16,
align: item.text.valign || "center",
fontStyle: item.text.bold ? "strong" : "",
fixedHeight: item.height,
fixedWidth: item.width,
color: item.text.color || "#ffffff",
wordWrap: {
width: item.width,
useAdvancedWrap: item.text.wrap
}
})
}
}