Phaser v3.80.0 Beta 1 #6727
photonstorm
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Version 3.80.0 - Nino - in dev
New Features
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)New Features - Base64 Loader
The Phaser LoaderPlugin and related classes have been updated so that they now work natively with base64 encoded files and Data URIs. This means you can now load a base64 encoded image, audio file or text file directly into the Loader. The Loader will then decode the data and process it as if it was a normal file. This is particularly useful for environments such as Playable Ads where you have to provide a single html file with all assets embedded and no XHR requests.
Loader.File.base64is a new read-only boolean property that is set if the file contains a Data URI encoded string.Loader.File.onBase64Loadis a new method that is called when the file has finished decoding from a Data URI.ImageFilewill now default to using the Image Load Element if a base64 file is detected, instead of throwing a console warning about unsupported types.XHRLoaderwill now return a fake XHR result object containing the decoded base64 data if a base64 file is detected, skipping the creation of a real XML Http Request object.Spine Updates
preUpdateautomatically when theplaymethod is called. This forces the new animation state to update and apply itself to the skeleton. This fixes an issue where Spine object would show the default frame in the Spine atlas for a single update before the animation started. Fix [3.50-beta13] Initial glitch in Spine animation #5443 (thanks @spayton)SpineGameObject.setSlotAlphais a new method that allows you to set the alpha on a specific slot in a Spine skeleton.SpineGameObject.setAlphamethod has had its 2nd parameter removed. This fixes needless slot look-ups during rendering when a Spine Game Object is inside a regular Container. If you need to set slot alpha, use the newsetSlotAlphamethod instead. Fix Spine gameobject setAlpha() broken #6571 (thanks @spayton)SpineFile.onFileCompletehandler was running a regular expression againstfile.srcinstead offile.url, sometimes leading to double paths in the atlas paths on loading. Fix SpinePlugin breaks generated images file path #6642 (thanks @rez23)Updates
TweenChainBuilderwas incorrectly setting thepersistflag on the Chain totrue, which goes against what the documentation says. It now correctly sets it tofalse. 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.droppedargument has now been adeded to the documentation for theDRAG_ENDandGAMEOBJECT_DRAG_ENDevents. (thanks @samme)Container.onChildDestroyedis 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)TextandTileSpriteGame Objects now place their textures into the globalTextureManagerand a_textureKeyprivate string property has been added which contains a UUID to reference that texture.Tilemaps.Components.WeightedRandomizemethod now uses the PhaserMath.RND.fracmethod with a seed instead of theMath.Randomstatic method. (thanks @jorbascrumps)Tilemaps.Components.IsometricCullTilesdoes theCheckIsoBoundsmethod check last when building the outputArray, as to help optimize in situations where the tile would not be visible anyways. (thanks @zegenie)Tilemaps.Components.WeightedRandomizenow uses the PhaserMath.RND.fracmethod with a seed instead theMath.Randomstatic method. (thanks @jorbascrumps)LayerGame Object has had itsremoveAll,removeandaddmethods removed. These methods are all still available via theListclass that Layer inherits, but thedestroyChildparameters are no longer available.Renderer.CanvasandRenderer.WebGLwill now only be included in the build file if the corresponding feature flagsCANVAS_RENDERERand/orWEBGL_RENDERERare set totrue. For Canvas only builds this saves a lot of space in the build. (thanks @samme)autoResizeboolean in theRenderTargetConfigwhich is passed to the Render Targets when they are created by a pipeline.UtilityPipelinenow setsautoResizetotruein its Render Target Config, so that the globalfullFrameandhalfFrameRender Targets will automatically resize if the renderer changes.Actions.PlaceOnLinenow has an addedeaseparameter which accepts a string from the EaseMap or a custom ease function to allow for different distrubutions along a line. (thanks @sB3p)XHRLoaderwill now listen forontimeoutand if triggered it will hand over to theFile.onErrorhandler. This prevents the Loader from stalling if a file times out. Fix LoaderPlugin XHR timeout is not handled #6472 (thanks @343dev)Bug Fixes
InputManager.onTouchMovefunction has been fixed so it now correctly handles touch events on pages that have scrolled horizontally or vertically and shifted the viewport. Fix Pointermove issue after scrolling on mobile page in 3.60.0 version #6489 (thanks @somechris @hyewonjo)Factory.staticBodyhad the wrong return type in the docs/TS defs. Fix Factory.staticBody wrong return type description (body instead of staticbody) #6693 (thanks @ddhaiby)Time.Timelineclass didn't show as extending the Event Emitter, or haveconfigas an optional argument in the docs / TS defs. Fix Typedefs for new Phaser.Time.Timeline don't show it extending eventEmitter #6673 (thanks @ghclark2)Animations.AnimationFramememberdurationis now the complete duration of the frame, which is a breaking change. Before thisAnimations.AnimationState#msPerFramewas combined withAnimations.AnimationFrame#durationwhich wasn't intuitive. The fix to removeAnimations.AnimationState#msPerFramefromAnimations.AnimationFrame#durationhas been removed from theAnimations.AnimationManagermethodcreateFromAsepritebecause of this clarification. Fix When providing frames with duration to anims.create(), 41.6ms is added to every frame (1 frame time @24 FPS) #6712 (thanks @Nerodon @TomMalitz)NineSliceGame Object methodsetSizenow recalculates its origin by calling theupdateDisplayOriginmethod. (thanks @dhashvir)LayerGame 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 GameObjects added to Layers are destroyed twice on Scene shutdown causing crashes #6675 (thanks @crockergd @gm0nk)DynamicTexturewill now automatically callsetSize(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 Dynamic Texture fill fails in Canvas mode #6682 (thanks @samme)DynamicTexture.setSizewill now check to see if theglTexturebound 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 destroying and creating Dynamic Textures would cause a memory leak in WebGL. Fix Phaser 3.70 reintroduced the dynamic texture memory leak #6669 (thanks @DavidTalevski)BloomFXandBlurFXand any custom pipeline that relies on using theUtilityPipelinefull or half frame targets will now correctly draw even after the renderer size changes. Fix Post FX Bloom does not take into account canvas Resize #6677 (thanks @Nerodon)PostFXPipeline.postBatchmethod will now skiponDrawif the pipeline hasn't booted, introducing an artificial frame skip. This should potentially fix glitch errors on mobile devices where Post FX would appear corrupted for a single frame. Fix First frame of PostFX pipeline displays glitches #6681 (thanks @moufmouf @tongliang999)Matter.Bodyfunctionscalehas been updated so if the Body originally had aninertiaofInfinitythis will be restored at the end of the call. This happens if you set a Matter Body to have fixed rotation. Fix setScale on matter bodies is resetting fixedRotation #6369 (thanks @sushovande)RandomDataGenerator.weightedPickmethod to avoid sampling past the last element. Fix weightedPick sometimes returns undefined #6701 (thanks @jameskirkwood)onTouchEndWindownow stops pointer events when clicking through DOM elements to input. Fix Repeated Pointer Events in Phaser with Overlapping HTML Elements #6697 (thanks @laineus)Physics.Matter.FactorymethodpointerConstraintno longer returns an error when it can't find the camera. Fix Mousespring causes an error when clicking off scene #6684 (thanks @spritus)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
@actionmoon
@rafael-lua
@Byvire
This discussion was created from the release Phaser v3.80.0 Beta 1.
Beta Was this translation helpful? Give feedback.
All reactions