User Tag List

Page 4 of 4 FirstFirst ... 2 3 4
Results 31 to 40 of 40

Thread: Containing mouse cursor to a circle around the hero

  1. #31
    Clicker Fusion 2.5

    Join Date
    Oct 2007
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by casleziro View Post
    Unless he just wants the crosshair position moved around by the mouse delta only and not defer to the mouse position when it is inside the boundary?
    Yes, that is exactly what I want.

  2. #32
    Clicker Fusion 2.5
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    538
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Here's the concept, but with a square boundary instead of a circle. It's late, so remembering the math required to make the boundary a circle is giving me a headache right now even though i'm sure it's simple

    I'm sure one of the other participants in the thread could modify it easily, if they so chose.

    crosshair by mouse delta.mfa
    Last edited by casleziro; 16th January 2018 at 06:00 AM.

  3. #33
    Clicker Fusion 2.5

    Join Date
    Oct 2007
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by casleziro View Post
    Here's the concept, but with a square boundary instead of a circle. It's late, so remembering the math required to make the boundary a circle is giving me a headache right now even though i'm sure it's simple

    I'm sure one of the other participants in the thread could modify it easily, if they so chose.

    crosshair by mouse delta.mfa
    Yes! If I can get that in a circle it'd be perfect! Thank you.

    Another feature I'd like, and I know I'm pushing it here, but if the crosshair could track alongside the player. So if you're aiming to the left and move the player up, the crosshair goes up as well, and same for every other direction.

  4. #34
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    May 2013
    Posts
    103
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I haven't really read this forum so sorry if this has already been covered or if I'm way off the mark but this is a pretty crude version of what I think you are after. I was expecting to have to do some work to stop the cursor getting stuck to the side of the circle but actually it's not too bad as it is. It is a little bit sticky though so if you want me to smooth it out I can give it a go.
    Attached files Attached files

  5. #35
    Clicker Fusion 2.5

    Join Date
    Oct 2007
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by CoffeeCup View Post
    I haven't really read this forum so sorry if this has already been covered or if I'm way off the mark but this is a pretty crude version of what I think you are after. I was expecting to have to do some work to stop the cursor getting stuck to the side of the circle but actually it's not too bad as it is. It is a little bit sticky though so if you want me to smooth it out I can give it a go.
    This is good, thank you. I would like the stickiness fixed if you don't mind. But more importantly, is there a way to attach this crosshair to a moving object? It looks like it's soft coded to (320,240) and breaks if I try to change those values by attaching them to a moving object.

    I feel like I'm putting people through a lot here, so if someone fixes this up for me all nice I'll... I don't know, find some way to get $5 to you or something

  6. #36
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    May 2013
    Posts
    103
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yeah, I'd quite like to fix the stickiness too; I'll do it when I've got a bit more time.

    As for attaching the thing to a moving object; that should be very simple. The x and y coordinates of the centre of the restricted zone are stored in a pair of alterable values in the Cursor Object. Just change the values to whatever the moving objects coordinates are each turn and things should work fine.

    Don't worry about it; I'm happy to help. I get a lot of assistance from the Clickteam community and it's nice to be able to give back when I can.

    Edit:

    Sorry, not quite as simple as I initially thought. The cursor doesn't get dragged along by the edge of the restricted zone if the zone moves beyond the cursor. Won't be too hard to fix but I don't have time now. I'll try and send you something within the next day or two.

    Edit 2:

    Wow, I must have something wrong with me; you'd already said that. I thought I'd read your post. I'll fix it soon but I definitely don't have time now.
    Last edited by CoffeeCup; 16th January 2018 at 09:07 AM.

  7. #37
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,123
    Mentioned
    12 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by bhlaab View Post


    Perhaps there's a quick & short solution,
    if I got it right from this picture you posted
    (sorry didn't read the whole thing so maybe I've misunderstood!)

    cursorcircle.mfa

    you can customize the max distance the cursor can travel in its alt. value "max_dist"
    (can change it in runtime too if you wish)

  8. #38
    Clicker Fusion 2.5
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    538
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    @schrodinger great example! But the "orbit from center" approach isn't what bhlaab was looking for.

    I managed to shave the edges off the square and it should be working exactly as you want it right now. I added the crosshair moving along with the player: it just follows the same logic as the crosshair being moved by the mouse (add player delta to crosshair position).

    crosshair by mouse delta_2.mfa

    EDIT x2: Take care with the order of your events. The events from this example (minus the "start of frame" one) should go below your player movement code if you are using a custom engine, otherwise the system will break.
    Last edited by casleziro; 17th January 2018 at 04:28 AM. Reason: messed up first few edits

  9. #39
    Clicker Fusion 2.5

    Join Date
    Oct 2007
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by casleziro View Post
    @schrodinger great example! But the "orbit from center" approach isn't what bhlaab was looking for.

    I managed to shave the edges off the square and it should be working exactly as you want it right now. I added the crosshair moving along with the player: it just follows the same logic as the crosshair being moved by the mouse (add player delta to crosshair position).

    crosshair by mouse delta_2.mfa

    EDIT x2: Take care with the order of your events. The events from this example (minus the "start of frame" one) should go below your player movement code if you are using a custom engine, otherwise the system will break.
    This is perfect! Thank you so much!

    Do you have anything in the click store or a ~$5 game i can buy to support you back?

  10. #40
    No Products Registered

    Join Date
    Dec 2016
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if i understand correctly what is wanted is to keep the crosshairs contrained within the area of the circle but not only on the outer perimeter.


    Sent from my iPhone using Tapatalk

Page 4 of 4 FirstFirst ... 2 3 4

Similar Threads

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