Questions tagged [mouse-position]

197 questions
1
vote
1 answer

How to register if a box2d body is clicked in libgdx?

I'm creating a game with Heroes of Might and Magic like combat in libgdx. I have a main character on hexagonal ground tiles, all of which are set up as sprites and have a box2d body. I would like to change the texture of a ground tile's sprite if…
user3457834
  • 314
  • 3
  • 12
1
vote
1 answer

Limited rotation towards mouse

I have 2D game (unity, c# scripts), where is a submarine with tower (parent) and gun (child). look at the screenshot Tower can rotate (when I press A or D) around submarine body. (works fine) Problem is the gun on tower should rotate towards…
1
vote
1 answer

Unity: Using Mouse Position To Make Angles For My Camera To Rotate Around An Object

I am trying to make a mouse-oriented 3d Agar.io. Right now, I am working on the basic movement and camera readjustments. I want the camera to be able to rotate around an object, but here is the catch: I want to use only the mouse to move the object…
1
vote
1 answer

e.pageX return undefined when mousewheel event on FireFox

I am trying to get mouse position when mousewheel event. Here is fiddle. https://jsfiddle.net/xta2ccdt/7/ $("#container").on("mousewheel DOMMouseScroll", function (e) { e.preventDefault(); console.log(e.pageX); console.log(e); } ); It shows…
My Favorite Bear
  • 114
  • 1
  • 1
  • 10
1
vote
1 answer

Animate lineart based on mouse position

I have a skull lineart created in illustrator. I am attempting to have the lines fill in or erase depending on the mouse position. There seems to be two ways I could accomplish this: Using lazy line painter to draw the lines as seen in my jsfiddle…
1
vote
2 answers

Live update of rgba using clientX/clientY?

The code below works until line 47 is replaced with line 48 (i.e. calculating the fillStyle). For some reason attempting to use clientY to calculate the blue portion of the rgba doesn't work, whereas calculating the alpha is not a problem.
RonH
  • 504
  • 1
  • 3
  • 12
1
vote
2 answers

How can I use the MouseEventArgs in another method?

I have a picture box which I need to get the values of the mouse position within the box once the mouse is clicked in it. I can do this using this code: public void pictureBox1_MouseClick(object sender, MouseEventArgs e) { int CurX; …
1
vote
4 answers

How can I detect the text where the mouse pointer is, using C#?

I'm looking for a way able to detect the text where the mouse pointer is, for whatever standard Windows app (IE, Firefox, Word, Notepad etc) the user is using at present. Is this possible ? (It's not for evil purposes, honest!). I've tried Googling…
Michael Low
  • 24,276
  • 16
  • 82
  • 119
1
vote
2 answers

How to get current mouse location while mouse is being dragged in javascript?

In this solution in javascript JavaScript while mousedown I can get the mouse location when it's first pressed and first clicked, but how can I get the location while its being pressed down? Thanks
omega
  • 40,311
  • 81
  • 251
  • 474
1
vote
1 answer

WPF : How to get mouse position in Window_Loaded(object sender, RoutedEventArgs e) event

WPF : How to get mouse position in Window_Loaded(object sender, RoutedEventArgs e) event
Prince OfThief
  • 6,323
  • 14
  • 40
  • 53
1
vote
1 answer

C# Show TreeNode ToolTip as long as TreeNode is hovered

When a TreeNodein my TreeViewis hovered, a ToolTip is supposed to show. And when the mouse leave the TreeNode the ToolTip should dissapear. I tried doing this by getting the MousePosition of PontToClient() and Show() the ToolTip as long as the…
user5825579
  • 105
  • 3
  • 15
1
vote
1 answer

PointToScreen is unknown

I want to locate two controls on the screen to dynamically create a "Line" between them (the Line is already in the XAML code and changing its Stroke will make it appear). I tried to catch the Tapped event of these controls and use the event's…
Myosotis
  • 239
  • 3
  • 14
1
vote
3 answers

Frame position in JavaScript

I am having a frame-based webpage with 3 frames. A topliner, a navigation on the left side and a content frame on the bottom right side. Now, I want to show up a popup-menu when the user right-clicks on the content-frame. Because a div-container can…
Robert Wismet
  • 67
  • 1
  • 5
1
vote
1 answer

How to place the mouse pointer over submit button automatically in a login page?

The question might look silly, but I want to control the mouse pointer inside my web application / webpage. One of my client asked me this requirement of Having the mouse pointer over the submit button automatically, which will save some time in his…
1
vote
1 answer

Getting Form coordinates within class

Basically I have created a Class with a method that is called everytime there is a click on my form(it is supposed to draw a single line where I clicked) it goes as follows: public void Dessiner(Graphics Fg) { Point p = Form1.MousePosition; …
Fylps
  • 13
  • 4