1
vote
1answer
57 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 - ...
0
votes
1answer
139 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. ...
1
vote
1answer
43 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 ...
-2
votes
1answer
51 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 ...
2
votes
1answer
148 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++) ...
4
votes
1answer
154 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 = ...
0
votes
1answer
210 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 ...
-2
votes
1answer
105 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: ...
9
votes
1answer
877 views

C#/XNA get hardware mouse position

I'm using C# and trying to get hardware mouse position. First thing I tryed was simple XNA functionality that is simple to use Vector2 position = new Vector2(Mouse.GetState().X, Mouse.GetState().Y); ...
1
vote
1answer
434 views

Mouse click rectangle doesn't update to actual mouse position

I'm making a menu in XNA; and to solve clunky input via arrow keys, I thought I would use mouse input. I got everything to work perfectly, then I tried to click on something specific and nothing ...
2
votes
2answers
725 views

Making mouse pos realtive to a moving object

I'm coding my first actual game, trying without following tutorials, just trying to use my knowledge so far to make something playable. I'm creating (attempting) a simple side-scrolling shooter. I ...
3
votes
1answer
883 views

Scrolling the camera when the mouse cursor gets to the edge of the screen

I was wondering if you could help me: In XNA I have a hexagonal map, and the size of the map currently exceeds the size of the window. There is already code in place to move the 'camera' around the ...
2
votes
1answer
1k views

2D Topdown Shooter - Player Movement Relative to Mouse

I'm trying to make a topdown 2D space game for my school project. I'm almost done but I just want to add a few little things to make the game more fun to play. if (keystate.IsKeyDown(Keys.W)) ...
2
votes
2answers
2k views

Implementing a Custom Mouse Cursor in XNA

I have tried making a custom mouse cursor, hiding the real mouse, taking the real mouse delta and clamping it to a maximum speed. Here is the problem: In windowed mode, the "real" mouse cursor moves ...
1
vote
1answer
2k views

XNA - Use Mouse To Rotate & Arrow Keys To Scroll A Linearly Wrapped Texture:

Using XNA I'm working on my first, relatively simple, videogame for the PC. At the moment my game window is 1024 X 768 and I have a 'Starfield' linearly wrapped background texture 1280 X 1280 in ...
4
votes
1answer
2k 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 ...
11
votes
6answers
14k views

How to handle mouse input in XNA?

I am developing a card game in XNA. Is there any OnClick event in XNA for objects? I am trying to make cards move when the player clicks on them. In this project, there is a Sprite class that draws ...
32
votes
1answer
4k 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 ...