window_view_mouse_get_x

Returns the x coordinate of the mouse in the window with respect to the given view.

Syntax:

window_view_mouse_get_x( id );


Argument Description
id The id of the view to compare the mouse position to.


Returns: Real


Description

This function will return the mouse x position relative to the view selected. The following image illustrates how this works:




Example:

if mouse_check_button_pressed(mb_left)
   {
   var xx, yy;
   xx = window_view_mouse_get_x(0);
   yy = window_view_mouse_get_y(0);
   if xx > 0 && xx < 32 && yy > 0 && yy < 32
      {
      b_press[0] = true;
      }
   }

The above code will check for a mouse button being pressed, and if it is it then gets the mouse position relative to the view[0] and compares it to see if a variable should be set to true.


Back: Views
Next: window_view_mouse_get_y
© Copyright YoYo Games Ltd. 2015 All Rights Reserved