Phaser: Add world wrapping

Created on 4 Mar 2018  路  4Comments  路  Source: photonstorm/phaser

I would imagine:

{number} = Phaser.Geom.Rectangle.WrapX(rectangle, x)

{number} = Phaser.Geom.Rectangle.WrapY(rectangle, y)

{void}   = Phaser.Physics.Arcade.World#wrap(body)
馃挅 Feature Request

Most helpful comment

I'm happy to have this as a feature specifically in Arcade.World, but not as a method on Rectangle as it feels unrelated to geometry really.

All 4 comments

I'm happy to have this as a feature specifically in Arcade.World, but not as a method on Rectangle as it feels unrelated to geometry really.

Would Phaser.Actions.Wrap(items, rectangle) be appropriate?

I'm just thinking people might want to wrap within other boundaries as well.

Sure, it could be an Action as those are easy to exclude from custom builds, so doesn't add to the weight.

I'll try a PR.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

halilcakar picture halilcakar  路  4Comments

rootasjey picture rootasjey  路  3Comments

Secretmapper picture Secretmapper  路  3Comments

BigZaphod picture BigZaphod  路  4Comments

lc-thomas picture lc-thomas  路  4Comments