Commit graph

245 commits

Author SHA1 Message Date
Richard Davey
a21641e19b The Dynamic Bitmap Text Game Object WebGL Renderer function has been updated to support multi-texture units. 2020-07-15 16:54:04 +01:00
Richard Davey
50f10b3d4b The Bitmap Text Game Object WebGL Renderer function has been updated to support multi-texture units. 2020-07-15 16:53:48 +01:00
Richard Davey
dc13060042 Fixed namespace 2020-07-14 09:45:37 +01:00
Richard Davey
40929a57e3 Calling getTextBounds on a BitmapText object would return the incorrect values if the origin had been changed, but the text itself had not, as it was using out of date dimensions. Changing the origin now automatically triggers BitmapText to be dirty, forcing the bounds to be refreshed. Fix #5121 2020-07-13 14:06:06 +01:00
Jason Kwok
401cb81590 Fixed this return type for Phaser.GameObjects.DynamicBitmapText 2020-01-26 20:16:18 +08:00
Richard Davey
ff65e69cd1 Changed copyright date to 2020 2020-01-15 12:07:09 +00:00
Javier García Álvarez
9d418eae73 Fixed jsdoc types to get TS definition intellisense. 2019-12-18 12:25:14 +01:00
Javier García Álvarez
e1d288a834 Add optional params to ParseFromAtlas doc 2019-12-18 12:22:30 +01:00
Richard Davey
7650c5535f BitmapText with a maxWidth set wouldn't update the text correctly if it was modified post-creation. You can now update the text and/or width independantly and it'll update correctly. Fix #4881 2019-11-26 14:31:27 +00:00
Richard Davey
4a33c7b5c8 Don't reset text 2019-11-22 16:43:13 +00:00
Richard Davey
a7b3cd585d Tidying up 2019-11-22 16:42:53 +00:00
Richard Davey
0d46c7107a Fixed issue with carriage-returns not reflowing text 2019-11-22 16:42:43 +00:00
Richard Davey
4435791cc1 Updated to use current null approach 2019-11-22 13:54:07 +00:00
Richard Davey
28982fb7fc Fixed word wrapping 2019-11-22 13:48:10 +00:00
Richard Davey
b297950875 Added wordWrapCharCode 2019-11-22 13:48:01 +00:00
Richard Davey
5b1401153c Working through BitmapText wrapping 2019-11-21 17:11:43 +00:00
Richard Davey
c60530eedd Removed commented-out code 2019-10-11 18:35:27 +01:00
Richard Davey
be02c80be9 Origin and canvas renderer work again now. Fix #4108 2019-10-01 17:43:47 +01:00
Richard Davey
c91ed91ce3 License link update 2019-05-10 16:15:04 +01:00
Richard Davey
b09ddc9048 GameObject Types 2019-05-09 12:01:00 +01:00
Richard Davey
a51a81791f Bitmap Text Types 2019-05-09 11:54:43 +01:00
J.C
b6047df1b5
flag which version has this method 2019-04-30 23:29:28 +08:00
J.C
8c3de0897e expose ParseXMLBitmapFont for combined XML font file 2019-04-30 19:31:47 +08: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
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
4e817497d4 Namespace fixes 2019-02-12 12:48:41 +00:00
J.C
cb0f3e079c add doc for the static method. BTW: have to admit that Phaser is absolutely well considered, even for such case that user probably make all BMFont atlas combined into one. 2019-01-25 11:02:38 +08:00
Richard Davey
aa341854c7 Happy New Year 2019-01-15 16:20:22 +00:00
Richard Davey
5c6d1cbe17
Merge pull request #4214 from matosummer/master
Add link to bitmaptext
2018-12-12 11:27:00 +00:00
Richard Davey
4b27b37a0c Added texture and unit arguments to batchQuad and batchTri, fixing the y2k bug. 2018-12-12 11:08:52 +00:00
Mato
87be97aaf0
Add link to bitmaptext 2018-12-05 16:29:18 +07:00
Richard Davey
6f8759c186 Whenever Camera.roundPixels was enabled it would use a bitwise operation to truncate the float (x |= 0) - this has been replaced across all files that used it, with a call to Math.round instead. This gives far better results when zooming cameras both in and out of a Scene, stopping thin gaps appearing between closely packed Game Objects. 2018-11-30 10:27:25 +00:00
Richard Davey
b0df6892b5 The Canvas SetTransform method would save the context state, but it wasn't restored at the end in the following Game Objects: Dynamic Bitmap Text, Graphics, Arc, Curve, Ellipse, Grid, IsoBox, IsoTriangle, Line, Polygon, Rectangle, Star and Triangle. These now all restore the context, meaning if you're using non-canvas sized cameras in Canvas mode, it will now render beyond just the first custom camera. 2018-11-27 13:54:59 +00:00
Richard Davey
7441ff90ae The Dynamic Bitmap Text Canvas Renderer was creating a new data object every frame for the callback. It now uses the callbackData object instead, like the WebGL renderer does. 2018-10-25 14:11:23 +01:00
Richard Davey
4c73be9dbd The data object being sent to the Dynamic Bitmap Text callback now has a new property parent, which is a reference to the Bitmap Text instance that owns the data object (thanks ornyth) 2018-10-25 14:10:12 +01:00
Richard Davey
4b1c762296 Updated @memberOf to @memberof 2018-10-10 10:49:13 +01:00
Richard Davey
a9063604dc Replace @readOnly with @readonly 2018-10-09 13:40:00 +01:00
Richard Davey
fcaa2bfc4f Completing Game Object jsdocs 2018-09-15 10:31:10 +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
TadejZupancic
7992924aae
Wrong bounds/displayTextOrigin on BitmapText text change
updateDisplayOrigin needs current width and height, which are not recalculated if the _dirty is not set to true.
2018-08-14 12:15:59 +02:00
Richard Davey
84ef115c67 Remove un-used code 2018-08-08 15:01:41 +01:00
Charles Burnham
6a1c677677 Add lineSpacing option to RetroFont Config 2018-08-04 12:52:27 -05:00
Richard Davey
708a857a26 SetTransform is a new Canvas Renderer function that consolidates the process of preparing a Game Object for rendering, without actually rendering it. This is used internally by the Graphics and Bitmap Text classes. 2018-08-03 19:02:43 +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
4481795d32 Swapped to using getX / getY 2018-07-27 00:53:00 +01:00
Richard Davey
8873bdcbf6 Fixed pipeline method call 2018-07-26 23:50:54 +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
51f94cd444 Merge branch 'master' of https://github.com/photonstorm/phaser 2018-07-11 16:25:26 +01:00
Richard Davey
5ba80defb7 Pass GO to setPipeline 2018-07-11 16:23:44 +01:00
Chris Andrew
0858797599 Minor documentation fix for BitmapText.getTextBounds(). 2018-07-11 14:50:23 +01:00
Richard Davey
9c9e9cecbb Updated log and lint fixes 2018-07-10 16:49:53 +01:00
Richard Davey
5fe74453fe Extends BitmapText, to save on lots of space 2018-07-10 16:33:13 +01:00
Richard Davey
e145b6b7d3 Fixed Dynamic Bitmap Text Rendering 2018-07-10 16:33:01 +01:00
Richard Davey
434c8d1413 Fixed issue with sprite matrix and camera scaling 2018-07-10 13:59:49 +01:00
Richard Davey
6560f51699 Added jsdocs and updated change log 2018-07-09 22:35:48 +01:00
Richard Davey
39c05e4a96 Added support for BitmapText alignment and internal dirty flag for calculation speed 2018-07-09 21:57:51 +01:00
Richard Davey
f892d97475 Removed indexCount 2018-07-09 17:06:36 +01:00
Richard Davey
2d313ac927 The start of adding multi-line alignment 2018-07-09 17:06:20 +01:00
Richard Davey
f266acecc2 Re-uses the bounds object, rather than re-creating constantly. 2018-07-09 17:06:06 +01:00
Richard Davey
a16a7457bc Now stores the line data in the bounds object. 2018-07-09 17:05:53 +01:00
Richard Davey
a3803a286f Fixed origin addition post-scale 2018-07-09 16:17:52 +01:00
Richard Davey
91a48c30c4 GetBitmapTextSize, which is used internally in the BitmapText Game Objects, will now produce different bounds from the previous version. Previously, the bounds were tight against the letters in the text. However, this meant the bounds were not properly aligned with the origin of the BitmapText, and consequently you'd get different bounds if the text consisted of different characters. The bounds are now calculated purely based on the glyph data and letter spacing values. This will give a far more consistent overall experience, but it does mean if you were using the bounds to position text previously, you'll need to revisit that code again. See issue #3799 for more details (and to discuss this further if you wish) 2018-07-09 16:06:36 +01:00
Richard Davey
5c554f3f69 Started moving dynamic bitmap text renderer to its own function 2018-07-07 12:34:24 +01:00
Richard Davey
dd0490dd57 Removed batchBitmapText, tidied up and moved to its own renderer 2018-07-07 12:22:45 +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
Richard Davey
5a0fe89a7e Swap _id to id 2018-06-23 12:26:39 +01:00
Chris Andrew
a6b8b8ed31 Documented the Text game object and its TextStyle companion.
Minor update to JSON representation descriptions.
2018-06-14 14:27:58 +01:00
Richard Davey
9d52b6ac91 Fixed jsdoc errors 2018-06-12 17:05:39 +01:00
Chris Andrew
39ace6c9e9 Finished all BitmapText descriptions, other than GameObject class descriptions. 2018-06-06 17:34:18 +01:00
Chris Andrew
fb33fd045d Documented DynamicBitmapText display callbacks.
Finished up some DynamicBitmapText related descriptions.

Removed the align property from BitmapTextConfig, as it's not used.
2018-06-06 17:26:55 +01:00
Chris Andrew
79c3242c68 Tweaked and filled in a few more BitmapText related descriptions. 2018-06-06 16:58:48 +01:00
Chris Andrew
c9d4ff9f83 Fixed case of @readOnly annotations in BitmapText and DynamicBitmapText. 2018-06-06 16:34:49 +01:00
Chris Andrew
96d750bb60 Documented BitmapText and DynamicBitmapText.
Moved BitmapFontData typedefs to the BitmapText class file.
2018-06-06 16:32:58 +01:00
Chris Andrew
25f1dedb74 Started documenting Bitmap Font data structures. 2018-06-06 15:12:12 +01:00
Chris Andrew
a90e78d0a9 Finished UpdateList and RetroFont.Config documentation. 2018-06-06 15:11:40 +01:00
Chris Andrew
4aaf071ad3 Cleaned up some previous documentation, finished the RenderTexture GameObject documentation. 2018-06-06 14:23:39 +01:00
Chris Andrew
9e49b30d31 Fixed @return annotation spacing for GetBitmapTextSize. 2018-06-01 15:32:03 +01:00
Chris Andrew
085efa3190 Fixed a couple of BitmapTextSize descriptions. 2018-06-01 15:28:00 +01:00
Chris Andrew
8a7f381a28 Improved some GetBitmapTextSize descriptions. 2018-06-01 15:25:16 +01:00
Chris Andrew
efaff363aa Documented XML Bitmap Font parsing and the GetBitmapTextSize function. 2018-06-01 15:21:10 +01:00
Richard Davey
0d0846a415 Calling a creator, such as GraphicsCreator, without passing in a config object, would cause an error to be thrown. All Game Object creators now catch against this. 2018-05-16 15:17:08 +01:00
Richard Davey
107ca71d6b BitmapText, both static and dynamic, can now take any data-type, including numbers, for the text argument in the constructor. Before they only worked via setText 2018-05-03 15:52:12 +01:00
Richard Davey
28251fd0f5 addToScene added to all Game Object Creators 2018-05-02 10:57:26 +01:00
Richard Davey
606ba6d8d7 Added new Mask component and added to all relevant Game Objects 2018-04-20 18:57:49 +01:00
Richard Davey
6299019838 Updated to use typeof DefinePlugin check. 2018-04-20 00:23:24 +01:00
Richard Davey
e14d0c5054 eslint fixes 2018-04-19 13:57:33 +01:00
Richard Davey
cb4eb9e435 Rescoped RetroFont so it's no longer bound to BitmapText 2018-04-19 13:07:59 +01:00
Richard Davey
5b31a51dd5 Rescoped 2018-04-19 12:42:35 +01:00
Richard Davey
32ce8d7947 jsdoc fixes and removed un-used ResetKey file. 2018-04-19 12:30:38 +01:00
Richard Davey
23f353326c jsdoc fix 2018-04-18 13:48:25 +01:00
Richard Davey
6e77557375 jsdoc fixes 2018-04-18 13:34:22 +01:00
Richard Davey
b0544c73b8 jsdoc fixes 2018-04-18 13:29:22 +01:00
Richard Davey
18585de81d Lots of jsdoc fixes 2018-04-16 14:43:24 +01:00
Richard Davey
ce7d67297f Moving from 3.4.1 to 3.5.0 so we can release new camera fx and scene transitions 2018-04-15 12:44:47 +01:00
Antriel
6be6f17bfd Add missing letterSpacing to DynamicBitmapText 2018-04-13 10:50:18 +02:00
Felipe Alfonso
c232642a52 Parent matrix is applied to canvas context on each draw function 2018-04-04 14:05:59 -03:00
Felipe Alfonso
96b8db4685 Added parentMatrix to all canvas rendering functions 2018-04-04 13:14:55 -03:00
Felipe Alfonso
bea7ca36ad Merge branch 'master' into containers
# Conflicts:
#	src/renderer/webgl/pipelines/TextureTintPipeline.js
2018-04-04 12:07:41 -03:00
Richard Davey
96507beda1 Added setLetterSpacing method and exported value in toJSON (#3480) 2018-04-04 11:34:39 +01:00
Travis O'Neal
2ec70cac48 Added a letterSpacing property to BitmapText 2018-04-02 09:42:24 -04:00
Travis O'Neal
43ea5f239c
Updated @since to the appropriate version 2018-03-30 14:07:28 -04:00
Travis O'Neal
d6265a59dd Initial Commit 2018-03-30 13:46:44 -04:00
Felipe Alfonso
e0f678d1ff Merge branch 'master' into containers 2018-03-28 20:49:00 -03:00
Richard Davey
747f09af86 jsdoc fixes 2018-03-28 15:04:09 +01:00
Richard Davey
f10efda8f0 font is non-optional, so removed coordinates as optional 2018-03-28 12:05:03 +01:00
Felipe Alfonso
d544701495 parentMatrix added to individual game object render function 2018-03-27 14:49:09 -03:00
orblazer
ae0b3b841b Fix types on GameObjects 2018-03-27 14:52:58 +02:00
Richard Davey
0ef92e1172 Merge branch 'pr/3439' 2018-03-21 16:06:56 +00:00
Richard Davey
db613c793a Merge branch 'master' of https://github.com/photonstorm/phaser 2018-03-21 03:17:00 +00:00
Richard Davey
786d181a91 Sorted the components 2018-03-21 03:16:49 +00:00
orblazer
5a518f2e5f Fix "object" types on Camera and GameObjecs 2018-03-20 23:28:26 +01:00
orblazer
87633fdfad Fix multiple types on GameObjects 2018-03-20 15:56:31 +01:00
orblazer
b4a30b8e43 Add callbacks on GameObjects 2018-03-19 22:27:16 +01:00
orblazer
bf630f7d57 Fix types in JSDocs 2018-03-19 19:49:14 +01:00
orblazer
90def456f2 Update JSDoc on GameObjects 2018-03-19 12:54:31 +01:00
Richard Davey
05a4385cd7 jsdoc fixes 2018-03-16 17:29:39 +00:00
Richard Davey
19a17bcf63 Updating docs 2018-03-15 17:27:30 +00:00
Richard Davey
935a89342d Calling setText on a BitmapText object will now recalculate its display origin values. Fix #3350 2018-03-09 17:08:12 +00:00
Richard Davey
9a561ff385 Added roundPixels support to BitmapText canvas 2018-02-28 23:07:30 +00:00
Richard Davey
8ae3493296 setText updates
BitmapText.setText will check if the value given is falsey but not a zero and set to an empty string if so.
BitmapText.setText will now cast the given value to a string before setting.
BitmapText.setText will not change the text via `setText` unless the new text is different to the old one.
2018-02-27 15:14:03 +00:00
Felipe Alfonso
4b9b4c91a3 Dynamic BitmapText's origin is used on rendering the text 2018-02-19 18:20:30 -03:00
Felipe Alfonso
41bcaba43a Dynamic BitmapText now uses origin component to render the text. 2018-02-19 18:16:57 -03:00
Richard Davey
50dac412be eslint fixes and console removal 2018-02-16 19:08:50 +00:00
Richard Davey
86f00eeb52 eslint fixes 2018-02-16 18:17:51 +00:00
Richard Davey
d1f5f8a82b Added jsdocs 2018-02-12 16:01:21 +00:00
Richard Davey
40689d1e35 Updated jsdocs. 2018-02-07 15:27:21 +00:00
Richard Davey
a8eae2bab7 Added jsdocs 2018-02-05 23:59:51 +00:00
Richard Davey
d457373287 Added Depth component and tidied up redundant parts of Transform 2018-02-01 00:50:15 +00:00
Richard Davey
950a125d71 Added jsdocs 2018-02-01 00:04:45 +00:00
Felipe Alfonso
71a6360a7b Pipeline components added 2018-01-29 18:46:48 -03:00
Felipe Alfonso
06fa0afcc8 Dynamic Bitmap Text webgl rendering 2018-01-24 15:55:23 -03:00
Felipe Alfonso
502ce8ddea Static BitmapText rendering. Added rect culling to TextureTintPipeline 2018-01-23 20:36:49 -03:00
Felipe Alfonso
2b043fff65 Removed RenderTarget and Shader from components 2018-01-22 18:53:15 -03:00
Felipe Alfonso
4983b393e3 Merge with master 2018-01-17 18:30:39 -03:00
Richard Davey
f9a7939812 Lots of work migrating to the new plugin system, fixing references and exposing on the namespace 2018-01-16 22:28:29 +00:00
Felipe Alfonso
fd4f441146 DynamicBitmapText WebGL renderer updated 2018-01-16 16:32:27 -03:00
Richard Davey
d8f1ba03e9 Moved repository location 2018-01-09 21:43:56 +00:00
Richard Davey
0d90f75b5f Splitting the dev branch up into versions. 2016-11-22 01:36:56 +00:00
Richard Davey
0af16817a5 Refactored GameObjects to GameObject. 2016-10-09 22:27:58 +01:00
Richard Davey
380e717e52 Finished off missing factories. Moved over the docs. Changed rogue @returns to @return everywhere. 2016-10-08 16:17:46 +01:00
Richard Davey
6d0dc5e003 Added BitmapText Factory. 2016-10-08 13:18:35 +01:00
Richard Davey
729020477a New Game Objects structure in place, and starting to take shape.
Moved BitmapData and RenderTexture into the textures folder for now.

All Game Objects now have their own sub-folder, with their Factory and renderer functions alongside them, plus any other files they need.

New Factory class added. Currently hooked into `game.factory` for testing, but will swap to `game.add` when complete.
2016-10-08 03:05:42 +01:00