本文整理汇总了TypeScript中athenajs.SimpleText类的典型用法代码示例。如果您正苦于以下问题:TypeScript SimpleText类的具体用法?TypeScript SimpleText怎么用?TypeScript SimpleText使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SimpleText类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: SimpleText
import { SimpleText } from 'athenajs';
const myText: SimpleText = new SimpleText('MyText', {
text: 'yop',
width: 100,
height: 200,
fontFace: 'Arial',
fontSize: '20px',
fontStyle: 'italic',
fontWeight: '300',
align: 'center',
color: 'white'
});
myText.setSize(100, 200);
myText.setText('Hi!');
myText.setColor('rgba(0,0,0,.4');
开发者ID:AlexGalays,项目名称:DefinitelyTyped,代码行数:17,代码来源:simpletext.ts
示例2: increaseScore
/**
* Updates the player's score using line number & current level
*
*/
increaseScore(lines: number) {
this.score +=
this.scoreTable[lines - 1] + this.level * this.scoreTable[lines - 1];
this.lines += lines;
this.linesString.setText("Lines: " + this.lines);
this.scoreString.setText("Score: " + this.score);
if (lines === 4) {
AM.play("lines_tetris");
} else {
AM.play("lines");
}
}
开发者ID:AlexGalays,项目名称:DefinitelyTyped,代码行数:17,代码来源:grid.ts
示例3: reset
reset() {
this.score = 0;
this.level = 0;
this.lines = 0;
this.timing = START_TIMING;
this.resetMap();
this.shape.moveToTop();
this.shape.setRandomShape();
this.nextShape.setRandomShape();
this.linesString.setText("Lines: " + this.lines);
this.scoreString.setText("Score: " + this.score);
this.levelString.setText("Level: " + this.level);
this.shape.movable = true;
this.shape.behavior.reset();
}
开发者ID:AlexGalays,项目名称:DefinitelyTyped,代码行数:17,代码来源:grid.ts
示例4: updateLevel
/**
* Updates level + level object's text
*/
updateLevel() {
const oldLevel = this.level;
this.level = Math.floor(this.lines / 10);
this.levelString.setText("Level: " + this.level);
this.timing = START_TIMING - this.level * LEVEL_TIMING;
this.shape.data['speed'] = this.timing;
oldLevel !== this.level && AM.play("level");
}
开发者ID:AlexGalays,项目名称:DefinitelyTyped,代码行数:11,代码来源:grid.ts
注:本文中的athenajs.SimpleText类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论