User Tag List

Results 1 to 7 of 7

Thread: Move Mouse With Active

  1. #1
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Dec 2010
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Move Mouse With Active

    Okay, so here's my deal. I can't, for reasons I don't care to go into, use MMF2's built in scrolling. Instead I'm using the viewport object. My game is a top down shooter and the mouse is used to aim. So now imagine, without scrolling, if I'm not moving the mouse the player will always be facing, that is- aiming, toward to location of the cursor. I can move him left or right and he will always face the cursor regardless of his position. This is expected. If I use MMF2's built in scrolling the cursor, in effect, moves with the player. This is because the mouse follows the frame. This is also the effect I'm hoping to achieve.

    I'm using the viewport, slightly zoomed in, for my scrolling. Maybe, I just have a mental block right now but I can't think of a way to make it so the cursor moves relatively to the player... this is to say that if the cursor is 100px from the player it will remain the distance from the player as he moves about UNLESS the user is moving the mouse. At which rate I'd need it to be positioned relatively to the player + the movement of the mouse.

    I'm lost. Any ideas, anybody?

  2. #2
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Move Mouse With Active

    Use a fake active for the mouse, and set it's position to X("Player")+xmouse

    You might need to modify that to get an offset from the player, though.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Eliyahu's Avatar
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Move Mouse With Active

    what would the purpose of that be? You can set the mouse position with the Mouse Object. The end.

    -Eliyahu

  4. #4
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Dec 2010
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Move Mouse With Active

    Thanks for the replies guys. However, Jacob, that's the part I'm having trouble with at this point. The offest, I'm shooting mental blanks. Eliyahu, The problem with the mouse object is that it only allows you to modify the Actual Position of the mouse relative to the screen and not the game's frame. So if my frame is smaller than the screen resolution or positions other than 0,0 than it would throw off the mouse's positioning via the mouse object.

  5. #5
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Dec 2010
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Move Mouse With Active

    Actually, Jacob, your method works! BUT! If the mouse reaches 0,0 the crosshair I'm using wont move any more...since the mouse can't move past that position. So I'm still stuck.

  6. #6
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Dec 2010
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Move Mouse With Active

    Still stuck on this, if the mouse object was able to return not just distance rolled by x and y distance rolled I could easily fix this. There's no extension which can currently do that, right? I'm starting to wonder if it just isn't possible though. This is very frustrating. Has nobody tried anything like this before? Heh, if it weren't for the surface object lagging behind when scrolling I wouldn't even need this.

    Any ideas?

    EDIT: SOLVED!
    I was tempted for a second to reply yet again. But I didn't want an angry mob. Anyway, if anybody is curious as to how I solved this I simply used this:

    X( "playerPawn" )+XMouse-512

    The above line sets the X of the crosshair. A similar peice of code is used for the Y.

    Basically, since my frame is 1024 wide I solve the problem of the mouse getting stuck at 0,0 by substracting half of the width of the view. I also take care to position the mouse in the center of the screen as well so I know my alignments are exact.

    Sorry if the above isn't entirely coherent. I haven't slept all night. Thanks for the help everyone!

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Eliyahu's Avatar
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Move Mouse With Active

    For the MouseObject you can get the Frame's position, so if you wanted to move the Mouse to the right 1 pixel, it'd be Set Actual X to: X Left Frame + XMouse + 1

    I don't understand your solution, but if it works, it works! You may want to consider that though ^^

Similar Threads

  1. Mouse Move / Finger Move (Touchscreen)
    By Spyhunter in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 20th December 2013, 04:00 PM
  2. MMF - Did the mouse move event
    By droberson in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 26th April 2009, 06:20 PM
  3. move twords mouse
    By jhonson in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 21st February 2009, 04:35 PM
  4. Move mouse?
    By Blueberry in forum Extension Development
    Replies: 3
    Last Post: 26th January 2007, 07:13 PM
  5. How to move Active Objects with mouse cursor?
    By Joni in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 30th October 2006, 03:28 PM

Posting Permissions

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