Questions tagged [mouse]

A very common input device in computer games. It offers a more direct form of movement compared to directional input.

Filter by
Sorted by
Tagged with
23
votes
1answer
8k views

Isometric rendering and picking?

I've been looking for a formula to plot (world->screen) and mouse pick (world->screen) isometric tiles in a diamond-shaped world. The ones I've tried always seem to be, well, off. What's the usual/...
13
votes
2answers
15k views

How do I generate projectiles toward the mouse pointer? [duplicate]

I'm making a top-down space shooter where the player controls a ship and can aim and shoot using the mouse cursor. How can I fire bullets from the ship at the angle from the ship to the mouse cursor?
38
votes
1answer
6k views

Mouse aim in an FPS

I would like to make a First Person Shooter and move the camera with the mouse. The problem is that when the cursor reaches the limits of the screen, the camera won't turn anymore. How can I keep the ...
5
votes
1answer
4k views

Mouse location is off due to camera

I'm building a top down shooter but I have a little issue with my camera and mouse. When I add the camera that I use to my game (see here) my mouse pointer seems to be in the wrong location. When I ...
3
votes
1answer
2k views

How can I detect mouse events on sprites in a canvas?

I'm making an HTML 5 game. I want mouse clicks on sprites drawn in a canvas element cause events that my code can react to. At the moment, I'm doing it by checking through all of my sprites in a for-...
9
votes
2answers
33k views

How to detect mouse over for UI image in Unity 5?

I have an image that I have setup to move around and zoom in and out from. The trouble is the zoom can be done from anywhere in the scene, but I only want it to zoom when the mouse is hovering over ...
0
votes
1answer
471 views

Trying to get an object to move in the mouse direction XNA C#

Right, so in my Player class where I call the object I got an if statement which gets the coordinates for the mouse ...
0
votes
1answer
250 views

How can I attract & repel the mouse cursor from particular UI controls?

This question came from some of my students. I wanted to share it here so others can find & improve on the solutions we've found so far. In particular, my answer below doesn't behave as well as I'...
15
votes
6answers
15k views

How to properly differentiate single-clicks and double-click in Unity3D using C#?

What I am trying to understand and learn here is a very basic thing: what is the most general and most polished way to properly differentiate single-clicks and double-clicks for the 3 main mouse ...
12
votes
4answers
17k views

Is it possible to detect two different mice at the same time, and have their movements recorded seperately? [closed]

Im thinking of making a game that requires two mice to play. It needs to register the movement separately from one another. Is this possible? Or does the Windows architecture not allow for such things?...
2
votes
1answer
367 views

Turning to face mouse

Given three points on the same Y plane; A ship A point along the ships heading A mouse cursor How can I find which direction and angle the mouse cursor is from the ships heading? I have a limited ...
7
votes
3answers
17k views

How do I simulate the mouse and keyboard using C# or C++?

I want to start develop for Kinect, but hardest theme for it - how to send keyboard and mouse input to any application. In previous question I got an advice to develop my own driver for this devices, ...
6
votes
1answer
6k views

Trap mouse in SDL2

When using SDL 1.2 it the way to implement full screen or windowed applications with "no cursor" you did the following: ...
2
votes
2answers
3k views

LWJGL multiple keyboard/mouse input checks

As in many game libraries such as LWJGL, you can check mouse/keyboard events with Mouse.isButtonDown or Keyboard.IsKeyDown. I want to check for button/key presses, not if it's currently pressed down (...
1
vote
1answer
816 views

Bounding Box in Monogame for mouse picking

Hello guys so I'm implementing this mouse manager to be able to pick up objects. My application uses mainly textured quads in 3d space. I'm using bounding boxes in monogame to do so, however my ...
1
vote
1answer
434 views

Responding to mouse input on game objects

I'm trying to make a simple button in unity using a cube. My plan is for when the cube is highlighted that it will move towards the camera and be highlighted in a specific color and then when it is ...
0
votes
1answer
41 views

Lowering Unity launcher graphic quality settings reduces mouse x turn speed, does quality affect time?

Lowering Unity App quality settings reduces mouse x turn speed, how to fix this? I am not sure why this happens my only thought was time.timedelta is affected by the graphics quality setting in unity ...
0
votes
1answer
733 views

Bounding Box in Monogame for mouse picking - Ray perspective

My mouse ray is screwing up precision. I don't really know how to fix it, maybe you guys can help. problem : (5.6mg gif) https://www.dropbox.com/s/v0z67afso88hsd1/perspective_ray.gif how i create ...