You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(and the same for up and down)
This is currently not possible (unless your width + height are equal).
For example to wrap as I want it to work on X I can do it like this: this.physics.world.wrap(this.test, this.test.getBounds().width / 2); But then this won't work on the Y Axis.
The solution:
A third optional parameter. Like so: this.physics.world.wrap(gameObject, paddingX, paddingY)
gameObject = game object, group or array of game objects
paddingX = optional x padding, default 0
paddingY = optinal y padding, default paddingX
If approved I would like to contribute and try to implement it.
BR Geralt
The text was updated successfully, but these errors were encountered:
2nd suggestion, but this is more like thinking out loudly. What about a function that wraps the objects itself, if called. Put it for examle on the gameobjects component "transform". https://docs.phaser.io/api-documentation/namespace/gameobjects-components-transform.
Like mySprite.wrap(boundsX, boundsY, paddingX, paddingY) or something like that.
phaser/src/physics/arcade/World.js
Line 2443 in a5a56b2
When I want to wrap a sprite at the screen this way:
[.....==>]
[...........=]
[..............]
[ >.........]
[=>.......]
[==>....]
(and the same for up and down)
This is currently not possible (unless your width + height are equal).
For example to wrap as I want it to work on
X
I can do it like this:this.physics.world.wrap(this.test, this.test.getBounds().width / 2);
But then this won't work on the Y Axis.The solution:
A third optional parameter. Like so:
this.physics.world.wrap(gameObject, paddingX, paddingY)
If approved I would like to contribute and try to implement it.
BR Geralt
The text was updated successfully, but these errors were encountered: