tracking mouse

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By tutorialman

How to limit the scope of get_viewport (). Get_mouse_position (). For example, mouse tracking was only in one block?

:bust_in_silhouette: Reply From: Marshall Demirjian

I’m a little confused by your question, but if you only want to get the position within a certain square, you could just setup some conditionals that ignore the position unless it is within the bounds of a square. For example:

if getviewport (). Getmouse_position ().x > 100 and getviewport (). Getmouse_position ().x < 200:

Do something now that you know the x position is within the scope you care about