View Full Version : Passing index to functions with Inputs and Buttons

05-17-2018, 01:21 AM
It would be great to be have Inputs and Buttons pass their input/buttons index to the function they call.

Currently, you may want to have several buttons/inputs do nearly the same thing, but the quickest way to do that is to have each of them call their own function that will call FunctionB which takes an index (or a string or something) as a parameter. If you have a lot of buttons, that means a lot of code that we could easily live without if the button/inputs would pass their index on top of obj, player, alt, input_value, and selected. We could then all have them call their FunctionB and do different things inside the function itself.

This might seem like it's a small thing, but sometimes you can potentially have a LOT of buttons/inputs that do similar things but with 1 difference such as which numbered input did you type a word in.

05-17-2018, 05:48 AM






05-25-2018, 03:23 PM
These old createButton() based are consider depreciated at this point now that you can spawn 3d UI with the new Xml UI system.