简体   繁体   中英

phaser.text up down without angle

如何使phaser.text标签向上/向下不引起字体旋转的角度,而无需在每个字母后添加换行符,我想使用一个文本标签/字符串轻松输出类似以下内容:

C 
A 
T 

From what I know, there's no built-in support for something like this, but it's easy enough to add the linefeeds programmatically.

let text = this.game.add.text(0, 0, "CAT", { fill: 'white' });
let oldLabel = text.text;

text.text = '';

for (let i = 0; i <= oldLabel.length; i++) {
    text.text += oldLabel[i] + '\n';
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM