edited February 2020 in ORK Support
I am using some basic custom GUI to give me better control over screen aspect resizing and use a few other third party tools I have at my disposal, but I can't work out how to prevent Mouse Clicks passing through my GUI and also being consumed by ORK (Click button, button activates AND player moves to location on map under button)

(Game is set up as mouse-click to move on mouse up.)

I have tried ORK.GUI.IsCursorOver = false on Pointer enter/exit of the problematic buttons but it doesn't do anything.

Also tried ORK.Control.SetBlockControl and while that "works" to a point it has a lot of terrible side effects (Stopping the player moving if you mouse over a button, camera jittering when unblocked)

A last option is fake up a ORK GUI panel and just stick it under my GUI items but a problem I had was when changing screen sizes initially was the ORK GUI worked oddly with the aspect ratio, so I would probably have issues making sure the fake ORK panel was the EXACT size of the Custom GUI one.
Post edited by Fashtas on
  • IsCursorOver needs to be true for ORK to recognize the cursor being over a GUI box, but this is set pretty much each frame based on the mouse position and checking open GUI boxes.

    You need to set ForceCursorOver to true while it's over your button (or whatever else you want to have clicks blocked.

    So, when it's over something:
    ORK.GUI.ForceCursorOver = true;
    And when it leave's it again:
    ORK.GUI.ForceCursorOver = false;
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • After some experimenting I got this working.

    It appears that if you are set up as :

    Game Controls | Interaction Settings | Move to Interaction
    Use Move to Interaction = TRUE

    *and*

    Game Controls | Interaction Settings | Mouse/Touch Control
    Mode = END

    ForceCursorOver = true does *NOT* work. The mouse clicks still pass through down to the ORK controller

    Setting to HOLD or START and it all works fine

    I debugged everything carefully, I am using Pointer On Enter and On Exit, all debugging shows the event are occurring at the right times, but if set to Mode = END clicks pass through, otherwise they don't... Vaguely interesting, but at least I discovered Mode = HOLD and I like that one and will use that instead!

    Thank you for the help!

    [Out of interest sake I just tried a quick test and added an Update() method displaying the current values of ORK.GUI.ForceCursorOver and ORK.GUI.IsCursorOver at all times, and they were both set to TRUE when the Mode = END clicks passed straight through the custom GUI button]
  • Ah, yeah, there's an issue with that in the current ORK version (has been reported some time ago) - there'll be a fix in the next update :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Ok cool, thanks VERY much! BTW, love your product, having a great time working with it!
  • Glad you like it :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.