From 549693dd38e864a56c4f93534ab64e196bba612b Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Sun, 28 Aug 2016 19:20:49 +0200 Subject: [PATCH] Document new GUI state getters --- docs/core.rst | 80 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 30 deletions(-) diff --git a/docs/core.rst b/docs/core.rst index d2f7622..731c95e 100644 --- a/docs/core.rst +++ b/docs/core.rst @@ -46,6 +46,56 @@ Forwards a ``love.keypressed(key)`` event to SUIT. Forwards a ``love.textinput(key)`` event to SUIT. +GUI State +^^^^^^^^^ + +.. function:: anyHovered() + + :returns: ``true`` if any widget is hovered by the mouse. + +Checks if any widget is hovered by the mouse. + +.. function:: isHovered(id) + + :param mixed id: Identifier of the widget. + :returns: ``true`` if the widget is hovered by the mouse. + +Checks if the widget identified by ``id`` is hovered by the mouse. + +.. function:: wasHovered(id) + + :param mixed id: Identifier of the widget. + :returns: ``true`` if the widget was in the hovered by the mouse in the last frame. + +Checks if the widget identified by ``id`` was hovered by the mouse in the last frame. + +.. function:: anyActive() + + :returns: ``true`` if any widget is in the ``active`` state. + +Checks whether the mouse button is pressed and held on any widget. + +.. function:: isActive(id) + + :param mixed id: Identifier of the widget. + :returns: ``true`` if the widget is in the ``active`` state. + +Checks whether the mouse button is pressed and held on the widget identified by ``id``. + +.. function:: anyHit() + + :returns: ``true`` if the mouse was pressed and released on any widget. + +Check whether the mouse was pressed and released on any widget. + +.. function:: isHit(id) + + :param mixed id: Identifier of the widget. + :returns: ``true`` if the mouse was pressed and released on the widget. + +Check whether the mouse was pressed and released on the widget identified by ``id``. + + Internal Helpers ---------------- @@ -73,36 +123,6 @@ Prepares GUI state when entering a frame. Clears GUI state when exiting a frame. -GUI State -^^^^^^^^^ - -.. function:: anyHovered() - - :returns: ``true`` if any widget is hovered by the mouse. - -Checks if any widget is hovered by the mouse. - -.. function:: isHovered(id) - - :param mixed id: Identifier of the widget. - :returns: ``true`` if the widget is hovered by the mouse. - -Checks if the widget identified by ``id`` is hovered by the mouse. - -.. function:: wasHovered(id) - - :param mixed id: Identifier of the widget. - :returns: ``true`` if the widget was in the hovered by the mouse in the last frame. - -Checks if the widget identified by ``id`` was hovered by the mouse in the last frame. - -.. function:: isActive(id) - - :param mixed id: Identifier of the widget. - :returns: ``true`` if the widget is in the ``active`` state. - -Checks whether the mouse button is pressed on the widget identified by ``id``. - Mouse Input ^^^^^^^^^^^