IWithMovablePointer.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * Copyright (c) 2021 Vuplex Inc. All rights reserved.
  3. *
  4. * Licensed under the Vuplex Commercial Software Library License, you may
  5. * not use this file except in compliance with the License. You may obtain
  6. * a copy of the License at
  7. *
  8. * https://vuplex.com/commercial-library-license
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. using UnityEngine;
  17. namespace Vuplex.WebView {
  18. /// <summary>
  19. /// An interface implemented by a webview if it supports `MovePointer`,
  20. /// which can be used to implement hover or drag-and-drop interactions.
  21. /// </summary>
  22. public interface IWithMovablePointer {
  23. /// <summary>
  24. /// Moves the pointer to the given point in the webpage.
  25. /// </summary>
  26. /// <remarks>
  27. /// This can be used to trigger hover effects in the page or can be used
  28. /// in conjunction with the `IWithPointerDownAndUp` interface to implement
  29. /// drag-and-drop interactions.
  30. /// </remarks>
  31. /// <param name="point">
  32. /// The x and y components of the point are values
  33. /// between 0 and 1 that are normalized to the width and height, respectively. For example,
  34. /// `point.x = x in Unity units / width in Unity units`.
  35. /// Like in the browser, the origin is in the upper-left corner,
  36. /// the positive direction of the y-axis is down, and the positive
  37. /// direction of the x-axis is right.
  38. /// </param>
  39. void MovePointer(Vector2 point);
  40. }
  41. }