using UnityEngine;
namespace Rive.Components
{
///
/// Interface for widgets that can be rendered by a Rive Panel.
///
public interface IRiveWidget
{
///
/// This holds information about the object that will be rendered by the Rive renderer.
///
IRenderObject RenderObject { get; }
///
/// The RectTransform of the widget.
///
public RectTransform RectTransform { get; }
///
/// Whether the widget is enabled and its GameObject is active in the hierarchy.
///
bool Enabled { get; }
///
/// The hit test behavior of the widget.
///
HitTestBehavior HitTestBehavior { get; set; }
///
/// This controls the RiveWidget's update loop.
///
/// The time since the last frame.
/// Returns true if the widget needs to be redrawn as a result of this tick; otherwise, false.
bool Tick(float deltaTime);
///
/// Tests if a given local position within the widget's rectangle hits any interactive elements.
///
///
/// The normalized point of the pointer position in the widget's rectangle. The coordinates are in the range [0,1] where (0,0) is the bottom-left corner and (1,1) is the top-right corner.
///
///
/// Returns true if the position hits an interactive element; otherwise, false.
///
bool HitTest(Vector2 normalizedPointInRect);
///
/// Called when a pointer is pressed on the widget.
///
/// The normalized point of the pointer press in the widget's rectangle. The coordinates are in the range [0,1] where (0,0) is the bottom-left corner and (1,1) is the top-right corner.
/// The unique id for the active pointer/touch.
/// Returns true if the pointer press hits an interactive element; otherwise, false.
bool OnPointerDown(Vector2 normalizedPointInRect, int pointerId);
///
/// Called when a pointer is moved on the widget.
///
/// The normalized point of the pointer position in the widget's rectangle. The coordinates are in the range [0,1] where (0,0) is the bottom-left corner and (1,1) is the top-right corner.
/// The unique id for the active pointer/touch.
/// Returns true if the pointer move hits an interactive element; otherwise, false.
bool OnPointerMove(Vector2 normalizedPointInRect, int pointerId);
///
/// Called when a pointer is released on the widget.
///
/// The normalized point of the pointer release in the widget's rectangle. The coordinates are in the range [0,1] where (0,0) is the bottom-left corner and (1,1) is the top-right corner.
/// The unique id for the active pointer/touch.
/// Returns true if the pointer release hits an interactive element; otherwise, false.
bool OnPointerUp(Vector2 normalizedPointInRect, int pointerId);
///
/// Called when a pointer exits the widget.
///
/// The normalized point of the pointer exit in the widget's rectangle. The coordinates are in the range [0,1] where (0,0) is the bottom-left corner and (1,1) is the top-right corner.
/// The unique id for the active pointer/touch.
/// Returns true if the pointer exit hits an interactive element; otherwise, false.
bool OnPointerExit(Vector2 normalizedPointInRect, int pointerId);
///
/// Called when a pointer enters the widget.
///
/// The normalized point of the pointer enter in the widget's rectangle. The coordinates are in the range [0,1] where (0,0) is the bottom-left corner and (1,1) is the top-right corner.
/// The unique id for the active pointer/touch.
/// Returns true if the pointer enter hits an interactive element; otherwise, false.
bool OnPointerEnter(Vector2 normalizedPointInRect, int pointerId);
}
}