1. bianco.pointer
[![Build Status][ci-image]][ci-url] [![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] [![MIT License][license-image]][license-url]
bianco.pointer
Package: bianco.pointer
Created by: biancojs
Last modified: Mon, 11 Apr 2022 17:43:11 GMT
Version: 1.1.0
License: MIT
Downloads: 787
Repository: https://github.com/biancojs/pointer

Install

npm install bianco.pointer
yarn add bianco.pointer

bianco.pointer

Build Status
NPM version
NPM downloads
MIT License

Usage

 import pointer from 'bianco.pointer'

// get the x and y position from any Mouse or Touch event
const { x, y } = pointer.position(touchEvent)

API

Table of Contents

position

Normalize the pointer events to get a single position of the pointer on the screen

Parameters

Examples

 import { position } from 'bianco.pointer'
import { add } from 'bianco.events'


add(window, 'touchmove mousemove', function(event) {
  const { x, y } = position(event)

  console.log('Your pointer y is=', y, 'your pointer x is', x)
})

Returns Object position - pointer position on the screen

Returns number position.x - x condinates relative to the screen

Returns number position.y - y condinates relative to the screen

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code