Skip to content

Commit

Permalink
Added baseline property to SystemText
Browse files Browse the repository at this point in the history
  • Loading branch information
ekelokorpi committed Apr 9, 2020
1 parent 33bf8b7 commit 991c096
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/engine/renderer/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,12 @@ game.createClass('SystemText', 'Container', {
@default left
**/
align: 'left',
/**
Baseline alignment.
@property {String} baseline
@default alphabetic
**/
baseline: 'alphabetic',
/**
Color of the text.
@property {String} color
Expand Down Expand Up @@ -481,6 +487,7 @@ game.createClass('SystemText', 'Container', {
context.fillStyle = this.color;
context.font = this.size * game.scale + 'px ' + this.font;
context.textAlign = this.align;
context.textBaseline = this.baseline;
context.fillText(this.text, 0, 0);
}
});
Expand Down

0 comments on commit 991c096

Please sign in to comment.