...

Source file src/code.rocket9labs.com/tslocum/etk/doc.go

Documentation: code.rocket9labs.com/tslocum/etk

     1  /*
     2  Package etk provides an Ebitengine tool kit for creating graphical user interfaces.
     3  
     4  # Widgets
     5  
     6  Custom widgets may be created entirely from scratch or may be
     7  based on official widgets.
     8  
     9  The following official widgets are available:
    10  
    11  	Box - Building block for creating other widgets.
    12  	Button - Clickable button.
    13  	Flex - Flexible stack-based layout. Each Flex widget may be oriented horizontally or vertically.
    14  	Frame - Widget container. All child widgets are displayed at once. Child widgets are not repositioned by default.
    15  	Grid - Highly customizable cell-based layout. Widgets added to the Grid may span multiple cells.
    16  	Input - Text input widget. The Input widget is simply a Text widget that also accepts user input.
    17  	List - List of widgets as selectable items.
    18  	Text - Text display widget.
    19  	Window - Widget paging mechanism. Only one widget added to a window is displayed at a time.
    20  
    21  # Input Propagation
    22  
    23  Mouse events are passed to the topmost widget under the mouse. If a widget
    24  returns a handled value of false, the event continues to propagate down the
    25  stack of widgets under the mouse.
    26  
    27  Clicking or tapping on a widget focuses the widget. This is handled by etk
    28  automatically when a widget returns a handled value of true.
    29  
    30  Keyboard events are passed to the focused widget.
    31  
    32  # Focus Propagation
    33  
    34  When attempting to change which widget is focused, etk checks whether the widget
    35  to be focused accepts this focus. If it does, the previously focused widget is
    36  un-focused. If the widget does not accept the focus, the previously focused
    37  widget remains focused.
    38  
    39  # Cursor Unification
    40  
    41  Input events generated by desktop mice and touch screens are unified in etk.
    42  These input events are simplified into an image.Point specifying the location
    43  of the event and two parameters: clicked and pressed.
    44  
    45  Clicked is true the first frame the mouse event or touch screen event is received.
    46  When the mouse click or touch screen tap is released, the widget that was originally
    47  clicked or tapped always receives a final event where clicked and pressed are both false.
    48  
    49  # Draw Order
    50  
    51  Each time etk draws a widget it subsequently draws all of the widget's children
    52  in the order they are returned.
    53  
    54  # Subpackages
    55  
    56  There are two subpackages in etk: messeji and kibodo. These are available for
    57  use without requiring etk. Usually you will not need to reference any
    58  subpackages, as etk wraps them to provide widgets with additional features.
    59  */
    60  package etk
    61  

View as plain text