Using an inventory item on a GUI element

Started by Aviva, Sat 21/10/2017 09:15:52

Previous topic - Next topic

Aviva

Hey people!

I am looking for a way to use an inventory item on a GUI element. The goal is to make the user select an inventory object and use it as a weapon against enemies. Any ideas?

Working on "Drained", a distopian RPG

Khris

#1
If the GUI element is a button, just use its OnClick handler and in there, check
Code: ags
  if (mouse.Mode == eModeUseinv && player.ActiveInventory == iBlueCube) { 


If the GUI element isn't a button, turn it into a button.

If that's not feasible, use on_event / eEventGUIMouseUp and GUIControl.GetAtScreenXY(mouse.x, mouse.y)

Aviva

Working on "Drained", a distopian RPG

SMF spam blocked by CleanTalk