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

learn more… | top users | synonyms

1
vote
1answer
46 views

Rotating an object to point towards the mouse [duplicate]

I'm using slick2d for this process and trying to rotate a minigun to face the mouse. My problem is that the minigun in my game is actually rotating but no towards the mouse at all! Also, the minigun ...
0
votes
1answer
33 views

Mouse state not acting as I intend it to

I am creating an inventory system. I have it working well, but for some reason when I pick up an item from a slot(lets say slot 2 of 20) and drop it into that same slot(slot 2) the mouse state fails ...
-2
votes
0answers
22 views

Mouse Selection custom shape opengl render select

I'm using openTk for a my project. I have serious problem with mouse selection. I tried unsuccessfully a lot of examples found on the web. So, I have to draw a grid with some coils (custom cylinders ...
1
vote
1answer
124 views

Libgdx 2D Game, Random generated World of random size, how to get mouse coordinates?

I'm a noob and English is not my mothertongue, so please bear with me! I'm generating a map for a Sidescroller out of a 2D-array. That is, the array holds different values and I create blocks based ...
2
votes
1answer
44 views

Mouse input and structure in JS [closed]

I am creating a simple concept where I have a small menu to choose a tool from and then I can click and drag to build. For example, I click on the rails tool and then I can click and move the mouse ...
2
votes
1answer
83 views

GLFW mouselook under OSX

I'm continuing to port an OpenGL app from Visual Studio 2012 to XCode 5. The only major issue I'm having is mouselook. It "doesn't work" under OSX (Mavericks). Here's the (pseudocode): ...
3
votes
1answer
72 views

Algorithm for sensing mouse movements like a wiimote

I want to make a driving game where you can do tricks with your mouse when you hold down LMB. Ex. if you move it up in a straight line really fast (your cursor goes from the bottom to the top of the ...
-1
votes
1answer
397 views

Lock mouse in center of screen, and still use to move camera Unity

I am making a program from 1st person point of view. I would like the camera to be moved using the mouse, preferably using simple code, like from XNA var center = this.Window.ClientBounds; ...
0
votes
0answers
47 views

XNA Windows Resolution / Mouse Position Bug

In XNA, when in windowed mode and resolution (set via PreferredBackBufferWidth/Height) is close to the resolution of the display, the view is distorted (zoomed in a bit)and the mouse coordinates are ...
1
vote
0answers
50 views

Mouselook stutters [closed]

I'm trying to set up mouselook for a 3d game in XNA. The mouselook itself is working but it seems to be stuttering a lot when I use it. The problem is, I have no way of reliably reproducing this ...
1
vote
0answers
36 views

How do I detect image clicks in Dark GDK?

I am trying to determine if an image has been clicked, using the Dark GDK game engine. I've found no methods in the engine that do this. I would rather not brute force this with a large nested ...
1
vote
2answers
486 views

How do I handle DirectX mouse events?

I am a beginner making my second game (simple low graphics FPS), in Visual C++ 2010. So far, I only know how to use keyboard controls. I've had source files like keyboard.h and keyboard.ccp, ...
0
votes
1answer
118 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 ...
1
vote
1answer
93 views

XNA - Prevent Holding of Mouse Button as Part of an Input Handler Game Component

I'm using C# XNA 4.0 Refresh. I'm working to create an InputHandler Game Component for my XNA game to handle all of the keyboard and mouse input. I used SixOfElevens RPG Game Tutorial (Here - ...
1
vote
1answer
121 views

TopDown 2d player control

Whats the usual way to control a player in a top down game? We have to look in the direction of the mouse cause the player hold a torch. My first try was: to to make it absolute like W move to ...
1
vote
1answer
190 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
2answers
117 views

How can I fix my sprite being rotated 90 degrees more than toward the mouse?

I am trying to get a Sprite in LibGDX to look at the player's mouse. Here's the code I have (mind you, I am using JRuby): target = mouse_position.sub(spatial.position) rotation = ...
3
votes
1answer
127 views

Float-based screen coordinates, higher mouse precision

I wrote 2 weeks ago about problem with motion blur in my engine. When camera moves using keyboard, motion blur is smooth. But when I rotate camera using mouse motion blur is stepping (not sure if I ...
0
votes
1answer
613 views

How do I get the mouse position relative to the window, not the whole screen?

I am developing an XNA game. I run it in window mode. I need to handle mouse events, but when I use the Mouse class from Xna.Framework.Input.Mouse, I get the the mouse position on the whole screen. ...
2
votes
1answer
159 views

Mouse Speed in GLUT and OpenGL?

I would like to simulate a point that moves in 2D. The input should be the speed of the mouse, so the new position will be computed as following new_position = old_position + ...
1
vote
1answer
51 views

Why does my camera break mouse position targeting? [duplicate]

I made a short video of this. Basically, when the screen scrolls with the camera, the character begins firing at the incorrect mouse position. You can see where I am clicking the whole time. As we ...
3
votes
1answer
418 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 ...
0
votes
1answer
309 views

How to handle simultaneous mouse and keyboard input with sdl?

I'm making a game in SDL2 that so far is basically just a top down shooter, where the player aims at the mouse. When I run the game, you can move properly and shoot properly, and shoot and move the ...
-2
votes
1answer
86 views

Clamp the scroll wheel value [closed]

I'm having something like an inventory bar at the bottom of the screen. However, when the highlight square (indicates what object you are going to place) reaches the end. The value of the scroll wheel ...
0
votes
1answer
201 views

LWJGL: Camera distance from image plane?

Let me paste some code before I ask the question... public static void createWindow(int[] args) { try { Display.setFullscreen(false); DisplayMode d[] = ...
2
votes
1answer
590 views

How to select a vertex by mouse clicking in OpenGL?

I'm programming a simple graph game and so far I'm still doing a few tests in OpenGL. Right now, let's say I defined a GL_POINT with the glVertex2f(20.0f, 0.0f). I have this function to calculate the ...
1
vote
1answer
2k views

Unity3D Drag Object with Mouse Gives Invalid Position

I am trying to implement a simple script to drag a GameObject with the mouse in Unity. However, when the position of the object is updated with the following script, I get an error saying: ...
0
votes
0answers
19 views

How to Point sprite's direction towards Mouse or an Object [duplicate]

I need some help with rotating sprites towards the mouse. I'm currently using the library allegro 5.XX. The rotation of the sprite works but it's constantly inaccurate. It's always a few angles off ...
0
votes
2answers
80 views

I need to move an entity to the mouse location after i rightclick

Well I've read the related questions-answers but still cant find a way to move my champion to the mouse position after a right-button mouse-click. I use this code at the top: float speed = ...
1
vote
1answer
202 views

Java: See if Mouse is hovering/clicking Sprite

The game I am developing is in which you defend the Cell from the Viruses, and I need the sprites to have a MouseListener for when the mouse clicks on that sprite, it will get destroyed, and I cannot ...
2
votes
1answer
176 views

When do you get Mouse.getstate().X or Y as negative?

I am creating a game in which I use a function: int x() { int px = 100; int pxend = 128; int xx = 0; for (int i = 0; i < 6; i++) ...
0
votes
1answer
91 views

Why am I getting a return value of zero from my position computation function?

Ok I have a Function int x(), which is used in new Rectangle(x(),a,a,a); in DrawMethod in XNA but when I use it I get x() = 0 as as the answer.Here is my CODE: int x() { int px ...
0
votes
2answers
872 views

SharpDx how to detect if Mouse Button is pressed?

I'm wondering how it's possible to detect if a mousebutton is pressed or released. var di = new DirectInput(); _mouse = new Mouse(di); _mouse.Acquire(); _mouseState = _mouse.GetCurrentState() All I ...
1
vote
1answer
140 views

Getting mousemovement despite mouselock - unity

I have lockcursor so the cursor doesn't leave the screen, but now i have to rotate an object based on mouse movement (think garrys mod item rotation) but the mouse cursor is obviusly locked to the ...
4
votes
1answer
161 views

Is there a way to write a camera class without matrix-transformation?

I have a problem with a camera class I got from the internet. It does a transformation like this: public Matrix get_transformation(GraphicsDevice graphicsDevice) { _transform = ...
2
votes
2answers
1k 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 ...
5
votes
1answer
2k views

How do I read input from multiple keyboards/mice on one computer?

I want to be able to read inputs from multiple keyboards and still differentiate them. It's for split-screen. I know it's possible, because Serious Sam 3 allows it. Edit : Well a whole lot of my ...
0
votes
1answer
267 views

MonoGame Linux Mouse.SetPosition doesn't work!

Having a really weird issue, it seems that no matter what I do I cannot get the Mouse to lock to the center of the screen in MonoGame. I triple checked all the possible noob mistakes, and ...
1
vote
1answer
119 views

How to make camera rotation independent from frame rate?

I multiply the mouse movement by a given number to get camera rotation of a desired speed. But it only works at 60 FPS. When I don't limit the frame rate I get around 350 FPS and the camera rotation ...
-1
votes
1answer
403 views

Irrlicht mouse input

I am trying to make a chess game at this moment, using Irrlicht. It will be a 3D Chess game but apart from most chess games it has one special quality: Free movement of the camera. The Chess game ...
2
votes
1answer
1k 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: SDL_ShowCursor(SDL_DISABLE); SDL_WM_GrabInput(SDL_GRAB_ON); See Trap mouse in ...
-2
votes
1answer
107 views

Cannot get 3D mouse coordinantes [closed]

I'm using viewport.project() to find my mouse position in 3D space. I have my projection, view and world matrices defined in the same area that they are used to draw the model. Code is below: NOTE: ...
2
votes
0answers
517 views

Converting Mouse Coords to 3d coords with Camera position [closed]

So I've looked at all the answers I can possibly find, and nothing seems to fit what I need exactly (because im bad at math). I'll explain what I have thus far: A camera with x,y,z, Pitch and Yaw ...
1
vote
2answers
571 views

Exclusive mouse movement with WM_INPUT

Microsoft seems to recommend using WM_INPUT for input. I want to only get relative mouse input and hide the mouse cursor all together for a short while (For gesture based input). However, using ...
1
vote
3answers
2k views

How can I convert screen coordinatess to world coordinates in OpenTK?

I'm making a windows forms application with opengl view. I need to get the mouse coords converted to the opengl world coords. Well, my Y coord gets converted wrong. It's hard to explain, so here is ...
1
vote
0answers
191 views

Moving an object (pong paddle) along the x,y axis in 3d-space with mouse/touch

First of all: Sorry, my English isn't quiet good, I'm very new in 3D and I'am using JMonkeyEngine. What I would like to do?: A 3d pong game and I want to control the paddle with the mousecursor ...
1
vote
1answer
568 views

Moving the camera as in a first person shooter

I am trying to implement the movement of the camera with the mouse. The result I want to achieve is the same that you get when you move your aim in a first person shooter. Here is the code I wrote, ...
6
votes
2answers
398 views

How do I convert a 2D movement (from mouse) to a displacement along a 3d axis?

I'm making a small 3D scene editor (that only allow to modify objects positions). Each object is draw with a 3d X/Y/Z axis : How it works : user choose an axis (X, Y or Z) by left clicking on it, ...
3
votes
1answer
360 views

How to emulate knob turning, based on x/y movement?

I'm doing a game where one component is that you turn a knob. I'm having trouble getting good "knob behavior". I know the current touch/mouse X,Y location, and I keep track of the previous X,Y ...
3
votes
2answers
1k views

How to determine mouse position outside stage, and center the cursor?

I was wondering if it is possible to have my flash game determine the position of the mouse, even when the cursor is not inside the stage. My movie clip should move horizontally between x = 100 and ...