Commit graph

112 commits

Author SHA1 Message Date
Richard Davey
9672602c2f
Merge pull request #4504 from rexrainbow/master
Constraints canvas size via object size
2019-05-04 12:21:06 +01:00
Rex
72df134571 Constrains canvas sizer via game object size 2019-05-01 11:48:08 +08:00
Rex
2a51bb8c3b Remove redundant code 2019-05-01 10:10:05 +08:00
Rex
816eb6d677 Remove redundant code 2019-05-01 10:09:20 +08:00
Rex
b2a32a8e8f Constraints canvas size if using fixedWidth, fixedHeight style 2019-05-01 10:06:04 +08:00
Richard Davey
53c14df798 Changing any aspect of a Text object, such as the font size or content, wouldn't update its hitArea if it had been enabled for input, causing it to carry on using the old hit area size. Now, as long as the Text was created _without_ a custom hitArea, the hitArea size will be changed to match the new texture size on update. If you have provided your own custom hitArea shape, you need to modify it when the Text changes size yourself. Fix #4456 2019-04-24 11:21:36 +01:00
Hua
a05cd9377a Update rectangle hitarea when updated text 2019-04-18 11:04:27 +08:00
Richard Davey
d13e79a8db
Merge pull request #4427 from rexrainbow/master
Fix bug about counting height of text object
2019-04-05 17:25:27 +01:00
Richard Davey
e017691c68 The ScaleMode Component has been removed from every Game Object, and along with it the scaleMode property and setScaleMode method. These did nothing anyway as they were not hooked to the render pipeline and scale mode should be set on the texture, not the Game Object. Fix #4413 2019-03-24 23:07:27 +00:00
Hua
b562917490 Fix fixedWidth, fixedHeight assignment issue 2019-03-15 17:11:04 +08:00
Hua
3c75872335 Fix word wrap issue 2019-03-15 17:06:39 +08:00
Hua
a1d4417a7a Fix bug about counting height of text object
Drawing lines might not equal to amount of lines
2019-03-15 14:31:05 +08:00
Richard Davey
8180764cca Added jsdoc override for origin 2019-02-25 17:07:09 +00:00
Richard Davey
c9bdb83941 GameObject and Loader typedefs 2019-02-13 13:57:59 +00:00
Richard Davey
e7b1d086e7 Moving all of the typedefs to properly namespaced scopes, rather than globals
\o/ ~ "Someone, save me!"
2019-02-13 12:35:12 +00:00
Richard Davey
eb9ed3463f Lots of namespace and jsdoc fixes 2019-02-01 18:02:58 +00:00
Richard Davey
348306cafb Lots more jsdoc fixes and new documentation 2019-01-31 14:47:50 +00:00
Richard Davey
ea9678cc85 Removed TextStyle auto-quotes and added docs instead. 2019-01-22 14:02:25 +00:00
Richard Davey
aa341854c7 Happy New Year 2019-01-15 16:20:22 +00:00
Richard Davey
79dc611b95 Quote the font family in Text objects. 2019-01-12 16:31:48 +00:00
Taran van Groenigen
e181a98aa2
Fixed a mistake that would cause fontFamily to hold all font data when using the font shorthand & fixes photonstorm/phaser#4141
I noticed this while investigating photonstorm/phaser#4141
2018-11-22 09:40:10 +01:00
Richard Davey
c14fb4b764 Updated formatting. 2018-10-19 13:35:30 +01:00
Richard Davey
38743135eb
Merge pull request #4101 from DotTheGreat/TextStyle_setStyle-fix
Text style setStyle/setFont fix
2018-10-19 13:31:15 +01:00
Richard Davey
d41a01ac39 Updated docs 2018-10-18 13:27:56 +01:00
Richard Davey
9dc53d1e5a The WebGLRenderer method canvasToTexture has a new optional argument noRepeat which will stop it from using gl.REPEAT entirely. This is now used by the Text object to avoid it potentially switching between a REPEAT and CLAMP texture, causing texture black-outs 2018-10-12 15:08:53 +01:00
Richard Davey
4b1c762296 Updated @memberOf to @memberof 2018-10-10 10:49:13 +01:00
Taran van Groenigen
c841adcba4
Removed whitespaces from empty lines 2018-10-09 11:50:21 +02:00
Taran van Groenigen
af664dc699
Removed two tabs 2018-10-09 11:32:52 +02:00
Taran van Groenigen
4e2bd36ca5
A string now uses the same default values as an object passed into setFont 2018-10-09 11:28:02 +02:00
Taran van Groenigen
9a2a0ad45f
TextStyle.setStyle & TextStyle.setFont now set fontSize, fontStyle & fontFamily when font is a string
TextStyle.setFont now sets fontFamily, fontSize, and fontStyle when "font" is a string. 
TextStyle.setStyle calls TextStyle.setFont when "font" is overridden.
This fixes an issue where TextStyle.update(true) overrides TextStyle._font
2018-10-09 11:13:23 +02:00
Richard Davey
8b5d0a3af1 Text.setFont, Text.setFontFamily, Text.setFontStyle and Text.setStroke will no longer re-measure the parent Text object if their values have not changed. 2018-09-29 11:21:31 +01:00
Richard Davey
fcaa2bfc4f Completing Game Object jsdocs 2018-09-15 10:31:10 +01:00
Richard Davey
7722207dbd Remove texture deletion. 2018-09-13 13:23:24 +01:00
Richard Davey
f285cf4854 Trim the font style 2018-09-13 13:23:11 +01:00
Richard Davey
0a152949cb Added setLineSpacing method and docs. 2018-09-12 16:29:38 +01:00
Richard Davey
dedc939fdd initPipeline now defaults to the Texture Tint Pipeline if nothing else is specified. 2018-09-05 11:19:02 +01:00
Richard Davey
5b98386677 Calling Text.setStyle would make the Text vanish if you didn't provide a resolution property in the style configuration object. Calling setStyle now only changes the properties given in the object, leaving any previously changed properties as-is. Fix #4011 2018-09-04 22:43:25 +01:00
Richard Davey
27c3cc30ac Previously, changing a Text object by setting its text property directly wouldn't change the text being rendered as using setText was the expected way to change what was being displayed. Internally the text property has been renamed to _text and flagged as private, and a new getter / setter for text has been added, which hands over to the setText method, meaning you can now use both ways of setting the text. Fix #3919 2018-08-20 17:41:05 +01:00
Richard Davey
e91d95e107 Text updated to use proper texture frame and now supports crop 2018-08-03 19:07:12 +01:00
Richard Davey
ca68904953 The Canvas Renderer has a new batchSprite method that consolidates the process of drawing a texture-based Game Object to the canvas. It processes the alpha, blend mode and matrix calculations in a single function and now is used by nearly all Game Object canvas renderers. 2018-08-03 18:53:50 +01:00
Richard Davey
fc0dc13930 Removed use of currentBlendMode and currentAlpha 2018-08-03 01:53:51 +01:00
Richard Davey
9f44896a3f The Blend Mode is now set directly in all Canvas Renderers without comparing it to what's stored in the Canvas Renderer. This fixes problems where the blend mode would be lost between two different Game Objects because they restored the context, but didn't update the renderer flag. Game Objects in Canvas can now mix and match blend modes across the display list. 2018-08-03 01:29:18 +01:00
Richard Davey
106e32a4f5 Removed un-used imports 2018-07-19 13:26:11 +01:00
Richard Davey
ec5bd1912e GameObject.willRender now takes a Camera as its only argument and uses it within the check. This has allowed me to remove 23 duplicate checks spread across the various Game Objects, all of which did the same thing, saving both KB and CPU time as the flags were being checked twice in most cases. 2018-07-19 13:19:02 +01:00
Richard Davey
14ba51d928 Added Text.setResolution methods. 2018-07-18 14:45:10 +01:00
Richard Davey
94540e112e Text supports high dpi resolution for its internal canvas 2018-07-17 22:44:12 +01:00
Richard Davey
c8b058c26a Renamed object to avoid TS defs conflict 2018-07-16 10:28:28 +01:00
Richard Davey
5fdf51ce59 Using direct pipeline calls 2018-07-02 13:32:56 +01:00
Richard Davey
7a23378015 Unified use of roundPixels, antialias and pixelArt modes 2018-06-27 15:15:00 +01:00
Richard Davey
90ba2608fa Added in Camera alpha support to all canvas renderers 2018-06-25 16:24:08 +01:00