# Zooming towards the mouse

**URL:** https://forum.kirupa.com/t/zooming-towards-the-mouse/90123
**Category:** Uncategorized
**Created:** [May 14, 2005, 8:27pm UTC](https://forum.kirupa.com/t/zooming-towards-the-mouse/90123 "2005-05-14T20:27:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dualaud](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@dualaud](https://forum.kirupa.com/u/dualaud)
#### Post date: [May 14, 2005, 8:27pm UTC](https://forum.kirupa.com/t/zooming-towards-the-mouse/90123/1 "2005-05-14T20:27:40Z")

</div>

lets say i have a square button; it should zoom towards the mouse depending on where i enter the buttons hit area. i.e. i enter the square from the bottom right, it’d zoom 120% towards where i entered the square on the bottom right, and if i enter the hitarea topleft, it should zoom 120% towards that position.

how can i make that button ‘know’ where the mouse entered it and zoom towards that position?  
or should it rather move towards that position while scaling?:puzzle:

thanks for your help,  
dual
