Refactor source files and add berries
This commit is contained in:
1 parent
6135243641
commit
3546f3b5a7
103 files changed
+2598
-1171
No files matched your search
@@ -0,0 +1,85 @@
|
||||
export enum TextStyle {
|
||||
MESSAGE,
|
||||
WINDOW,
|
||||
BATTLE_INFO,
|
||||
PARTY,
|
||||
SUMMARY,
|
||||
SUMMARY_RED
|
||||
};
|
||||
|
||||
export function addTextObject(scene: Phaser.Scene, x: number, y: number, content: string, style: TextStyle, extraStyleOptions?: Phaser.Types.GameObjects.Text.TextStyle) {
|
||||
let styleOptions: Phaser.Types.GameObjects.Text.TextStyle;
|
||||
let shadowColor: string;
|
||||
let shadowSize = 6;
|
||||
|
||||
switch (style) {
|
||||
case TextStyle.WINDOW:
|
||||
styleOptions = {
|
||||
fontFamily: 'emerald',
|
||||
fontSize: '96px',
|
||||
color: '#484848',
|
||||
padding: {
|
||||
bottom: 6
|
||||
}
|
||||
};
|
||||
shadowColor = '#d0d0c8';
|
||||
break;
|
||||
case TextStyle.MESSAGE:
|
||||
styleOptions = {
|
||||
fontFamily: 'emerald',
|
||||
fontSize: '96px',
|
||||
color: '#f8f8f8',
|
||||
padding: {
|
||||
bottom: 6
|
||||
}
|
||||
};
|
||||
shadowColor = '#6b5a73';
|
||||
break;
|
||||
case TextStyle.BATTLE_INFO:
|
||||
styleOptions = {
|
||||
fontFamily: 'emerald',
|
||||
fontSize: '72px',
|
||||
color: '#404040'
|
||||
};
|
||||
shadowColor = '#ded6b5';
|
||||
shadowSize = 4;
|
||||
break;
|
||||
case TextStyle.PARTY:
|
||||
styleOptions = {
|
||||
fontFamily: 'pkmnems',
|
||||
fontSize: '66px',
|
||||
color: '#f8f8f8',
|
||||
padding: {
|
||||
bottom: 6
|
||||
}
|
||||
};
|
||||
shadowColor = '#707070';
|
||||
break;
|
||||
case TextStyle.SUMMARY:
|
||||
styleOptions = {
|
||||
fontFamily: 'emerald',
|
||||
fontSize: '96px',
|
||||
color: '#ffffff'
|
||||
};
|
||||
shadowColor = '#636363';
|
||||
break;
|
||||
case TextStyle.SUMMARY_RED:
|
||||
styleOptions = {
|
||||
fontFamily: 'emerald',
|
||||
fontSize: '96px',
|
||||
color: '#f89890'
|
||||
};
|
||||
shadowColor = '#984038';
|
||||
break;
|
||||
}
|
||||
|
||||
if (extraStyleOptions)
|
||||
styleOptions = Object.assign(styleOptions, extraStyleOptions);
|
||||
|
||||
const ret = scene.add.text(x, y, content, styleOptions);
|
||||
ret.setScale(0.1666666667);
|
||||
ret.setShadow(shadowSize, shadowSize, shadowColor);
|
||||
ret.setLineSpacing(5);
|
||||
|
||||
return ret;
|
||||
}
|
||||
Reference in new issue
Block a user