...

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  	Sprite - Resizable image.
    19  	Text - Text display widget.
    20  	Window - Widget paging mechanism. Only one widget added to a window is displayed at a time.
    21  
    22  # Input Propagation
    23  
    24  Mouse events are passed to the topmost widget under the mouse. If a widget
    25  returns a handled value of false, the event continues to propagate down the
    26  stack of widgets under the mouse.
    27  
    28  Clicking or tapping on a widget focuses the widget. This is handled by etk
    29  automatically when a widget returns a handled value of true.
    30  
    31  Keyboard events are passed to the focused widget.
    32  
    33  # Focus Propagation
    34  
    35  When attempting to change which widget is focused, etk checks whether the widget
    36  to be focused accepts this focus. If it does, the previously focused widget is
    37  un-focused. If the widget does not accept the focus, the previously focused
    38  widget remains focused.
    39  
    40  # Cursor Unification
    41  
    42  Input events generated by desktop mice and touch screens are unified in etk.
    43  These input events are simplified into an image.Point specifying the location
    44  of the event and two parameters: clicked and pressed.
    45  
    46  Clicked is true the first frame the mouse event or touch screen event is received.
    47  When the mouse click or touch screen tap is released, the widget that was originally
    48  clicked or tapped always receives a final event where clicked and pressed are both false.
    49  
    50  # Draw Order
    51  
    52  Each time etk draws a widget it subsequently draws all of the widget's children
    53  in the order they are returned.
    54  
    55  # Subpackages
    56  
    57  There are two subpackages in etk: messeji and kibodo. These are available for
    58  use without requiring etk. Usually you will not need to reference any
    59  subpackages, as etk wraps them to provide widgets with additional features.
    60  */
    61  package etk
    62  

View as plain text