Source Academy Modules
    Preparing search index...

    Function pointer_over_gameobject

    • Detects if the (mouse) pointer is over the gameobject. This function should be called in your update function.

      Parameters

      • gameObject: GameObject

        The gameobject reference.

      Returns boolean

      True, if the pointer is over the gameobject.

      // Creating a button using a gameobject
      const button = createTextGameObject('click me');
      // Test if button is clicked
      if (pointer_over_gameobject(button) && input_left_mouse_down()) {
      // Button is clicked
      }