Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump phaser from 3.24.1 to 3.70.0 #62

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Nov 13, 2023

Bumps phaser from 3.24.1 to 3.70.0.

Release notes

Sourced from phaser's releases.

Phaser v3.70.0

Version 3.70.0 - Yotsuba - 10th November 2023

New Features - Round Pixels

All pixel rounding math is now handled on the GPU instead of on the CPU. This feature has now been enabled by default.

  • The Game Config roundPixels property is now true by default. This means that all Game Objects will be positioned and rendered with pixel-perfect precision, which is by far the most common use-case for Phaser games. This will prevent sub-pixelation when rendering at non-integer offsets and allows for smoother camera scrolling, especially at higher zoom scales. If you wish to disable this, you can do so by setting the roundPixels property in the Game Config to false. Note that only roundPixels has been set to true. The pixelArt property remains false. So if you're creating a pixel-art style game, please still enable this in your config.
  • All of the core vertex shaders, including Multi, Single and Mobile now have a new uniform called uRoundPixels which is set in all of the corresponding pipelines. This means that all pixel rounding calculations are now done on the GPU instead of the CPU, which can save a lot of math in intensive games.
  • CanvasRenderer.batchSprite has been updated to correctly use the Camera roundPixels property and apply it to the drawImage call.
  • Camera.preRender will no longer round the origin, follow coordinates or scrollX/Y coordinates. It will still round the World view.
  • The MultiPipeline.batchSprite method (which is also used by the Single Pipeline and Mobile Pipeline) will no longer use roundPixels when calculating the quad vertex data. It also won't apply it to any of the sprite values. This is all now handled in the shader directly.
  • TransformMatrix.setQuad no longer uses an anonymous function for roundPixels, which will help with performance.
  • The TransformMatrix.setQuad method signature has changed slightly. The roundPixels parameter is now optional and defaults to false. Previously, you always had to set it.

New Features - Texture Packer Nine Slice Support

The new version of Texture Packer (v7.1.0) and above will now allow you to export scale9 sprite data in your Phaser 3 Atlas JSON. This allows you to create Nine Slice Sprites directly from the data, without having to specify the border sizes directly in your code. To use this feature, simply edit the sprite in Texture Packer, enable the 'scale9' checkbox and then drag the guides as required. When you export the atlas, the JSON will contain the new scale9 object, which Phaser will parse and use when creating Nine Slice Game Objects.

  • You can now create a NineSlice Game Object without specifying a width or height for it. If you do this, it will use the size of the texture frame instead.
  • The NineSlice Game Object will now check to see if its associated Frame has any scale9 data set, and if so this is now used automatically to populate all of the border values.
  • The NineSlice.setSlices method has a new optional boolean parameter skipScale9 which will allow you to set the border values of the Nine Slice directly, even if its Frame has associated scale9 data
  • Frame.setScale9 is a new method that allows you to set the scale9 data associated with the given Frame. This is used internally by the Texture Packer parsers, but can also be called directly.
  • Frame.scale9 is a new read-only boolean property that returns true if the Frame has scale9 data associated with it.
  • Frame.is3Slice is a new read-only boolean property that returns true if the Frame has scale9 data associated with it that is 3-slice instead of 9-slice.
  • The JSONHash texture parser will now check for scale9 data in the JSON and if found, set it via the Frame.setScale9 method.
  • The JSONArray texture parser will now check for scale9 data in the JSON and if found, set it via the Frame.setScale9 method.

New Features - Arcade Physics

  • Arcade Physics Bodies have a new method called setDirectControl which toggles a new boolean property directControl. When enabled (it's false by default) it means the Body will calculate its velocity based on its change in position compared to the previous frame. This allows you to directly move a Body around the physics world by just changing its position, without having to use acceleration or velocity. This is useful if you want to move it via a Tween, or follow a Pointer, or a Path. Because its velocity is calculated based on this movement it will still resolve collisions with other bodies, imparting velocity to them as usual.
  • Arcade Physics Bodies have a new property called slideFactor. This is a Vector2 that controls how much velocity is retained by a Body after it has been pushed by another Body. The default value is 1, which means it retains all of its velocity. If set to zero, it will retain none of it. This allows you to create a Body that can be pushed around without imparting any velocity to it.
  • Body.setSlideFactor is a new method that sets the Body's slideFactor property.
  • The Arcade Physics World has a new method nextCategory which will create a new collision category and return it. You can define up to 32 unique collision categories per world.
  • Arcade Physics Bodies have two new properties: collisionCategory and collisionMask. These allow you to set a specific collision category and list of categories the body will collide with. This allows for fine-grained control over which bodies collide with which others. The default is that all bodies collide with all others, just like before.
  • setCollisionCategory is a new method available on Arcade Physics Bodies that allows you to set the collision category of the body. It's also available on Arcade Sprites, Images, Tilemap Layers, Groups and Static Groups directly.
  • setCollidesWith is a new method available on Arcade Physics Bodies that allows you to set which collision categories the body should collide with. It's also available on Arcade Sprites, Images, Tilemap Layers, Groups and Static Groups directly.
  • resetCollision is a new method available on Arcade Physics Bodies that allows you to reset the collision category and mask to their defaults. It's also available on Arcade Sprites, Images, Tilemap Layers, Groups and Static Groups directly.

The default is as before: all bodies collide with each other. However, by using the categories you now have much more fine-grained control over which objects collide together, or not. They are filtered out at the top-level, meaning you can have a Sprite set to not collide with a Physics Group and it will skip checking every single child in the Group, potentially saving a lot of processing time.

The new collision categories are used automatically by either directly calling the collide or overlap methods, or by creating a Collider object. This allows you to use far less colliders than you may have needed previously and skip needing to filter the pairs in the collision handlers.

New Features - FX Updates and Fixes

You can now set in your game config two new boolean properties that control if the built-in FX are enabled, or not. If you don't need to use the FX then disabling these will help save on texture memory and will compile less shaders, which can help with startup time. These are single-set flags, you cannot toggle them after the game has booted.

  • disablePreFX set this to true in your game config to disable the creation and use of Pre FX on all Game Objects.
  • disablePostFX set this to true in your game config to disable the creation and use of Post FX on all Game Objects.
  • The PipelineManager will now delay the creation of the FX Pipelines until its boot method, using these config values to determine if it should proceed.

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [phaser](https://github.com/photonstorm/phaser) from 3.24.1 to 3.70.0.
- [Release notes](https://github.com/photonstorm/phaser/releases)
- [Changelog](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md)
- [Commits](phaserjs/phaser@v3.24.1...v3.70.0)

---
updated-dependencies:
- dependency-name: phaser
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants