[C++] Mouse events in HUD?

Hello ! I am currently working on a Inventory system. And i want some mouse events in it (like mouseover,clicking,dragging etc).

Because AHUD is canvas based it’s hard to distiguish invidual objecets in it, that why it uses so called hitboxes to detect mouse, you need to create hitbox over specific graphic and then use recive events (which is called for all hitboxes just send name of hitbox which been trigger). Theres no drag and drop, you will need to implement that yourself.

Theres few funtion in HUD to operate this, event starts with word “Recive”, so look up in API refrence and search for word hitbox

You might consider switching to Slate or even UMG (Blueprint Slate frontend) which has more UI like funtions unlike canvas of HUD system

so this slate hud got what i need ? is it a plugin or already build in ?

Slate is not-OS-related UI system made originally for editor to make it less OS dependent, whole editor UI is made using it, so it’s build in to engine, but you can also use it inside the game. it got more window manager approach where HUD system is more like draw canvas. It’s like that because UE3 and earlier didn’t had any UI solution, HUD and rest of UI was draw on canvas, there was UWindow but this was made just for UT99 not unreal engine itself

UMG (Widget Blueprints) are frontend of Slate to blueprint… or rether UObject, as Slate is outside UObject environment and can’t be used in blueprints because of that. It’s made for blueprint but you can also use it in C++ if you like, you should UMG instead of Slate if you want to incorporate blueprints in to your frameworks

I guess this will be good startiung point:

iam not the biggest fan of blueprints

But you don’t need to use them either in UMG :slight_smile: Or you can just use Slate. Or just hitboxes in HUD if that enoth for you

do you know some tutorials ?

Well read documentation i linked and search on Wiki, once oyu get basics you can learn from API refrence

i think hitboxes will fill my need ! i tested it in blueprint and everything worked fine. but how can i work with the receive calls in c++ ?

You override Recive function in your HUD class, same as you do with BeginPlay or Tick

and then i need to check if the name is correct right ?

Ofcorse ; p