Open StrikeForceZero opened 6 months ago
The highlighting plugin was built to support any asset type. You can add a HighlightingPlugin<Image>
, which will allow you to swap out an entity's Image
asset based on picking state. If we want to support changing properties other than assets, we should probably make a more generic highlighting plugin that can query any component on an entity. However, at this point, it sounds like it would be much simpler to implement this with an event listener.
After some experimentation, I discovered that this mod does not support highlighting sprites; it just picks them.
Or I'm failing to configure the mod correctly, but after reviewing the code; none of the systems seem to trigger because they all rely on
Handle<ColorMaterial>
when Sprites useHandle<Image>
. However, the sprites color overlay is controlled by theSprite.color
field.Should we add support for highlighting sprites?
I'd be happy to submit a PR, but this POC might be considered naive, and there's probably a better way to incorporate this.
I tried my best to maintain the expectation that it would be using
ColorMaterial
so the existing API to use or override theGlobalHighlight
or individualHighlight
is still possible.Below is my POC if interested:
POC
can be dropped into any project as a plugin that also uses the
PickingPlugin
with highlighting enabled