Commit graph

2232 commits

Author SHA1 Message Date
Richard Davey
0bbe67dafd When using the GameObjectCreator for Containers you can now specify the children property in the configuration object. 2020-08-25 15:51:11 +01:00
Richard Davey
7e572c3577 Improves JSDocs 2020-08-25 09:54:09 +01:00
Richard Davey
157be83f7c The Container will now test to see if any Game Object added to it is already on the display list, or not, and emit its ADDED and REMOVED events accordingly. Fix #5267 #3876 2020-08-24 19:26:19 +01:00
Richard Davey
3bd91ea3de Update ParticleManagerCreator.js 2020-08-24 19:24:11 +01:00
Richard Davey
a9072cadf2 Sprite, Rope, ParticleEmitterManager, Extern and DOMElement now all override the addedToScene and removedFromScene callbacks to handle further set-up tasks. 2020-08-24 19:24:02 +01:00
Richard Davey
f4259deb37 DOMElementFactory, ExternFactory, ParticleManagerFactor, RopeFactory and SpriteFactory all no longer add the objects to the Update List, this is now handled by the ADDED events instead. 2020-08-24 19:22:58 +01:00
Richard Davey
7b83d31cae The Update List now uses the new checkQueue property to ensure no duplicate objects are on the active list. 2020-08-24 19:21:35 +01:00
Richard Davey
19c4980c5b GameObjectFactory.events is a new property that references the Scene's Event Emitter. This is now used internally. 2020-08-24 19:20:20 +01:00
Richard Davey
0b9dd4aae7 GameObjectCreator.events is a new property that references the Scene's Event Emitter. This is now used internally. 2020-08-24 19:19:19 +01:00
Richard Davey
671c92e450 Added addedToScene and removedFromScene methods
* `GameObject.addedToScene` is a new method that custom Game Objects can use to perform additional set-up when a Game Object is added to a Scene. For example, Sprite uses this to add itself to the Update List.
* `GameObject.removedFromScene` is a new method that custom Game Objects can use to perform additional tear-down when a Game Object is removed from a Scene. For example, Sprite uses this to remove themselves from the Update List.
* Game Objects no longer automatically remove themselves from the Update List during `preDestroy`. This should be handled directly in the `removedFromScene` method now.
2020-08-24 19:18:29 +01:00
Richard Davey
bc93416ec7 Added events property and new add and remove callbacks
* `DisplayList.events` is a new property that references the Scene's Event Emitter. This is now used internally.
* `DisplayList.addChildCallback` is a new method that overrides the List callback and fires the new ADDED events.
* `DisplayList.removeChildCallback` is a new method that overrides the List callback and fires the new REMOVED events.
2020-08-24 19:15:53 +01:00
Richard Davey
ae4ed0ac54 Expose the new events 2020-08-24 19:13:18 +01:00
Richard Davey
98cd70cd6c GameObjects.Events.REMOVED_FROM_SCENE is a new event, emitted by a Game Object, when it is removed from a Scene, or a Container that is part of the Scene. 2020-08-24 19:11:22 +01:00
Richard Davey
ef91518da5 GameObjects.Events.ADDED_TO_SCENE is a new event, emitted by a Game Object, when it is added to a Scene, or a Container that is part of the Scene. 2020-08-24 19:10:50 +01:00
Richard Davey
1766f66984 Update JSDocs 2020-08-24 14:58:24 +01:00
Richard Davey
0dd07333af Updated to use MultiPipeline 2020-08-21 16:14:59 +01:00
Richard Davey
ed33253fb1
Merge pull request #5235 from mk360/text-padding
[types] allow Text#setPadding to receive an object
2020-08-20 10:04:35 +01:00
Richard Davey
c98a43c9d4
Merge pull request #5258 from khasanovbi/font
Allow to pass font in TextStyle
2020-08-20 10:03:02 +01:00
Richard Davey
ab605eed78 Remove false import 2020-08-19 13:19:07 +01:00
Richard Davey
b1b8a74cf9 RenderTexture.fill would fail to fill the correct area under WebGL if the RenderTexture wasn't the same size as the Canvas. It now fills the given region properly. 2020-08-19 13:14:36 +01:00
mk360
748e699d43 update setPadding jsdoc 2020-08-10 08:21:26 +03:00
Bulat Khasanov
8e1b5e757d Allow to pass font in TextStyle 2020-08-09 23:34:31 +03:00
Richard Davey
e77639561b Use charIndex, not i 2020-08-06 17:06:10 +01:00
Richard Davey
6aaf54e8a7 Don't add frame if empty 2020-08-05 14:15:01 +01:00
Richard Davey
96a64eae4e ParseXMLBitmapFont has a new optional parameter texture. If defined, this Texture is populated with Frame data, one frame per glyph. This happens automatically when loading Bitmap Text data in Phaser. 2020-08-05 12:46:28 +01:00
Richard Davey
a2c9c3cef6 Fix char right adjustment 2020-08-05 11:48:25 +01:00
Richard Davey
00e5c5fe0f Update BitmapTextSize.js 2020-08-04 11:25:10 +01:00
Richard Davey
ee01d36918 Update BitmapTextCharacter.js 2020-08-04 11:25:07 +01:00
Richard Davey
1db3ba72f8 Cache shadow values 2020-08-04 11:25:03 +01:00
Richard Davey
50dcc624df Get Character using char top, right and bottom 2020-08-04 11:24:56 +01:00
Richard Davey
1ae0cfc619 Include char top, right and bottom values 2020-08-04 11:24:43 +01:00
samme
981a4b1a0a Rename all setInteractive() arguments, and docs 2020-08-03 13:33:30 -07:00
Richard Davey
111a4e1ce2 Calling Rectangle.setSize() wouldn't change the underlying geometry of the Shape Game Object, causing any stroke to be incorrectly rendered after a size change. 2020-08-03 17:54:29 +01:00
Richard Davey
47a62cd30c If you apply setSize to the Dynamic BitmapText the scissor is now calculated based on the parent transforms, not just the local ones, meaning you can crop Bitmap Text objects that exist within Containers. Fix #4653 2020-08-03 11:33:41 +01:00
Richard Davey
2f574070d5 Setting the color value in the DynamicBitmapText.setDisplayCallback would inverse the red and blue channels if the color was not properly encoded for WebGL. It is now encoded automatically, meaning you can pass normal hex values as the colors in the display callback. Fix #5225 2020-08-03 10:53:27 +01:00
Richard Davey
ec845ce015 Use GetColorFromValue 2020-08-03 10:49:05 +01:00
Richard Davey
0266c7f0a2 Updated docs #5231 2020-08-03 10:37:01 +01:00
Richard Davey
da05cfa1ad
Merge pull request #5244 from 16patsle/Fix_Text_types
Fix types for Text, TextFactory and TextCreator
2020-08-03 10:20:40 +01:00
Richard Davey
c9330fd469
Merge pull request #5241 from samme/docs/add-existing
Docs: generic return for add.existing()
2020-08-03 10:19:42 +01:00
Patrick Sletvold
edf0c17703
Use TextPadding type in Text game object 2020-08-01 13:35:02 +02:00
Patrick Sletvold
87e8eba213
Correctly type style in TextFactory 2020-08-01 13:34:37 +02:00
Patrick Sletvold
a525e43dcf
Add TextConfig type for TextCreator 2020-08-01 13:34:07 +02:00
Richard Davey
42d6456993 Encode dropshadow color 2020-08-01 11:24:26 +01:00
Richard Davey
959645d1f0 Always render drop shadow behind text 2020-08-01 11:24:15 +01:00
Richard Davey
22e8d22e3f BitmapText.setWordTint is a new method that allows you to set a tint color (either additive, or fill) on all matching words within a static Bitmap Text. You can specify the word by string, or numeric offset, and the number of replacements to tint. 2020-07-31 18:36:27 +01:00
Richard Davey
b9407967e3 If you give an invalid Bitmap Font key, the Bitmap Text object will now issue a console.warn. 2020-07-31 18:00:31 +01:00
Richard Davey
79e985dd93 Updated docs 2020-07-31 17:09:40 +01:00
Richard Davey
c0109c1ec9 BatchChar is a new internal private function for batching a single character of a Bitmap Text to the pipeline. 2020-07-31 16:54:29 +01:00
Richard Davey
2e378b68d1 Apply the dropShadow 2020-07-31 16:39:21 +01:00
Richard Davey
c228dd596a BitmapText.setDropShadow is a new method that allows you to apply a drop shadow effect to a Bitmap Text object. You can set the horizontal and vertical offset of the shadow, as well as the color and alpha levels. Call this method with no parameters to clear a shadow. 2020-07-31 16:39:05 +01:00