bevy-yoleck
bevy-yoleck copied to clipboard
Add a visual marker for the selected entity
Would also be nice to mark hovered entities, to make it easier to tell what will be selected.
Since all kind of things can be selected, I don't want to use sprite/mesh/material manipulation. I can think of 3 things that would be universal(ish):
- Visibility - blink the selected entity.
- Transform - do a pulse and/or shake animation.
- Marker entity with graphics, that'll point at the selected entity.
Option 1 would be the easiest, but would probably look terrible. Option 3 would be hard to pull off, because I'll need to determine the size of the object on the screen. Also, it'll be harder
The option I like the most is option 2. I think, instead of using an animation plugin, I'll plant my own animation in CoreStage::PostUpdate after TransformSystem::TransformPropagate. There I'll change the GlobalTransform (not the Transofrm!) of the selected entity and its children.
Or even better - change the Transform before TransformPropagate but remember its value, and restore that value after it. That way GlobalTransform will just work normally.