2D Toolkit Forum
2D Toolkit => Support => Topic started by: oxyscythe on August 07, 2013, 12:59:28 pm
-
Is this possible? I noticed there's an Autofire event for tk2dButtons but that component seems to be depricated now in favour of the newer tk2dUIItem. This class exposes OnDown, OnUp, OnClick and OnRelease which are great but what do you do if you need an OnHeld?
I basically need to increase a counter continuously while a button is being held down. Suggestions much appreciated!
Thanks!
-
The general approach for held is to do the logic yourself - start increasing the counter when you get the OnDown event, and stop increasing it when you get OnUp.
-
As profanicus says, this is the recommended approach. You can check tk2dUIDragItem for a example of how you can hook things up.
-
Great, thanks profanicus and admin!