There are some game objects that aren't offered as Arcade* variants from Phaser that can still be opted-in via game.physics.add.existing.
Possible solutions:
A physics prop, being either arcade or matter that calls the appropriate physics adding method. The problem with this would be correctly getting the appropriate props in typescript and the underlying applyProps methods.
An <ArcadePhysics /> component that can be placed inside any GameObject component. This would allow proper typing and application of props for Arcade, and the same for Matter with an <MatterPhysics />.
re: https://github.com/mattjennings/react-phaser-fiber/issues/25#issuecomment-612120893
There are some game objects that aren't offered as
Arcade*
variants from Phaser that can still be opted-in viagame.physics.add.existing
.Possible solutions:
A
physics
prop, being eitherarcade
ormatter
that calls the appropriate physics adding method. The problem with this would be correctly getting the appropriate props in typescript and the underlying applyProps methods.An
<ArcadePhysics />
component that can be placed inside any GameObject component. This would allow proper typing and application of props for Arcade, and the same for Matter with an<MatterPhysics />
.