Fixed particles demo and made text fullscreen relative

This commit is contained in:
Nathan Kunicki 2016-03-24 23:02:22 +00:00
parent d10e9b4aef
commit fa8ec9125e
3 changed files with 3 additions and 8 deletions

View File

@ -8,7 +8,7 @@ let KeyConsts = MomentumEngine.Consts.Input.Keys;
class BlueParticle extends MomentumEngine.Classes.Rect {
constructor (x, y) {
super(x, y, 1, 1, new MomentumEngine.Classes.Color(255, 255, 255, 0));
super(x, y, 1, 1, new MomentumEngine.Classes.Color(0, 255, 0));
this.timeToLive = 25500;
}

View File

@ -97,11 +97,6 @@ class Game extends Entity {
}
}
console.log(this._fullScreenXScaling);
console.log(this._fullScreenYScaling);
console.log(this._fullScreenXPos);
console.log(this._fullScreenYPos);
// Call getContext last for Ejecta only.
if (typeof ejecta !== "undefined") {

View File

@ -90,12 +90,12 @@ class Text extends Entity {
if (this.font.fill) {
this._game.context.fillStyle = this.font.fill;
this._renderText(this.text, this.relativeLeft, this.relativeTop, this.letterSpacing, this._game.context.fillText.bind(this._game.context));
this._renderText(this.text, this._scaleForLeft(this.relativeLeft), this._scaleForTop(this.relativeTop), this.letterSpacing, this._game.context.fillText.bind(this._game.context));
}
if (this.font.stroke) {
this._game.context.strokeStyle = this.font.stroke;
this._renderText(this.text, this.relativeLeft, this.relativeTop, this.letterSpacing, this._game.context.strokeText.bind(this._game.context));
this._renderText(this.text, this._scaleForLeft(this.relativeLeft), this._scaleForTop(this.relativeTop), this.letterSpacing, this._game.context.strokeText.bind(this._game.context));
}
return true;