Questions tagged [mouse-position]

197 questions
1
vote
3 answers

How do I offset mouse position so that I can centre paragraphs when the user clicks?

I am creating an interactive website where the user is able to click anywhere on the page and each paragraph will show up one by one. At the moment the paragraphs are displaying to the right of the click but i want the paragraph to be centred on the…
wophi_1888
  • 41
  • 4
1
vote
1 answer

encoding problem when OpenLayers is loaded from web host

I'm working on a web based GIS using OpenLayers 7.1.0. When testing the code with VS-Code on my laptop (loading ol.js from local hard drive) everything is ok. Then I upload the project to a Linux web host (Plesk panel) including ol.js because I want…
1
vote
2 answers

How to get the mouse position when click on a specific element?

For example, I would like the content of a text field to be copied to the clipboard when I click on it. A note should then be displayed at the mouse position of this click. This all works well as far as I can assign a class to the relevant text…
Scudo
  • 41
  • 4
1
vote
1 answer

How To Get Mouse Position Using Cinemachine?

// Calculate the world position for the mouse. var worldPos = Camera.main.ScreenToWorldPoint(Input.mousePosition); This code is what I'm using to get the mouse's position, but after using cinemachine this code seems to break. How can I get the…
1
vote
1 answer

Canvas Refrence point of drawing using mouse change we zoom in

I want to write on the image using canvas but when I zoom the image mouse pointer change and it does not write in the correct place kindly help me where I need to change that code Thanks in advance
user16605366
1
vote
1 answer

How do I make the bullets to shoot towards my mouse when I leftclick in this code?

import pygame import random import math from pygame import mixer pygame.init() screen = pygame.display.set_mode((1280, 720)) background = pygame.image.load('1264.jpg') background = pygame.transform.scale(background, (1290, 720))…
1
vote
4 answers

Determine the mouse position inside an iframe, but inclusive of the parent

I have an iframe inside which i detect a right click and pass the mouse event to a function in the parent. Here, (inside the parent function), i have the logic to display a custom context menu and the context menu html markup is inserted into the…
Darshan
  • 91
  • 1
  • 6
1
vote
2 answers

Unity: TopDown view - GameObject does not rotate toward mousepos

I've been doing some research on why my player(GameObject) is does not rotate toward my mouse position in my TopDown 3D game and I can't seem to find what is wrong with my code, so im making this post. The problem thats I have is that only the…
Thomas
  • 21
  • 3
1
vote
0 answers

How do I move a rectangle towards the mouse click? (HTML canvas)

Recently, I have been trying to learn to use the HTML/Javascript canvas. I already know how to use HTML, CSS, and most Javascript code, but I have always been slightly bad at using the canvas. I wanted to make that known, because I want the answer…
1
vote
0 answers

Appending at cursor position

I am implementing Drop function,which on drop appends the child at cursor position on the container.But the element is getting appended slightly away from the cursor position.Below is my Drop function: drop(event) { event.preventDefault(); …
1
vote
1 answer

JavaScript Mouse Position Clip Path Effect With CSS Variables Bubbling

I wanted to recreate the text colour overlay clip-path effect from this site http://fleurmoreau.fr/ I made a version here https://codepen.io/Kerrys7777/pen/eYOrwbV. It seems to work OK, but hovering some areas seems to cause a bubbling effect? What…
Kerry7777
  • 4,246
  • 1
  • 18
  • 28
1
vote
2 answers

Rotate SVG gradient based on mouse position

I’d like to rotate the gradient of an svg based on the mouse position. The mechanic should be as followed, where [0,0] is the mouse being in the upper left corder of the window, [100%,0] should be the mouse in the upper right corner of the window…
user1706680
  • 1,103
  • 3
  • 15
  • 34
1
vote
1 answer

Input.mousePosition with 4-5 digits of decimal precision?

I need to obtain display coordinates of the mousePosition by clicking "Fire1" button. The script is very simple, and I get what I need. But I would like the coordinates to be more precise. public class exmp : MonoBehaviour { public void…
ivanshv
  • 47
  • 1
  • 2
  • 7
1
vote
0 answers

Assembly get mouse position (TASM)

My program just can't get the mouse position correctly. I have tried two cases, the first: - No mouse reset - Code: WAIT_FOR_CLICK: ; CHECK IF THE MOUSE IS CLICKED MOV AX,3H MOV BX, 0 INT 33H CMP BX, 0 JZ WAIT_FOR_CLICK ; DISPLAY…
Yosry
  • 147
  • 2
  • 9
1
vote
1 answer

Save first mouseposition while 'mouseDragged'

I've created a Java-Application to add/remove and show a random number of points on a JPanel. It is possible to move the points per drag&drop. To undo the last actions I buffer the points. My question: if a point will moved via 'mouseDragged', is…
t1n1tus
  • 99
  • 1
  • 8