diff --git a/Documentation.md b/Documentation.md index bb74a0d..98eaf37 100644 --- a/Documentation.md +++ b/Documentation.md @@ -59,6 +59,14 @@ Begin a new frame for the UI. Call this once every [love.update](https://love2d. #### ui:frameEnd() End the current frame. Call this once every [love.update](https://love2d.org/wiki/love.update), after other UI calls. +#### ui:frame(body) +Equivalent to: +```lua +ui:frameBegin() +body(ui) +ui:frameEnd() +``` + *** ## Transform @@ -99,6 +107,16 @@ Returns `true` if the window is open and `false` if it is closed or collapsed. #### ui:windowEnd() End a window. This must always be called after `ui:windowBegin`, regardless of whether or not the window is open. +#### ui:window(title, x, y, width, height, [flags](#flags)..., body) +#### ui:window(name, title, x, y, width, height, [flags](#flags)..., body) +Equivalent to: +```lua +if ui:windowBegin(...) then + body(ui) +end +ui:windowEnd() +``` + #### x, y, width, height = ui:windowGetBounds() Return the bounds of the current window. @@ -231,6 +249,14 @@ Specify the width of the next widget in a row layout started with `ui:layoutRowB #### ui:layoutRowEnd() Call after `ui:layoutRowBegin` in order to properly end the row layout. +#### ui:layoutRow('dynamic'/'static', height, cols, body) +Equivalent to: +```lua +ui:layoutRowBegin(...) +body(ui) +ui:layoutRowEnd() +``` + #### ui:layoutTemplateBegin(height) Start a template layout with the given `height`. Make all of your `ui:layoutTemplatePush` and `ui:layoutTemplateEnd` calls before the widgets to be laid out. Template layouts repeat row-by-row until another layout is instituted. @@ -241,6 +267,14 @@ Pushes a column onto a template layout. If the column is `'dynamic'`, it grows t #### ui:layoutTemplateEnd() End a template layout declaration. Remember to call this before creating your widgets. +#### ui:layoutTemplate(height, body) +Equivalent to: +```lua +ui:layoutTemplateBegin(height) +body(ui) +ui:layoutTemplateEnd() +``` + Example: ```lua ui:layoutTemplateBegin(100) @@ -262,6 +296,14 @@ Specify the bounds of a widget in a space layout. If the layout is dynamic, the #### ui:layoutSpaceEnd() End a space layout. +#### ui:layoutSpace('dynamic'/'static', height, widgetCount, body) +Equivalent to: +```lua +ui:layoutSpaceBegin(...) +body(ui) +ui:layoutSpaceEnd() +``` + #### x, y, width, height = ui:layoutSpaceBounds() Return the bounds of the current space layout. @@ -296,6 +338,14 @@ Call `ui:groupEnd` at the end of a group if it's open. #### ui:groupEnd() End a group. Remember to call this whenever the group is open. +#### ui:group(title, [flags](#flags)..., body) +Equivalent to: +```lua +ui:groupBegin(...) +body(ui) +ui:groupEnd() +``` + ### Trees #### open = ui:treePush('node'/'tab', title) @@ -310,6 +360,16 @@ Remember to call `ui:treePop` if the item is open. #### ui:treePop() Ends a tree. Call this at the end of an open tree item. +#### ui:tree('node'/'tab', title, [image](#images), body) +#### ui:tree('node'/'tab', title, [image](#images), 'collapsed'/'expanded', body) +Equivalent to: +```lua +if ui:treePush(...) then + body(ui) + ui:treePop() +end +``` + ### Popups #### open = ui:popupBegin('dynamic'/'static', title, x, y, width, height, [flags](#flags)...) @@ -325,6 +385,15 @@ Close the current popup. #### ui:popupEnd() End a popup. Be sure to call this when ending an open popup. +#### ui:popup('dynamic'/'static', title, x, y, width, height, [flags](#flags)..., body) +Equivalent to: +```lua +if ui:popupBegin(...) then + body(ui) + ui:popupEnd() +end +``` + ### Context Menus #### open = ui:contextualBegin(width, height, triggerX, triggerY, triggerWidth, triggerHeight, [flags](#flags)...) @@ -347,6 +416,15 @@ Close the current context menu. #### ui:contextualEnd() End the current context menu. Be sure to call this at the end of an open context menu. +#### ui:contextual(width, height, triggerX, triggerY, triggerWidth, triggerHeight, [flags](#flags)..., body) +Equivalent to: +```lua +if ui:contextualBegin(...) then + body(ui) + ui:contextualEnd() +end +``` + ### Tooltips #### ui:tooltip(text) @@ -362,6 +440,15 @@ Be sure to call `ui:tooltipEnd` at the end of an open tooltip. #### ui:tooltipEnd() End a tooltip previously started with `ui:tooltipBegin`. Call this at the end of every open tooltip. +#### ui:tooltip(width, body) +Equivalent to: +```lua +if ui:tooltipBegin(width) then + body(ui) + ui:tooltipEnd() +end +``` + ### Menus #### ui:menubarBegin() @@ -370,6 +457,14 @@ Start a menu bar. Menu bars stay at the top of a window even when scrolling. Cal #### ui:menubarEnd() Ends a menu bar. Always call this at the end of a menu bar started with `ui:menubarBegin`. +#### ui:menubar(body) +Equivalent to: +```lua +ui:menubarBegin() +body(ui) +ui:menubarEnd() +``` + #### open = ui:menuBegin(title, [symbol](#symbols)/[image](#images), width, height) #### open = ui:menuBegin(title, [symbol](#symbols)/[image](#images), width, height, [align](#alignment)) Start a menu of the given title and size. Optionally specify a [symbol](#symbols), [image](#images), and/or [alignment](#alignment). @@ -391,6 +486,16 @@ Close the current menu. #### ui:menuEnd() End the current menu. Always call this at the end of any open menu. +#### ui:menu(title, [symbol](#symbols)/[image](#images), width, height, body) +#### ui:menu(title, [symbol](#symbols)/[image](#images), width, height, [align](#alignment), body) +Equivalent to: +```lua +if ui:menuBegin(...) then + body(ui) + ui:menuEnd() +end +``` + ### General #### ui:label(text) @@ -511,6 +616,18 @@ Close the current combobox. #### ui:comboboxEnd() End the current combobox. Always call this at the end of open comboboxes. +#### ui:combobox(text, body) +#### ui:combobox(text, [color](#colors)/[symbol](#symbols)/[image](#images), body) +#### ui:combobox(text, [color](#colors)/[symbol](#symbols)/[image](#images), width, body) +#### ui:combobox(text, [color](#colors)/[symbol](#symbols)/[image](#images), width, height, body) +Equivalent to: +```lua +if ui:comboboxBegin(...) then + body(ui) + ui:comboboxEnd() +end +``` + ### Utilities #### x, y, width, height = ui:widgetBounds()