Mouse Clicking on Inventory (Blueprint)

Hey guys,

I’ve set up an inventory HUD system using the simple canvas interface (Draw HUD). I’ve got the HUD displaying properly and I’ve enabled mouse events, click events and mouse over events.

My question is that I’m trying to change the appearance of a single HUD item (in this case I’m just using Draw Rect for simplicity) when the mouse hovers over it.

I see the Event Actor Begin Cursor Over node, but that’s assuming my actor is the entire HUD blueprint and I’m just trying to grab a single rectangle that’s drawn to the screen.

I’m checking the Blueprint Mouse Interaction demo for mouse info, and it works great for assets that have their own blueprints but doesn’t (to my knowledge) mention anything about HUD elements.

Anyone know how to determine if the mouse is overlapping a HUD element that’s being drawn?

Thanks!

I haven’t done this myself, but do you draw the HUD items after you draw the Inventory?

It’s all being drawn at the same time - I assign HUD materials to nothing to remove them from view, then re-assign them when the HUD is needed. It’s all based on booleans (DrawHUD, DrawInventory, etc.)

The Draw blueprint nodes don’t really support drawing anything outside of the Event Receive Draw HUD node.

Okay, so I did a little research. Are you drawing a Hit Box for the individual items? Name the slots individually then from there you could use Event Receive Hit Box Click/Release/Over for interaction.

This is exactly what I needed to do. For some reason I didn’t see the hit box function (probably staring at it too long).

User ‘real’ also gave the same answer a few minutes ago, figured I’d post his response here since it goes into a bit more detail for those who still might be stuck:


Hello , That is pretty easy to
do, just like a Draw Rect node there
is an Add Hit Box node for you to use!
it works just like a Draw Rect node,
but do keep in mind that the “Name”
variable for “Add Hit Box” must be
unique for each hitbox you create!

To receive events for those new HUD
hitboxes, all you need is the node
named “Event receive hit box click” or
the equivalent “mouse over” event
nodes. The events will output the
unique names you’ve given your
hitboxes, making life a whole lot
easier.

Let me know how it goes, if you find
yourself stuck I’ll send you my
example of an inventory system.

Cheers!

Thanks guys!