User Tag List

Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 40

Thread: Containing mouse cursor to a circle around the hero

  1. #1
    Clicker Fusion 2.5

    Join Date
    Oct 2007
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Containing mouse cursor to a circle around the hero

    I am making a game where you move in eight directions and aim and shoot with the mouse.

    What I would like to do is constrain the cursor to a circular, ~150px radius around the player. It is important that the mouse itself be constrained, not just the visual of the crosshair. The mouse cursor and crosshair should be 1:1.
    Within the 150px radius the mouse should act normally. Which is to say, I'm not looking for the cursor to move around the edges of the circle, but to be contained within. The cursor being on the edge of the circle should not inhibit rotating around the player, however.

    I would also like the mouse cursor to inherit the directional speed of the player so that I can use an advanced camera system without the aim becoming misaligned (since the mouse cursor does not scroll at the same speed as the screen).


    I hope this isn't as complicated as I've convinced myself it is

  2. #2
    Clicker Fusion 2.5

    Join Date
    Dec 2009
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think you can constrain the mouse pointer. I've made a game that uses the mouse to move and shoot using a system similar to what you describe, I used an active object as a fake mouse pointer that scrolled the screen when over a circular zone surrounding the player.

  3. #3
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    zip2kx's Avatar
    Join Date
    Jun 2015
    Posts
    679
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    You have to make a crosshair that's an active object and then hide your mouse. You cant control the computers mouse directly.

  4. #4
    Clicker Fusion 2.5

    Join Date
    Oct 2007
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well it doesnt make a difference to me how its achieved. Right now I have a crosshair set to xmouse and ymouse, but how do I make it so that the crosshair never leaves that area?

    I need more than a visual effect where only the crosshair stops at the edge of the circle but the (invisible) mouse keeps going, though. The problem is that once the mouse and the crosshair aren't aligned it feels awful to play.

  5. #5
    Clicker Fusion 2.5

    Join Date
    Dec 2009
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bhlaab View Post
    Right now I have a crosshair set to xmouse and ymouse, but how do I make it so that the crosshair never leaves that area?
    Make the circle area an invisible solid object. Use a second active if you just want the perimeter visible.
    Use the code: Always
    + Mouse Pointer is overlapping circle --> Set x crosshair to x mouse, set y crosshair to y mouse

    Quote Originally Posted by bhlaab View Post
    I need more than a visual effect where only the crosshair stops at the edge of the circle but the (invisible) mouse keeps going, though. The problem is that once the mouse and the crosshair aren't aligned it feels awful to play.
    Make it so that actions only occur when the mouse pointer is overlapping the circle? Without seeing any examples of what you have already and what the problem is it's hard to advise you.

  6. #6
    Clicker Fusion 2.5

    Join Date
    Oct 2007
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    See, that wouldn't work because once the mouse cursor leaves that perimeter but the crosshair stays, there's a mismatch. Let's say you're aiming all the way at 90 degrees. You want to quickly turn around to 270 degrees to shoot a bad guy behind you. There would be a delay in all crosshair movement until the mouse cursor returns to the perimeter zone.

    I was avoiding posting an mfa because I had just been experimenting, so this example is really buggy and the code in there is very sloppy but if it helps illustrate what I'm trying to do better. (I hope sendspace is ok)
    https://www.sendspace.com/file/zkiz1d

    It sort of shows what I'm trying to do, but it doesn't work properly.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)

    Join Date
    Sep 2017
    Location
    Milano, Italy
    Posts
    117
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Could you add another condition, you can use the overlapping one and a NOT Overlapping one.
    The first is like exposed before and the second you can just adjust the direction of the crosshair over the border of the "good area", supposing it is a circle is just a little trigonometry calculations.
    Is this a possible solution?

  8. #8
    Clicker Fusion 2.5

    Join Date
    Dec 2009
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bhlaab View Post
    It sort of shows what I'm trying to do, but it doesn't work properly.
    Ok I see what you're trying to do but I'm out of ideas - I don't think I could do any better than you've already done.

  9. #9
    Clicker Fusion 2.5iOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    891
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    From an old example I dug up. You can change the distances etc in the crosshair values. I hope this is what you're after?
    Attached files Attached files

  10. #10
    Clicker Fusion 2.5 DeveloperSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Posts
    366
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    tetheredcursor.mfa
    Try this, I just tethered the active onto a actionspot, then used another active as the crosshair, did a distance check with the crosshair and then position accordingly to the distance restriction. The distance check forms a perfect circle, then you just place a graphic to show where the radius is. You must be rotating the player active in order for it to work.

Page 1 of 4 1 2 3 ... LastLast

Similar Threads

  1. Mouse Control and mouse cursor
    By DEKE15 in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 4th December 2016, 10:38 PM
  2. Replies: 1
    Last Post: 11th October 2016, 05:44 AM
  3. mouse cursor
    By SpaceBuddy in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 8th April 2010, 10:41 PM
  4. invisible mouse cursor
    By librarysprite in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 30th December 2008, 05:17 PM
  5. Replies: 0
    Last Post: 10th January 2008, 06:45 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
  •