+ Reply to Thread
Results 1 to 8 of 8

  Click here to go to the first Rift Team post in this thread.   Thread: frame.Event:MouseOut() and texture frames

  1. #1
    Shield of Telara Adelea's Avatar
    Join Date
    Mar 2011
    Posts
    734

    Default frame.Event:MouseOut() and texture frames

    I wanted to create a control panel frame that is displayed when the mouse is moved over into a certain frame.

    This part works fine.

    So, I obviously need to hide the frame again, when the mouse is moved out of the frame.

    I create a number of texture frames on the newly displayed frame, which all display fine.

    My problem comes when the mouse is moved to one of these texture frames, in order to click it, to activate its function.

    Moving onto a frame that is entirely within my displayed frame triggers the MouseOut event, which causes me to hide the frame - before the control icon can be clicked.

    I tried creating another frame with a higher layer level, and using this to determine if the mouse has moved away from my target area.

    No luck.

    I tried playing with frame:SetMouseMasking(), but that didnt work either.

    I have a workaround now, where I also catch MouseOut events on all my texture frames as well as my control panel frame - and check the mouse X,Y coordinates manually against the coordinates of the bounding box, and then hide it if it has moved away.

    But this seems a bit of overkill, so I'm wondering have I actually missed something, or is this the only way to do what I want to do?
    http://forums.riftgame.com/image.php?type=sigpic&userid=125779&dateline=13553  38065

  2. #2
    RIFT Guide Writer Noshei's Avatar
    Join Date
    Feb 2011
    Posts
    1,886

    Default

    To achieve this you will need the frames to be in different contexts. The reason for this is so that they can be on different Strata.

    Then you just set the context you want on top to a higher strata.

  3. #3
    Shield of Telara Adelea's Avatar
    Join Date
    Mar 2011
    Posts
    734

    Default

    But then I will need to create/hide the textured frames individually, or at least create a new holding frame for them?

    Bleh, what I have works, so I'll stay with it =)
    http://forums.riftgame.com/image.php?type=sigpic&userid=125779&dateline=13553  38065

  4. #4
    RIFT Guide Writer Noshei's Avatar
    Join Date
    Feb 2011
    Posts
    1,886

    Default

    Quote Originally Posted by Adelea View Post
    But then I will need to create/hide the textured frames individually, or at least create a new holding frame for them?

    Bleh, what I have works, so I'll stay with it =)
    maybe, but I couldn't say for sure. Do you have a screenshot I could look at to get a better idea of what your trying to accomplish?

  5. #5
    Shield of Telara Adelea's Avatar
    Join Date
    Mar 2011
    Posts
    734

    Default

    Quote Originally Posted by Noshei View Post
    maybe, but I couldn't say for sure. Do you have a screenshot I could look at to get a better idea of what your trying to accomplish?
    One of them has a blue background title with 6 icons, the other is black showing the addon name.

    What was happening, was that moving over the black title bar, would show the blue bar with the icons.

    Moving the cursor over one of the icons would trigger the MouseOut event for the blue background frame, where I would then hide it.

    EDIT: The blue background has a Layer of 10, the icons 15.

    I tried creating a frame over the top with Layer 20, and using MouseIn() and MouseOut() events on that, with no difference.
    Attached Thumbnails Attached Thumbnails frame.Event:MouseOut() and texture frames-rattus_bars.jpg   frame.Event:MouseOut() and texture frames-rattus_controlpanel.jpg  
    Last edited by Adelea; 07-19-2012 at 07:11 AM.
    http://forums.riftgame.com/image.php?type=sigpic&userid=125779&dateline=13553  38065

  6. #6
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default

    I have a feeling only one frame can ever be considered to have the mouse over it, and because your icons have their own mouse handlers, they are taking the 'Mouse Over' attribute.

    What might work to avoid having to check mouse pointer coords, is:

    1) Set a counter to zero.

    2) Every time the blue bar or an icon gets a mouse in event, increment the counter.

    3) Every time the blue bar or an icon gets a mouse out event, decrement the counter.

    4) In Event.System.Update.Begin, if the bar is visible and the counter is zero, hide the bar.

    I'm using a counter instead of a boolean so that the order of events doesn't matter.

    Edit: Checking the bounding box is no biggie, so what you're doing already is quite possibly a better solution, as it involves fewer event handlers. I don't think you can use the API to make it "just work", which I guess is what you were really asking
    Last edited by DoomSprout; 07-19-2012 at 07:28 AM.

    Gadgets: Unit Frames and Other Stuff for RIFT

  7. #7
    Shield of Telara Adelea's Avatar
    Join Date
    Mar 2011
    Posts
    734

    Default

    Quote Originally Posted by DoomSprout View Post
    I don't think you can use the API to make it "just work", which I guess is what you were really asking
    I can live in hope =)

    Or maybe I had missed some way of hiding certain mouseevent for frames.
    http://forums.riftgame.com/image.php?type=sigpic&userid=125779&dateline=13553  38065

  8.   This is the last Rift Team post in this thread.   #8
    Rift Team
    Join Date
    Oct 2010
    Posts
    927

    Default

    Quote Originally Posted by DoomSprout View Post
    I have a feeling only one frame can ever be considered to have the mouse over it, and because your icons have their own mouse handlers, they are taking the 'Mouse Over' attribute.
    This is correct.

    I'm not satisfied with how the mouse events work right now and they may be getting a bit of a redesign eventually. This will not happen before Storm Legion, though, so don't hold your breath.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts