godot-wyvernbox-inventory icon indicating copy to clipboard operation
godot-wyvernbox-inventory copied to clipboard

Add overlap-check for `GroundItemStackView3D`

Open don-tnowe opened this issue 1 year ago • 0 comments

2D items have this, 3D items do not. But rather than adding overlap-checking as a GroundItemStackView3D feature, I'd rather make it a separate system, to make it centralized and allow more optimizations.

A GroundItemHUD will let a GroundItemManager register and unregister items to display. The HUD will handle input, label positioning and clicking, non-overlap, frustum culling etc. When the connected camera moves, label positions are updated - simply offset for 2D and moved with self-implemented collision-checking for 3D.

What this also means:

  • as mentioned, allows more performance optimizations;
  • it's easier to customize how the label looks - perhaps a system similar to how tooltips are customized, just slap a few scripts?
  • you could just not add the HUD node to the scene if you don't need the labels! After all, not all games with inventories have them.

don-tnowe avatar Aug 17 '23 18:08 don-tnowe