bevy-yoleck icon indicating copy to clipboard operation
bevy-yoleck copied to clipboard

Add a visual marker for the selected entity

Open idanarye opened this issue 3 years ago • 1 comments

Would also be nice to mark hovered entities, to make it easier to tell what will be selected.

idanarye avatar Jun 07 '22 09:06 idanarye

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):

  1. Visibility - blink the selected entity.
  2. Transform - do a pulse and/or shake animation.
  3. 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.

idanarye avatar Jun 07 '22 12:06 idanarye