Skip to content

Thoughts on binding body velocity? #5

@pradeeproark

Description

@pradeeproark

@evilfer
I was wondering whether it was possible to expose velocity property in sprite body for binding. So you can bind it to state values instead of directly setting it on context nodes.

I noticed that you have exposed body properties as prefixed properties https://github.com/evilfer/react-phaser/blob/master/src/impl/properties/custom/body.js#L9-L10

How do you extend this to support velocity which it itself a object with x/y properties.?

Also is it possible to have body as a nested property of sprite with all attributes of physics body exposed on it instead of using prefixed approach.

<sprite>
<body>
   <velocity x={this.state.playerXVelocity}/>
</body>
</sprite>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions