phaser/changelog/3.80/CHANGELOG-v3.80.md
2024-01-31 18:12:54 +00:00

4.8 KiB

Version 3.80.0 - Nino - in dev

New Features

  • The Scale Manager has a new scale mode called EXPAND. This is inspired by the Expand mode in Godot: "Keep aspect ratio when stretching the screen, but keep neither the base width nor height. Depending on the screen aspect ratio, the viewport will either be larger in the horizontal direction (if the screen is wider than the base size) or in the vertical direction (if the screen is taller than the original size)" (thanks @rexrainbow)

Updates

  • The TweenChainBuilder was incorrectly setting the persist flag on the Chain to true, which goes against what the documentation says. It now correctly sets it to false. This means if you previously had a Tween Chain that was persisting, it will no longer do so, so add the property to regain the feature.
  • The dropped argument has now been adeded to the documentation for the DRAG_END and GAMEOBJECT_DRAG_END events (thanks @samme)
  • Container.onChildDestroyed is a new internal method used to destroy Container children. Previously, if you destroyed a Game Object in an exclusive Container, the game object would (momentarily) move onto the Scene display list and emit an ADDED_TO_SCENE event. Also, if you added a Sprite to a non-exclusive Container and stopped the Scene, you would get a TypeError (evaluating 'this.anims.destroy'). This happened because the fromChild argument in the DESTROY event was misinterpreted as destroyChild in the Container's remove(), and the Container was calling the Sprite's destroy() again. (thanks @samme)
  • The Text and TileSprite Game Objects now place their textures into the global TextureManager and a _textureKey private string property has been added which contains a UUID to reference that texture.
  • Tilemaps.Components.WeightedRandomize now uses the Phaser Math.RND.frac method with a seed instead of the Math.Random static method. (thanks @jorbascrumps)
  • Tilemaps.Components.IsometricCullTiles does the CheckIsoBounds method check last when building the outputArray, as to help optimize in situations where the tile would not be visible anyways. (thanks @zegenie)
  • Tilemaps.Components.WeightedRandomize now uses the Phaser Math.RND.frac method with a seed instead the Math.Random static method. (thanks @jorbascrumps)
  • The Layer.removeAll, remove and add methods have been removed. These methods are all still available via the List class that Layer inherits, but the destroyChild parameters are no longer available.
  • The Renderer.Canvas and Renderer.WebGL will now only be included in the build file if the corresponding feature flags CANVAS_RENDERER and/or WEBGL_RENDERER are set to true. For Canvas only builds this saves a lot of space in the build (thanks @samme)

Bug Fixes

  • The InputManager.onTouchMove function has been fixed so it now correctly handles touch events on pages that have scrolled horizontally or vertically and shifted the viewport. Fix #6489 (thanks @somechris @hyewonjo)
  • Factory.staticBody had the wrong return type in the docs/TS defs. Fix #6693 (thanks @ddhaiby)
  • The Time.Timeline class didn't show as extending the Event Emitter, or have config as an optional argument in the docs / TS defs. Fix #6673 (thanks @ghclark2)
  • Animations.AnimationFrame#duration is now the complete duration of the frame. Before this included Animations.AnimationState#msPerFrame with the value of Animations.AnimationFrame#duration. The fix to remove Animations.AnimationState#msPerFrame from Animations.AnimationFrame#duration has been removed from Animations.AnimationManager#createFromAseprite because of this clarification. Fix #6712 (thanks @Nerodon @TomMalitz)
  • The NineSlice Game Object method setSize now recalculates its origin by calling the updateDisplayOrigin method. (thanks @dhashvir)
  • When a Layer Game Object is destroyed, i.e. from changing or restarting a Scene, it will no longer cause an error when trying to destroy the children on its display list. Fix #6675 (thanks @crockergd @gm0nk)
  • DynamicTexture will now automatically call setSize(width, height) for both WebGL and Canvas. Previously it only did it for WebGL. This fixes an issue where DynamicTextures in Canvas mode would have a width and height of -1. Fix #6682 (thanks @samme)
  • DynamicTexture.setSize will now check to see if the glTexture bound to the current frame is stale, and if so, destroy it before binding the one from the Render Target. This fixes an issue where constantly destroy and creating Dynamic Textures would cause a memory leak in WebGL. Fix #6669 (thanks @DavidTalevski)

Examples, Documentation, Beta Testing and TypeScript

My thanks to the following for helping with the Phaser 3 Examples, Beta Testing, Docs, and TypeScript definitions, either by reporting errors, fixing them, or helping author the docs:

@AlvaroEstradaDev @stevenwithaph @paxperscientiam @samme