Open simbleau opened 2 months ago
I'm switching from natively serialized inputs to leafwing, and I realized that the ActionLike macro removes the ability to push data with your inputs.
ActionLike
Before I had something like this:
enum Inputs { MovingTo(x: 32, y: 32), MoveUp, MoveDown, ... Standing(dir: f32) }
However, since ActionLike requires Hash, it greatly limits my ability to derive ActionLike on Inputs.
Hash
Inputs
Specifically, in my game, imagine it's like League of Legends where you click on the screen, and that sends a MovingTo(x, y) input.
MovingTo(x, y)
How does one accomplish this with Leafwing?
You should call ActionState::set_axis_pair, and store that information in the ActionState struct associated with your MovingTo variant :) This would be a good example though, so I'm going to leave this open.
ActionState::set_axis_pair
ActionState
MovingTo
I'm switching from natively serialized inputs to leafwing, and I realized that the
ActionLike
macro removes the ability to push data with your inputs.Before I had something like this:
However, since
ActionLike
requiresHash
, it greatly limits my ability to deriveActionLike
onInputs
.Specifically, in my game, imagine it's like League of Legends where you click on the screen, and that sends a
MovingTo(x, y)
input.How does one accomplish this with Leafwing?