Search the Community
Showing results for tags 'Text Sizing Press+Start+2P'.
-
Below is my following code for effects in my game. As you can see i hard code 32px as the font size, yet no matter what size I put in be it 1px to 300px no difference is made. Any idea why the font is not sizing? Ignore the properties argument, implementing that later. Effect = function(text, x, y, properties) {PIXI.Text.call(this, text, {font:'32px Press+Start+2P'}); this.position.x = x;this.position.y = y;this.z = 2; this.requestingRemoval = false;this.time = 0; console.log(this);}; Effect.prototype = Object.create(PIXI.Text.prototype); Effect.prototype.constructor = Effect; Effect.prototype.remove = function() {this.requestingRemoval = true;}; Effect.prototype.update = function() {this.time++;if (this.time >= 30) {this.remove();} this.position.y--;}; DamageText = function(text, x, y){Effect.call(this, text, x, y, {fill:'black'});}; DamageText.prototype = Object.create(Effect.prototype); DamageText.prototype.constructor = DamageText; var EffectHandler = {effects: [],addEffect: function(effect){this.effects.push(effect);}};Further style: Objectalign: "left"dropShadow: falsedropShadowAngle: 0.5235987755982988dropShadowColor: "black"dropShadowDistance: 4fill: "black"font: "32px Press+Start+2P"stroke: "black"strokeThickness: 0wordWrap: falsewordWrapWidth: 100So i can confirm that the 32px is being passed to the Font class. In addition, my font loading code right from google <!-- Fonts --><script type="text/javascript"> WebFontConfig = { google: { families: [ 'Press+Start+2P::latin' ] } }; (function() { var wf = document.createElement('script'); wf.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'; wf.type = 'text/javascript'; wf.async = 'true'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(wf, s); })(); </script>