UButton set isHovered
is it possible to set the isHovered bool of a button to true without hovering with your mouse? if so can you explain how?
thanks in advance,
asked Jan 26 '18 at 02:05 PM in C++ Programming
On UMG level you can't, IsHovered is not varable to begin with, it's a function that ask Slate widget if it's hovered (If you didn't noticve UMG is just Blueprint wrapper for Slate, UMG classes practically only operate Slate widgets, they not widgets from themselves):
you can't even override this function because it's not virtual, you need to think of some workaround. You didn't explained why you want to do it, so whatever you trying to do study code of UWidget and UButton and oyu may try to alter it's behavior by creating class from UButton but remember that you can only override virtual function (once with V icon in API reference)
On other hand you could on Slate level it is possible, because bIsHovered is varable and IsHovered function just forward value of it.
Problem is bIsHovered is protected so you can't change it from foreign class like UMG class, you would need to create Slate widget based of SButton and then create UMG widget for it to be able to use it in widget blueprints. And IsHovered function in slate is virtual so you don't need to change varable just override a function.
But i bet there some less invasive workaround for that you trying to do
Follow this question
Once you sign in you will be able to subscribe for any updates here