User Tag List

Results 1 to 3 of 3

Thread: InputMouse

  1. #1
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,304
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.79%

    InputMouse

    Can someone give me a hand using these?
    I'm having a few problems, they don't seem very responsive.
    Code:
    			if(Abs(Link->InputMouseX-128) <= 128 && Abs(Link->InputMouseY-88) <= 88){
    				Crosshair->X = Link->InputMouseX;
    				Crosshair->Y = Link->InputMouseY;
    			}
    Is pretty much all I have, inside a while(true) loop with a waitframe();.
    It doesn't seem to follow very well at all though =S

  2. #2
    Octorok Elmensajero's Avatar
    Join Date
    May 2008
    Age
    35
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    851
    Level
    10
    vBActivity - Bars
    Lv. Percent
    19.03%

    Re: InputMouse

    That script above doesn't seem to cause too much trouble for me (unless the mouse goes out of the boundaries, then the ffc jumps over to the new mouse position when it comes back and it looks kinda odd). Here is one script that works in both b819 and b860, which is a slightly modified version of one of HeroOfFire's scripts. Putting the ffc at -16,-16 worked best for me.

    Code:
    ffc script cursor
    {
    	void run()
    	{
    		while (true)
    		{
    			if (Link->InputMouseY < 0)
    			{
    				this->Y = 0;
    			}
    			else if (Link->InputMouseY > 160)
    			{
    				this->Y = 160;
    			}
    			else
    			{
    				this->Y = Link->InputMouseY;
    			}
    			if (Link->InputMouseX < 0)
    			{
    				this->X = 0;
    			}
    			else if (Link->InputMouseX > 240)
    			{
    				this->X = 240;
    			}
    			else
    			{
    				this->X = Link->InputMouseX;
    			}
    			Waitframe();
    		}
    	}
    }
    Looking for the newest 2.5 content? Check out CZC for quests, demos, scripts, and more!

  3. #3
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,304
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.79%

    Re: InputMouse

    Ah, I think it must be to do with my computer then.
    It seems that the system detects the mouse as lower and further to the right than where it actually is - so if I put the mouse up in the top left of the box then it works.

    I have a code to send the cursor back to the middle at the top of the screen when the mouse leaves the screen, but thanks anyway.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social