├── .github
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── bug_report_form.yml
│ ├── config.yml
│ ├── docs.md
│ └── feature.md
├── Basalt
├── init.lua
├── libraries
│ ├── basaltDraw.lua
│ ├── basaltEvent.lua
│ ├── basaltLogs.lua
│ ├── basaltMon.lua
│ ├── bimg.lua
│ ├── images.lua
│ ├── process.lua
│ ├── reactivePrimitives.lua
│ ├── tHex.lua
│ ├── utils.lua
│ └── xmlParser.lua
├── loadObjects.lua
├── main.lua
├── objects
│ ├── BaseFrame.lua
│ ├── Button.lua
│ ├── ChangeableObject.lua
│ ├── Checkbox.lua
│ ├── Container.lua
│ ├── Dropdown.lua
│ ├── Flexbox.lua
│ ├── Frame.lua
│ ├── Graph.lua
│ ├── Image.lua
│ ├── Input.lua
│ ├── Label.lua
│ ├── List.lua
│ ├── Menubar.lua
│ ├── MonitorFrame.lua
│ ├── MovableFrame.lua
│ ├── Object.lua
│ ├── Pane.lua
│ ├── Program.lua
│ ├── Progressbar.lua
│ ├── Radio.lua
│ ├── ScrollableFrame.lua
│ ├── Scrollbar.lua
│ ├── Slider.lua
│ ├── Switch.lua
│ ├── Textfield.lua
│ ├── Thread.lua
│ ├── Timer.lua
│ ├── Treeview.lua
│ └── VisualObject.lua
├── plugin.lua
└── plugins
│ ├── advancedBackground.lua
│ ├── animations.lua
│ ├── basaltAdditions.lua
│ ├── bigfonts.lua
│ ├── border.lua
│ ├── debug.lua
│ ├── dynamicValues.lua
│ ├── pixelbox.lua
│ ├── reactive.lua
│ ├── shadow.lua
│ ├── textures.lua
│ └── themes.lua
├── CHANGELOG.md
├── LICENSE
├── README.md
└── docs
├── .nojekyll
├── Home.md
├── _footer.md
├── _media
├── basaltPreview2.gif
├── dynamic-frames.mp4
├── flexbox-example.png
├── flexgrow-property.mp4
├── frame-flexgrow-property.mp4
├── frames-with-menubars.mp4
├── frames-with-sidebar.mp4
├── installer.png
├── logo.png
├── pane-example-1.png
├── pane-example-2.png
├── resizable-frames.mp4
└── scrollable-frames.mp4
├── _navbar.md
├── _sidebar.md
├── bTemp.lua
├── docs1_6
├── .nojekyll
├── CNAME
├── Home.md
├── _footer.md
├── _media
│ ├── basaltPreview2.gif
│ ├── dynamic-frames.mp4
│ ├── frames-with-menubars.mp4
│ ├── frames-with-sidebar.mp4
│ ├── installer.png
│ ├── logo.png
│ ├── pane-example-1.png
│ ├── pane-example-2.png
│ ├── resizable-frames.mp4
│ └── scrollable-frames.mp4
├── _navbar.md
├── _sidebar.md
├── favicon-16x16.png
├── favicon-32x32.png
├── favicon.ico
├── home
│ ├── How-To.md
│ └── download.md
├── index.html
├── objects
│ ├── Animation.md
│ ├── Animation
│ │ ├── add.md
│ │ ├── addMode.md
│ │ ├── cancel.md
│ │ ├── changeBackground.md
│ │ ├── changeText.md
│ │ ├── changeTextColor.md
│ │ ├── move.md
│ │ ├── offset.md
│ │ ├── onDone.md
│ │ ├── onStart.md
│ │ ├── play.md
│ │ ├── setMode.md
│ │ ├── setObject.md
│ │ ├── size.md
│ │ └── wait.md
│ ├── Basalt.md
│ ├── Basalt
│ │ ├── autoUpdate.md
│ │ ├── createFrame.md
│ │ ├── debug.md
│ │ ├── getActiveFrame.md
│ │ ├── getFrame.md
│ │ ├── getTheme.md
│ │ ├── getVariable.md
│ │ ├── getVersion.md
│ │ ├── isKeyDown.md
│ │ ├── log.md
│ │ ├── onEvent.md
│ │ ├── removeFrame.md
│ │ ├── schedule.md
│ │ ├── setActiveFrame.md
│ │ ├── setMouseDragThrottle.md
│ │ ├── setMouseMoveThrottle.md
│ │ ├── setTheme.md
│ │ ├── setVariable.md
│ │ ├── stopUpdate.md
│ │ └── update.md
│ ├── Button.md
│ ├── Button
│ │ ├── setHorizontalAlign.md
│ │ ├── setText.md
│ │ └── setVerticalAlign.md
│ ├── Checkbox.md
│ ├── Checkbox
│ │ └── setSymbol.md
│ ├── Dropdown.md
│ ├── Dropdown
│ │ ├── addItem.md
│ │ ├── clear.md
│ │ ├── editItem.md
│ │ ├── getAll.md
│ │ ├── getItem.md
│ │ ├── getItemCount.md
│ │ ├── getItemIndex.md
│ │ ├── getOffset.md
│ │ ├── removeItem.md
│ │ ├── selectItem.md
│ │ ├── setDropdownSize.md
│ │ ├── setOffset.md
│ │ └── setSelectedItem.md
│ ├── Frame.md
│ ├── Frame
│ │ ├── addLayout.md
│ │ ├── addLayoutFromString.md
│ │ ├── addObject.md
│ │ ├── getFocusedObject.md
│ │ ├── getLastLayout.md
│ │ ├── getObject.md
│ │ ├── getOffset.md
│ │ ├── removeFocusedObject.md
│ │ ├── removeObject.md
│ │ ├── setBar.md
│ │ ├── setBarTextAlign.md
│ │ ├── setFocusedObject.md
│ │ ├── setMirror.md
│ │ ├── setMonitor.md
│ │ ├── setMonitorScale.md
│ │ ├── setMovable.md
│ │ ├── setOffset.md
│ │ ├── setScrollAmount.md
│ │ ├── setScrollable.md
│ │ ├── setTheme.md
│ │ └── showBar.md
│ ├── Image.md
│ ├── Image
│ │ ├── getImageSize.md
│ │ ├── getMetadata.md
│ │ ├── loadImage.md
│ │ ├── play.md
│ │ ├── resizeImage.md
│ │ ├── selectFrame.md
│ │ ├── setImage.md
│ │ ├── shrink.md
│ │ └── usePalette.md
│ ├── Input.md
│ ├── Input
│ │ ├── getInputLimit.md
│ │ ├── getInputType.md
│ │ ├── setDefaultText.md
│ │ ├── setInputLimit.md
│ │ └── setInputType.md
│ ├── Label.md
│ ├── Label
│ │ ├── getFontSize.md
│ │ ├── setFontSize.md
│ │ └── setText.md
│ ├── List.md
│ ├── List
│ │ ├── addItem.md
│ │ ├── clear.md
│ │ ├── editItem.md
│ │ ├── getAll.md
│ │ ├── getItem.md
│ │ ├── getItemCount.md
│ │ ├── getItemIndex.md
│ │ ├── getOffset.md
│ │ ├── removeItem.md
│ │ ├── selectItem.md
│ │ ├── setOffset.md
│ │ ├── setScrollable.md
│ │ └── setSelectedItem.md
│ ├── Menubar.md
│ ├── Menubar
│ │ ├── addItem.md
│ │ ├── clear.md
│ │ ├── editItem.md
│ │ ├── getAll.md
│ │ ├── getItem.md
│ │ ├── getItemCount.md
│ │ ├── getItemIndex.md
│ │ ├── getOffset.md
│ │ ├── removeItem.md
│ │ ├── selectItem.md
│ │ ├── setOffset.md
│ │ ├── setScrollable.md
│ │ ├── setSelectedItem.md
│ │ └── setSpace.md
│ ├── Object.md
│ ├── Object
│ │ ├── disable.md
│ │ ├── enable.md
│ │ ├── getAbsolutePosition.md
│ │ ├── getAnchorPosition.md
│ │ ├── getBackground.md
│ │ ├── getForeground.md
│ │ ├── getName.md
│ │ ├── getPosition.md
│ │ ├── getSize.md
│ │ ├── getValue.md
│ │ ├── hide.md
│ │ ├── isFocused.md
│ │ ├── isVisible.md
│ │ ├── onChange.md
│ │ ├── onChar.md
│ │ ├── onClick.md
│ │ ├── onClickUp.md
│ │ ├── onDrag.md
│ │ ├── onEvent.md
│ │ ├── onGetFocus.md
│ │ ├── onHover.md
│ │ ├── onKey.md
│ │ ├── onKeyUp.md
│ │ ├── onLeave.md
│ │ ├── onLoseFocus.md
│ │ ├── onRelease.md
│ │ ├── onReposition.md
│ │ ├── onResize.md
│ │ ├── onScroll.md
│ │ ├── remove.md
│ │ ├── setAnchor.md
│ │ ├── setBackground.md
│ │ ├── setBorder.md
│ │ ├── setFocus.md
│ │ ├── setForeground.md
│ │ ├── setParent.md
│ │ ├── setPosition.md
│ │ ├── setShadow.md
│ │ ├── setSize.md
│ │ ├── setValue.md
│ │ ├── setZIndex.md
│ │ └── show.md
│ ├── Pane.md
│ ├── Program.md
│ ├── Program
│ │ ├── execute.md
│ │ ├── getQueuedEvents.md
│ │ ├── getStatus.md
│ │ ├── injectEvent.md
│ │ ├── injectEvents.md
│ │ ├── isPaused.md
│ │ ├── onDone.md
│ │ ├── onError.md
│ │ ├── pause.md
│ │ ├── setEnviroment.md
│ │ └── stop.md
│ ├── Progressbar.md
│ ├── Progressbar
│ │ ├── getProgress.md
│ │ ├── onDone.md
│ │ ├── setBackgroundSymbol.md
│ │ ├── setDirection.md
│ │ ├── setProgress.md
│ │ └── setProgressBar.md
│ ├── Radio.md
│ ├── Radio
│ │ ├── addItem.md
│ │ ├── clear.md
│ │ ├── editItem.md
│ │ ├── getAll.md
│ │ ├── getItem.md
│ │ ├── getItemCount.md
│ │ ├── getItemIndex.md
│ │ ├── removeItem.md
│ │ ├── selectItem.md
│ │ └── setSelectedItem.md
│ ├── Scrollbar.md
│ ├── Scrollbar
│ │ ├── getIndex.md
│ │ ├── setBackgroundSymbol.md
│ │ ├── setBarType.md
│ │ ├── setIndex.md
│ │ ├── setMaxValue.md
│ │ └── setSymbol.md
│ ├── Slider.md
│ ├── Slider
│ │ ├── getIndex.md
│ │ ├── setBackgroundSymbol.md
│ │ ├── setBarType.md
│ │ ├── setIndex.md
│ │ ├── setMaxValue.md
│ │ └── setSymbol.md
│ ├── Textfield.md
│ ├── Textfield
│ │ ├── addKeywords.md
│ │ ├── addLine.md
│ │ ├── addRule.md
│ │ ├── editLine.md
│ │ ├── getLine.md
│ │ ├── getLines.md
│ │ ├── getTextCursor.md
│ │ └── removeLine.md
│ ├── Thread.md
│ ├── Thread
│ │ ├── getStatus.md
│ │ ├── start.md
│ │ └── stop.md
│ ├── Timer.md
│ └── Timer
│ │ ├── cancel.md
│ │ ├── onCall.md
│ │ ├── setTime.md
│ │ └── start.md
└── tips
│ ├── buttonColoring.md
│ ├── design.md
│ ├── dynamicvalues.md
│ ├── logic.md
│ └── xml.md
├── favicon-16x16.png
├── favicon-32x32.png
├── favicon.ico
├── guides
├── dynamicvalues.md
├── introduction.md
└── xml.md
├── home
├── How-To.md
├── download.md
└── getting-started.md
├── index.html
├── install.lua
├── objects
├── Animation.md
├── Animation
│ ├── add.md
│ ├── addMode.md
│ ├── cancel.md
│ ├── changeBackground.md
│ ├── changeText.md
│ ├── changeTextColor.md
│ ├── move.md
│ ├── offset.md
│ ├── onDone.md
│ ├── onStart.md
│ ├── play.md
│ ├── setMode.md
│ ├── setObject.md
│ ├── size.md
│ └── wait.md
├── Basalt.md
├── Basalt
│ ├── addObject.md
│ ├── addPlugin.md
│ ├── autoUpdate.md
│ ├── createFrame.md
│ ├── debug.md
│ ├── getActiveFrame.md
│ ├── getFrame.md
│ ├── getTheme.md
│ ├── getVariable.md
│ ├── getVersion.md
│ ├── isKeyDown.md
│ ├── log.md
│ ├── memory.md
│ ├── onEvent.md
│ ├── removeFrame.md
│ ├── schedule.md
│ ├── setActiveFrame.md
│ ├── setMouseDragThrottle.md
│ ├── setMouseMoveThrottle.md
│ ├── setRenderingThrottle.md
│ ├── setTheme.md
│ ├── setVariable.md
│ ├── stopUpdate.md
│ └── update.md
├── BaseFrame.md
├── BaseFrame
│ ├── getOffset.md
│ └── setOffset.md
├── Button.md
├── Button
│ ├── setHorizontalAlign.md
│ ├── setText.md
│ └── setVerticalAlign.md
├── ChangeableObject.md
├── ChangeableObject
│ ├── getValue.md
│ ├── onChange.md
│ └── setValue.md
├── Checkbox.md
├── Checkbox
│ └── setSymbol.md
├── Container.md
├── Container
│ ├── addChild.md
│ ├── clearFocusedChild.md
│ ├── getChild.md
│ ├── getDeepChild.md
│ ├── removeChild.md
│ ├── removeChildren.md
│ ├── setFocusedChild.md
│ ├── setImportant.md
│ ├── sortElementOrder.md
│ └── updateZIndex.md
├── Dropdown.md
├── Dropdown
│ ├── addItem.md
│ ├── clear.md
│ ├── editItem.md
│ ├── getAll.md
│ ├── getItem.md
│ ├── getItemCount.md
│ ├── getItemIndex.md
│ ├── getOffset.md
│ ├── removeItem.md
│ ├── selectItem.md
│ ├── setDropdownSize.md
│ ├── setOffset.md
│ └── setSelectedItem.md
├── Flexbox.md
├── Flexbox
│ ├── addBreak.md
│ ├── getDirection.md
│ ├── getFlexBasis.md
│ ├── getFlexGrow.md
│ ├── getFlexShrink.md
│ ├── getJustifyContent.md
│ ├── getSpacing.md
│ ├── getWrap.md
│ ├── setDirection.md
│ ├── setFlexBasis.md
│ ├── setFlexGrow.md
│ ├── setFlexShrink.md
│ ├── setJustifyContent.md
│ ├── setSpacing.md
│ ├── setWrap.md
│ └── updateLayout.md
├── Frame.md
├── Frame
│ ├── addLayout.md
│ ├── addLayoutFromString.md
│ ├── addObject.md
│ ├── getFocusedObject.md
│ ├── getLastLayout.md
│ ├── getObject.md
│ ├── getOffset.md
│ ├── removeFocusedObject.md
│ ├── removeObject.md
│ ├── setBar.md
│ ├── setBarTextAlign.md
│ ├── setFocusedObject.md
│ ├── setMirror.md
│ ├── setMonitor.md
│ ├── setMonitorScale.md
│ ├── setMovable.md
│ ├── setOffset.md
│ ├── setScrollAmount.md
│ ├── setScrollable.md
│ ├── setTheme.md
│ └── showBar.md
├── Graph.md
├── Graph
│ ├── Textdokument (neu).txt
│ ├── addDataPoint.md
│ ├── getGraphSymbol.md
│ ├── getMaxEntries.md
│ ├── getMaxValue.md
│ ├── setGraphColor.md
│ ├── setGraphSymbol.md
│ ├── setGraphType.md
│ ├── setMaxEntries.md
│ ├── setMaxValue.md
│ └── setMinValue.md
├── Image.md
├── Image
│ ├── addFrame.md
│ ├── blit.md
│ ├── clear.md
│ ├── getActiveFrame.md
│ ├── getFrame.md
│ ├── getFrameCount.md
│ ├── getFrameObject.md
│ ├── getFrames.md
│ ├── getImage.md
│ ├── getImageSize.md
│ ├── getMetadata.md
│ ├── getOffset.md
│ ├── getShrinkedImage.md
│ ├── loadImage.md
│ ├── moveFrame.md
│ ├── play.md
│ ├── removeFrame.md
│ ├── resizeImage.md
│ ├── selectFrame.md
│ ├── setBg.md
│ ├── setFg.md
│ ├── setImage.md
│ ├── setImageSize.md
│ ├── setOffset.md
│ ├── setText.md
│ ├── shrink.md
│ └── usePalette.md
├── Input.md
├── Input
│ ├── getInputLimit.md
│ ├── getInputType.md
│ ├── getOffset.md
│ ├── getTextOffset.md
│ ├── setDefaultText.md
│ ├── setInputLimit.md
│ ├── setInputType.md
│ ├── setOffset.md
│ └── setTextOffset.md
├── Label.md
├── Label
│ ├── getFontSize.md
│ ├── setFontSize.md
│ ├── setText.md
│ └── setTextAlign.md
├── List.md
├── List
│ ├── addItem.md
│ ├── clear.md
│ ├── editItem.md
│ ├── getAll.md
│ ├── getItem.md
│ ├── getItemCount.md
│ ├── getItemIndex.md
│ ├── getOffset.md
│ ├── getOptions.md
│ ├── getSelectionColor.md
│ ├── isSelectionColorActive.md
│ ├── onSelect.md
│ ├── removeItem.md
│ ├── selectItem.md
│ ├── setOffset.md
│ ├── setOptions.md
│ ├── setScrollable.md
│ └── setSelectionColor.md
├── Menubar.md
├── Menubar
│ ├── addItem.md
│ ├── clear.md
│ ├── editItem.md
│ ├── getAll.md
│ ├── getItem.md
│ ├── getItemCount.md
│ ├── getItemIndex.md
│ ├── getOffset.md
│ ├── getSpace.md
│ ├── removeItem.md
│ ├── selectItem.md
│ ├── setOffset.md
│ ├── setScrollable.md
│ ├── setSelectedItem.md
│ └── setSpace.md
├── MonitorFrame.md
├── MonitorFrame
│ ├── setMonitor.md
│ └── setMonitorGroup.md
├── MovableFrame.md
├── MovableFrame
│ ├── getDraggingMap.md
│ └── setDraggingMap.md
├── Object.md
├── Object
│ ├── disable.md
│ ├── enable.md
│ ├── getAbsolutePosition.md
│ ├── getAnchorPosition.md
│ ├── getBackground.md
│ ├── getForeground.md
│ ├── getName.md
│ ├── getParent.md
│ ├── getPosition.md
│ ├── getSize.md
│ ├── getType.md
│ ├── getValue.md
│ ├── getZIndex.md
│ ├── hide.md
│ ├── isFocused.md
│ ├── isType.md
│ ├── isVisible.md
│ ├── onChar.md
│ ├── onClick.md
│ ├── onClickUp.md
│ ├── onDrag.md
│ ├── onEvent.md
│ ├── onGetFocus.md
│ ├── onHover.md
│ ├── onKey.md
│ ├── onKeyUp.md
│ ├── onLeave.md
│ ├── onLoseFocus.md
│ ├── onRelease.md
│ ├── onReposition.md
│ ├── onResize.md
│ ├── onScroll.md
│ ├── remove.md
│ ├── setAnchor.md
│ ├── setBackground.md
│ ├── setBorder.md
│ ├── setFocus.md
│ ├── setForeground.md
│ ├── setParent.md
│ ├── setPosition.md
│ ├── setShadow.md
│ ├── setSize.md
│ ├── setValue.md
│ ├── setZIndex.md
│ └── show.md
├── Pane.md
├── Program.md
├── Program
│ ├── execute.md
│ ├── getQueuedEvents.md
│ ├── getStatus.md
│ ├── injectEvent.md
│ ├── injectEvents.md
│ ├── isPaused.md
│ ├── onDone.md
│ ├── onError.md
│ ├── pause.md
│ ├── setEnviroment.md
│ ├── stop.md
│ └── updateQueuedEvents.md
├── Progressbar.md
├── Progressbar
│ ├── getProgress.md
│ ├── onDone.md
│ ├── setBackgroundSymbol.md
│ ├── setDirection.md
│ ├── setProgress.md
│ └── setProgressBar.md
├── Radio.md
├── Radio
│ ├── addItem.md
│ ├── clear.md
│ ├── editItem.md
│ ├── getAll.md
│ ├── getItem.md
│ ├── getItemCount.md
│ ├── getItemIndex.md
│ ├── removeItem.md
│ ├── selectItem.md
│ └── setSelectedItem.md
├── ScrollableFrame.md
├── ScrollableFrame
│ ├── setDirection.md
│ └── setScrollAmount.md
├── Scrollbar.md
├── Scrollbar
│ ├── getIndex.md
│ ├── setBackgroundSymbol.md
│ ├── setBarType.md
│ ├── setIndex.md
│ ├── setScrollAmount.md
│ └── setSymbol.md
├── Slider.md
├── Slider
│ ├── getIndex.md
│ ├── setBackgroundSymbol.md
│ ├── setBarType.md
│ ├── setIndex.md
│ ├── setMaxValue.md
│ └── setSymbol.md
├── Textfield.md
├── Textfield
│ ├── addKeywords.md
│ ├── addLine.md
│ ├── addRule.md
│ ├── clear.md
│ ├── editLine.md
│ ├── editRule.md
│ ├── getLine.md
│ ├── getLines.md
│ ├── getOffset.md
│ ├── getSelection.md
│ ├── getTextCursor.md
│ ├── removeLine.md
│ ├── removeRule.md
│ ├── setOffset.md
│ └── setSelection.md
├── Thread.md
├── Thread
│ ├── getStatus.md
│ ├── start.md
│ └── stop.md
├── Timer.md
├── Timer
│ ├── cancel.md
│ ├── onCall.md
│ ├── setTime.md
│ └── start.md
├── Treeview.md
├── Treeview
│ ├── addChild.md
│ ├── findChildrenByText.md
│ ├── getChildren.md
│ ├── getOffset.md
│ ├── getParent.md
│ ├── getRoot.md
│ ├── getSelectionColor.md
│ ├── getText.md
│ ├── isExpandable.md
│ ├── isExpanded.md
│ ├── isSelectionColorActive.md
│ ├── onSelect.md
│ ├── onSelectNode.md
│ ├── removeChild.md
│ ├── setExpandable.md
│ ├── setExpanded.md
│ ├── setOffset.md
│ ├── setRoot.md
│ ├── setScrollable.md
│ ├── setSelectionColor.md
│ └── setText.md
├── VisualObject.md
└── VisualObject
│ ├── addBG.md
│ ├── addBackgroundBox.md
│ ├── addBlit.md
│ ├── addDraw.md
│ ├── addFG.md
│ ├── addForegroundBox.md
│ ├── addPostDraw.md
│ ├── addPreDraw.md
│ ├── addText.md
│ ├── addTextBox.md
│ ├── addTexture.md
│ ├── animateOffset.md
│ ├── animatePosition.md
│ ├── animateSize.md
│ ├── getAbsolutePosition.md
│ ├── getBackground.md
│ ├── getDrawId.md
│ ├── getForeground.md
│ ├── getHeight.md
│ ├── getPosition.md
│ ├── getShadow.md
│ ├── getSize.md
│ ├── getWidth.md
│ ├── getX.md
│ ├── getY.md
│ ├── hide.md
│ ├── ignoreOffset.md
│ ├── isFocused.md
│ ├── isVisible.md
│ ├── onReposition.md
│ ├── onResize.md
│ ├── setBackground.md
│ ├── setBorder.md
│ ├── setDrawState.md
│ ├── setFocus.md
│ ├── setForeground.md
│ ├── setInfinitePlay.md
│ ├── setPosition.md
│ ├── setShadow.md
│ ├── setSize.md
│ ├── setTextureMode.md
│ ├── setTransparency.md
│ ├── setVisible.md
│ ├── setZIndex.md
│ └── show.md
├── packager.lua
├── ui.lua
└── versions
├── basalt-1.0.0.lua
├── basalt-1.5.0.lua
├── basalt-1.6.0.lua
├── basalt-1.6.2.lua
├── basalt-1.6.3.lua
├── basalt-1.6.4.lua
├── basalt-1.6.5.lua
├── basalt-1.6.6.lua
├── basalt-1.7.0.lua
├── basalt-1.7.1.lua
└── latest.lua
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | contact_links:
2 | - name: Community Support
3 | url: https://discord.gg/yNNnmBVBpE
4 | about: Please ask and answer questions here.
5 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/docs.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Documentation
3 | about: Anything that you think is wrong about the documentation.
4 | title: 'docs: [TITLE]'
5 | labels: documentation
6 | assignees: ''
7 |
8 | ---
9 |
10 | ** Where? **
11 | Please describe what you want changed. Screenshot / Quotes
12 |
13 | ** Possible solution **
14 | Please describe a possible solution.
15 |
16 | ** Others **
17 | Anything else you want to say?
18 |
19 | ** Checklist **
20 | [ ] I am looking at the latest version of the docs.
21 |
--------------------------------------------------------------------------------
/Basalt/init.lua:
--------------------------------------------------------------------------------
1 | local curDir = fs.getDir(table.pack(...)[2]) or ""
2 |
3 | local defaultPath = package.path
4 | if not(packed)then
5 | local format = "path;/path/?.lua;/path/?/init.lua;"
6 |
7 | local main = format:gsub("path", curDir)
8 | local objFolder = format:gsub("path", curDir.."/objects")
9 | local plugFolder = format:gsub("path", curDir.."/plugins")
10 | local libFolder = format:gsub("path", curDir.."/libraries")
11 |
12 |
13 | package.path = main..objFolder..plugFolder..libFolder..defaultPath
14 | end
15 | local Basalt = require("main")
16 | package.path = defaultPath
17 |
18 | return Basalt
--------------------------------------------------------------------------------
/Basalt/libraries/basaltLogs.lua:
--------------------------------------------------------------------------------
1 | local logDir = ""
2 | local logFileName = "basaltLog.txt"
3 |
4 | local defaultLogType = "Debug"
5 |
6 | fs.delete(logDir~="" and logDir.."/"..logFileName or logFileName)
7 |
8 | local mt = {
9 | __call = function(_,text, typ)
10 | if(text==nil)then return end
11 | local dirStr = logDir~="" and logDir.."/"..logFileName or logFileName
12 | local handle = fs.open(dirStr, fs.exists(dirStr) and "a" or "w")
13 | handle.writeLine("[Basalt]["..os.date("%Y-%m-%d %H:%M:%S").."]["..(typ and typ or defaultLogType).."]: "..tostring(text))
14 | handle.close()
15 | end,
16 | }
17 |
18 | return setmetatable({}, mt)
19 |
20 | --Work in progress
--------------------------------------------------------------------------------
/Basalt/libraries/tHex.lua:
--------------------------------------------------------------------------------
1 | local cols = {}
2 |
3 | for i = 0, 15 do
4 | cols[2^i] = ("%x"):format(i)
5 | end
6 | return cols
--------------------------------------------------------------------------------
/Basalt/loadObjects.lua:
--------------------------------------------------------------------------------
1 | local _OBJECTS = {}
2 |
3 | if(packaged)then
4 | for k,v in pairs(getProject("objects"))do
5 | _OBJECTS[k] = v()
6 | end
7 | return _OBJECTS
8 | end
9 |
10 | local args = table.pack(...)
11 | local dir = fs.getDir(args[2] or "Basalt")
12 | if(dir==nil)then
13 | error("Unable to find directory "..args[2].." please report this bug to our discord.")
14 | end
15 |
16 | for _,v in pairs(fs.list(fs.combine(dir, "objects")))do
17 | if(v~="example.lua")and not(v:find(".disabled"))then
18 | local name = v:gsub(".lua", "")
19 | _OBJECTS[name] = require(name)
20 | end
21 | end
22 | return _OBJECTS
--------------------------------------------------------------------------------
/Basalt/objects/Pane.lua:
--------------------------------------------------------------------------------
1 | return function(name, basalt)
2 | -- Pane
3 | local base = basalt.getObject("VisualObject")(name, basalt)
4 | local objectType = "Pane"
5 |
6 | base:setSize(25, 10)
7 |
8 | local object = {
9 | getType = function(self)
10 | return objectType
11 | end,
12 | }
13 |
14 | object.__index = object
15 | return setmetatable(object, base)
16 | end
--------------------------------------------------------------------------------
/Basalt/plugins/basaltAdditions.lua:
--------------------------------------------------------------------------------
1 | return {
2 | basalt = function()
3 | return {
4 | cool = function()
5 | print("ello")
6 | sleep(2)
7 | end
8 | }
9 | end
10 | }
--------------------------------------------------------------------------------
/docs/.nojekyll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/.nojekyll
--------------------------------------------------------------------------------
/docs/_footer.md:
--------------------------------------------------------------------------------
1 | ---
2 |
3 | Thanks for checking out our wiki, join our discord for more help: [https://discord.gg/yM7kndJdJJ](discord.gg/yNNnmBVBpE)
4 |
--------------------------------------------------------------------------------
/docs/_media/basaltPreview2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/_media/basaltPreview2.gif
--------------------------------------------------------------------------------
/docs/_media/dynamic-frames.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/_media/dynamic-frames.mp4
--------------------------------------------------------------------------------
/docs/_media/flexbox-example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/_media/flexbox-example.png
--------------------------------------------------------------------------------
/docs/_media/flexgrow-property.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/_media/flexgrow-property.mp4
--------------------------------------------------------------------------------
/docs/_media/frame-flexgrow-property.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/_media/frame-flexgrow-property.mp4
--------------------------------------------------------------------------------
/docs/_media/frames-with-menubars.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/_media/frames-with-menubars.mp4
--------------------------------------------------------------------------------
/docs/_media/frames-with-sidebar.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/_media/frames-with-sidebar.mp4
--------------------------------------------------------------------------------
/docs/_media/installer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/_media/installer.png
--------------------------------------------------------------------------------
/docs/_media/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/_media/logo.png
--------------------------------------------------------------------------------
/docs/_media/pane-example-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/_media/pane-example-1.png
--------------------------------------------------------------------------------
/docs/_media/pane-example-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/_media/pane-example-2.png
--------------------------------------------------------------------------------
/docs/_media/resizable-frames.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/_media/resizable-frames.mp4
--------------------------------------------------------------------------------
/docs/_media/scrollable-frames.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/_media/scrollable-frames.mp4
--------------------------------------------------------------------------------
/docs/_navbar.md:
--------------------------------------------------------------------------------
1 | - Getting Started
2 | - [Home](Home)
3 | - [How To](home/How-To)
4 | - [Download](home/download)
5 |
--------------------------------------------------------------------------------
/docs/docs1_6/.nojekyll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/docs1_6/.nojekyll
--------------------------------------------------------------------------------
/docs/docs1_6/CNAME:
--------------------------------------------------------------------------------
1 | basalt.madefor.cc
--------------------------------------------------------------------------------
/docs/docs1_6/_footer.md:
--------------------------------------------------------------------------------
1 | ---
2 |
3 | Thanks for checking out our wiki, join our discord for more help: [discord.gg/yM7kndJdJJ](discord.gg/yNNnmBVBpE)
4 |
--------------------------------------------------------------------------------
/docs/docs1_6/_media/basaltPreview2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/docs1_6/_media/basaltPreview2.gif
--------------------------------------------------------------------------------
/docs/docs1_6/_media/dynamic-frames.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/docs1_6/_media/dynamic-frames.mp4
--------------------------------------------------------------------------------
/docs/docs1_6/_media/frames-with-menubars.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/docs1_6/_media/frames-with-menubars.mp4
--------------------------------------------------------------------------------
/docs/docs1_6/_media/frames-with-sidebar.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/docs1_6/_media/frames-with-sidebar.mp4
--------------------------------------------------------------------------------
/docs/docs1_6/_media/installer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/docs1_6/_media/installer.png
--------------------------------------------------------------------------------
/docs/docs1_6/_media/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/docs1_6/_media/logo.png
--------------------------------------------------------------------------------
/docs/docs1_6/_media/pane-example-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/docs1_6/_media/pane-example-1.png
--------------------------------------------------------------------------------
/docs/docs1_6/_media/pane-example-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/docs1_6/_media/pane-example-2.png
--------------------------------------------------------------------------------
/docs/docs1_6/_media/resizable-frames.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/docs1_6/_media/resizable-frames.mp4
--------------------------------------------------------------------------------
/docs/docs1_6/_media/scrollable-frames.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/docs1_6/_media/scrollable-frames.mp4
--------------------------------------------------------------------------------
/docs/docs1_6/_navbar.md:
--------------------------------------------------------------------------------
1 | - Getting Started
2 | - [Home](Home)
3 | - [How To](home/How-To)
4 | - [Download](home/download)
5 |
--------------------------------------------------------------------------------
/docs/docs1_6/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/docs1_6/favicon-16x16.png
--------------------------------------------------------------------------------
/docs/docs1_6/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/docs1_6/favicon-32x32.png
--------------------------------------------------------------------------------
/docs/docs1_6/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/docs1_6/favicon.ico
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Animation/cancel.md:
--------------------------------------------------------------------------------
1 | ## cancel
2 | Cancels the animation
3 |
4 | #### Returns:
5 | 1. `animation` Animation in use
6 |
7 | #### Usage:
8 |
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local testButton = mainFrame:addButton()
12 | local aAnimation = mainFrame:addAnimation():add(function() testButton:setBackground(colors.black) end):wait(1):add(function() aAnimation:cancel() end):wait(1):add(function() testButton:setBackground(colors.lightGray) end)
13 |
14 | aAnimation:play()
15 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Animation/onStart.md:
--------------------------------------------------------------------------------
1 | ## onStart
2 | `onStart(self)`
3 | This is a event which gets fired as soon as the animation is started.
4 |
5 | ```lua
6 | local basalt = require("Basalt")
7 |
8 | local mainFrame = basalt.createFrame()
9 | local testButton = mainFrame:addButton("buttonToAnimate")
10 | local aAnimation = mainFrame:addAnimation():setObject(testButton):changeTextColor({colors.red, colors.yellow, colors.green}, 2)
11 | aAnimation:onStart(function()
12 | basalt.debug("The animation is started")
13 | end)
14 |
15 | aAnimation:play()
16 | ```
17 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Animation/setObject.md:
--------------------------------------------------------------------------------
1 | ## setObject
2 | Sets the object which the animation should reposition/resize
3 |
4 | #### Parameters:
5 | 1. `table` object
6 |
7 | #### Returns:
8 | 1. `animation` Animation in use
9 |
10 | #### Usage:
11 |
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local testButton = mainFrame:addButton()
15 | local aAnimation = mainFrame:addAnimation():setObject(testButton)
16 | ```
17 |
18 | ```lua
19 | local mainFrame = basalt.createFrame()
20 | local testButton = mainFrame:addButton("buttonToAnimate")
21 | ```
22 | ```xml
23 |
24 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Animation/wait.md:
--------------------------------------------------------------------------------
1 | ## wait
2 | Sets a wait timer for the next function after the previous function got executed, no wait timer calls the next function immediately
3 | #### Parameters:
4 | 1. `number` The length of delay between the functions _(in seconds)_
5 |
6 | #### Returns:
7 | 1. `animation` Animation in use
8 |
9 | #### Usage:
10 | ```lua
11 | local mainFrame = basalt.createFrame()
12 | local testButton = mainFrame:addButton()
13 | local aAnimation = mainFrame:addAnimation():add(function() testButton:setPosition(3,3) end):wait(1):add(function() testButton:setPosition(1,1,"r") end):wait(2):add(function() testButton:setPosition(1,1,"r") end)
14 |
15 | aAnimation:play()
16 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Basalt/autoUpdate.md:
--------------------------------------------------------------------------------
1 | # Basalt
2 |
3 | ## autoUpdate
4 |
5 | This starts the event and draw handler for you. The listeners will run until you stop them.
6 |
7 | ### Parameters
8 |
9 | 1. `boolean` optional - if you use false as the first parameter it would stop the listeners. Using false is a synonym for [`basalt.stopUpdate()`](objects/Basalt/stopUpdate.md).
10 |
11 | ### Usage
12 |
13 | * Enables the basalt listeners, otherwise the screen will not continue to update
14 |
15 | ```lua
16 | local main = basalt.createFrame()
17 | basalt.autoUpdate()
18 | ```
19 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Basalt/getActiveFrame.md:
--------------------------------------------------------------------------------
1 | # Basalt
2 |
3 | ## getActiveFrame
4 |
5 | Returns the currently active/visible base frame.
6 |
7 | ### Returns
8 |
9 | 1. `frame` The current frame
10 |
11 | ### Usage
12 |
13 | * Displays the active frame name in the debug console
14 |
15 | ```lua
16 | local main = basalt.createFrame()
17 | basalt.debug(basalt.getActiveFrame():getName()) -- returns the id
18 | ```
19 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Basalt/getFrame.md:
--------------------------------------------------------------------------------
1 | # Basalt
2 |
3 | ## getFrame
4 |
5 | Returns a base frame by the given id.
6 |
7 | ### Parameters
8 |
9 | 1. `string` id
10 |
11 | ### Returns
12 |
13 | 1. `frame` The frame with the supplied id.
14 |
15 | ### Usage
16 |
17 | * Creates, fetches and shows the "myFirstFrame" object
18 |
19 | ```lua
20 | local main = basalt.createFrame("firstBaseFrame")
21 | local main2 = basalt.createFrame("secondBaseFrame")
22 | main:addButton()
23 | :setText("Show")
24 | :onClick(function()
25 | local frame2 = basalt.getFrame("secondBaseFrame")
26 | if(frame2 ~= nil)then
27 | frame2:show()
28 | end
29 | end)
30 | basalt.autoUpdate()
31 | ```
32 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Basalt/getTheme.md:
--------------------------------------------------------------------------------
1 | # Basalt
2 |
3 | ## basalt.getTheme
4 |
5 | Returns the current base-theme. This base-theme can be set using setTheme.md.
6 | A list of base-theme keys can be found [here](https://github.com/Pyroxenium/Basalt/blob/master/Basalt/theme.lua).
7 |
8 | ### Returns
9 |
10 | 1. `number` The color of the requested base-theme key.
11 |
12 | ### Usage
13 |
14 | * Displays the color of the main background in the debug console
15 |
16 | ```lua
17 | basalt.debug(basalt.getTheme("BasaltBG"))
18 | ```
19 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Basalt/getVariable.md:
--------------------------------------------------------------------------------
1 | # Basalt
2 |
3 | ## getVariable
4 |
5 | Returns a variable defined with [setVariable](objects/Basalt/setVariable)
6 |
7 | ### Returns
8 |
9 | 1. `variable` The variable stored
10 |
11 | ### Usage
12 |
13 | * Displays the stored variable in the debug console
14 |
15 | ```lua
16 | basalt.setVariable("abc", function()
17 | basalt.debug("I got clicked")
18 | return 1
19 | end)
20 |
21 | basalt.debug(basalt.getVariable("abc")()) -- Should debug log "I got clicked" and debug log 1 (which was returned from the function)
22 | ```
23 |
24 | ```xml
25 |
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Basalt/getVersion.md:
--------------------------------------------------------------------------------
1 | # Basalt
2 |
3 | ## getVersion
4 |
5 | Returns the currently active/visible base frame.
6 |
7 | ### Returns
8 |
9 | 1. `string` The current version of Basalt
10 |
11 | ### Usage
12 |
13 | * Displays the version of Basalt in the debug console
14 |
15 | ```lua
16 | basalt.debug(basalt.getVersion()) -- Example: 1.6.2
17 | ```
18 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Basalt/onEvent.md:
--------------------------------------------------------------------------------
1 | # Basalt
2 |
3 | ## onEvent
4 |
5 | This is the top-level method to intercept an event before sending it to the object event handlers. If you use return false, the event is not passed to the event handlers.
6 |
7 | ### Parameters
8 |
9 | 1. `function` The function which should be called
10 |
11 | ### Usage
12 |
13 | ```lua
14 | local basalt = require("basalt")
15 |
16 | basalt.onEvent(function(event)
17 | if(event=="terminate")then
18 | return false
19 | end
20 | end)
21 | ```
22 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Basalt/setActiveFrame.md:
--------------------------------------------------------------------------------
1 | # Basalt
2 |
3 | ## setActiveFrame
4 |
5 | Sets what should be the active baseframe.
6 |
7 | ### Parameters
8 |
9 | 1. `frame` frame - The frame that should be the active base-frame.
10 |
11 | ### Usage
12 |
13 | TODO
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Basalt/setMouseDragThrottle.md:
--------------------------------------------------------------------------------
1 | # Basalt
2 |
3 | ## setMouseDragThrottle
4 |
5 | Changes the drag throttle of all drag events. Default value is 50ms - which is 0.05s.
6 | Instead of sending all mouse_drag events to the :onDrag handlers basalt sends every 0.05s (while dragging) the most recent drag event to all
7 | drag handlers. If you need all drag events - just change the value to 0.
8 |
9 | ### Parameters
10 |
11 | 1. `number` A number in miliseconds.
12 |
13 | ### Usage
14 |
15 | ```lua
16 | local basalt = require("basalt")
17 | basalt.setMouseDragThrottle(0)
18 | ```
19 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Basalt/setVariable.md:
--------------------------------------------------------------------------------
1 | # Basalt
2 |
3 | ## setVariable
4 |
5 | This stores a variable which you're able to access via xml. You are also able to add a function, which then gets called by object events created in XML.
6 |
7 | ### Parameters
8 |
9 | 1. `string` a key name
10 | 2. `any` any variable
11 |
12 | ### Usage
13 |
14 | * Adds a function to basalt.
15 |
16 | ```lua
17 | basalt.setVariable("clickMe", function()
18 | basalt.debug("I got clicked")
19 | end)
20 |
21 | ```
22 |
23 | ```xml
24 |
25 | ```
26 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Basalt/stopUpdate.md:
--------------------------------------------------------------------------------
1 | # Basalt
2 |
3 | ## stopUpdate / stop
4 |
5 | Stops the automatic draw and event handler which got started by `basalt.autoUpdate()`.
6 | `basalt.autoUpdate(false)` also does the same.
7 |
8 | ### Usage
9 |
10 | * When the quit button is clicked, the button stops basalt's event listeners and draw handlers
11 |
12 | ```lua
13 | local main = basalt.createFrame()
14 | main:addButton()
15 | :setPosition(2,2)
16 | :setText("Stop Basalt!")
17 | :onClick(function()
18 | basalt.stopUpdate()
19 | end)
20 | basalt.autoUpdate()
21 | ```
22 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Button/setHorizontalAlign.md:
--------------------------------------------------------------------------------
1 | ## setHorizontalAlign
2 | Sets the horizontal align of the button text
3 |
4 | #### Parameters:
5 | 1. `string` the position as string ("left", "center", "right") - default is center.
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Sets the button's horizontal text align to right.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local button = mainFrame:addButton()
15 | :setText("Click me!")
16 | :setHorizontalAlign("right")
17 | ```
18 | ```xml
19 |
20 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Button/setText.md:
--------------------------------------------------------------------------------
1 | ## setText
2 | Sets the displayed button text
3 | #### Parameters:
4 | 1. `string` the text the button should show
5 |
6 | #### Returns:
7 | 1. `object` The object in use
8 |
9 | #### Usage:
10 | * Creates a button with "Click me!" as text.
11 | ```lua
12 | local mainFrame = basalt.createFrame()
13 | local button = mainFrame:addButton():setText("Click me!")
14 | ```
15 | ```xml
16 |
17 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Button/setVerticalAlign.md:
--------------------------------------------------------------------------------
1 | ## setVerticalAlign
2 | Sets the vertical align of the button text
3 |
4 | #### Parameters:
5 | 1. `string` the position as string ("top", "center", "bottom") - default is center.
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Sets the button's horizontal text align to right and the vertical text align to bottom.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local button = mainFrame:addButton()
15 | :setText("Click me!")
16 | :setHorizontalAlign("right")
17 | :setVerticalAlign("bottom")
18 | ```
19 | ```xml
20 |
21 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Checkbox/setSymbol.md:
--------------------------------------------------------------------------------
1 | ## setSymbol
2 | Changes the checkbox symbol, default is "\42"
3 |
4 | #### Parameters:
5 | 1. `string` symbol
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a new checkbox and changes the symbol to o
12 | ```lua
13 | local main = basalt.createFrame()
14 | local checkbox = main:addCheckbox():setSymbol("o")
15 | ```
16 | ```xml
17 |
18 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Dropdown/clear.md:
--------------------------------------------------------------------------------
1 | ## clear
2 | Removes all items.
3 |
4 | #### Returns:
5 | 1. `object` The object in use
6 |
7 | #### Usage:
8 | * Creates a default dropdown with 3 entries and removes them immediatley. Which makes no sense.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aDropdown = mainFrame:addDropdown()
12 | aDropdown:addItem("1. Entry")
13 | aDropdown:addItem("2. Entry",colors.yellow)
14 | aDropdown:addItem("3. Entry",colors.yellow,colors.green)
15 | aDropdown:clear()
16 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Dropdown/getAll.md:
--------------------------------------------------------------------------------
1 | ## getAll
2 | Returns all items as table
3 |
4 | #### Returns:
5 | 1. `table` All items
6 |
7 | #### Usage:
8 | * Creates a default menubar with 3 entries and prints a table.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aDropdown = mainFrame:addDropdown()
12 | aDropdown:addItem("1. Entry")
13 | aDropdown:addItem("2. Entry",colors.yellow)
14 | aDropdown:addItem("3. Entry",colors.yellow,colors.green)
15 | basalt.debug(aDropdown:getAll())
16 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Dropdown/getItem.md:
--------------------------------------------------------------------------------
1 | ## getItem
2 | Returns a item by index
3 |
4 | #### Parameters:
5 | 1. `number` The index which should be returned
6 |
7 | #### Returns:
8 | 1. `table` The item table example: {text="1. Entry", bgCol=colors.black, fgCol=colors.white}
9 |
10 | #### Usage:
11 | * Creates a default dropdown with 3 entries and edits the second one.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aDropdown = mainFrame:addDropdown()
15 | aDropdown:addItem("1. Entry")
16 | aDropdown:addItem("2. Entry",colors.yellow)
17 | aDropdown:addItem("3. Entry",colors.yellow,colors.green)
18 | basalt.debug(aDropdown:getItem(2).text)
19 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Dropdown/getItemCount.md:
--------------------------------------------------------------------------------
1 | ## getItemCount
2 | Returns the current item count
3 |
4 | #### Returns:
5 | 1. `number` The item list count
6 |
7 | #### Usage:
8 | * Creates a default dropdown with 3 entries and prints the current item count.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aDropdown = mainFrame:addDropdown()
12 | aDropdown:addItem("1. Entry")
13 | aDropdown:addItem("2. Entry",colors.yellow)
14 | aDropdown:addItem("3. Entry",colors.yellow,colors.green)
15 | basalt.debug(aDropdown:getItemCount())
16 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Dropdown/getItemIndex.md:
--------------------------------------------------------------------------------
1 | ## getItemIndex
2 | returns the item index of the currently selected item
3 |
4 | #### Returns:
5 | 1. `number` The current index
6 |
7 | #### Usage:
8 | * Creates a default dropdown with 3 entries selects the second entry and prints the currently selected index.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aDropdown = mainFrame:addDropdown()
12 | aDropdown:addItem("1. Entry")
13 | aDropdown:addItem("2. Entry",colors.yellow)
14 | aDropdown:addItem("3. Entry",colors.yellow,colors.green)
15 | aDropdown:selectItem(2)
16 | basalt.debug(aDropdown:getItemIndex())
17 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Dropdown/getOffset.md:
--------------------------------------------------------------------------------
1 | ## getOffset
2 | Returns the current index offset
3 |
4 | #### Returns:
5 | 1. `number` offset value
6 |
7 | #### Usage:
8 | * Creates a default dropdown with 6 entries and sets the offset to 3, also prints the current offset.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aDropdown = mainFrame:addDropdown()
12 | :addItem("1. Entry")
13 | :addItem("2. Entry")
14 | :addItem("3. Entry")
15 | :addItem("4. Entry")
16 | :addItem("5. Entry")
17 | :addItem("6. Entry")
18 | :setOffset(3)
19 | basalt.debug(aDropdown:getOffset())
20 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Dropdown/removeItem.md:
--------------------------------------------------------------------------------
1 | ## removeItem
2 | Removes a item from the dropdown
3 |
4 | #### Parameters:
5 | 1. `number` The index which should get removed
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default dropdown with 3 entries and removes the second one.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aDropdown = mainFrame:addDropdown()
15 | aDropdown:addItem("1. Entry")
16 | aDropdown:addItem("2. Entry",colors.yellow)
17 | aDropdown:addItem("3. Entry",colors.yellow,colors.green)
18 | aDropdown:removeItem(2)
19 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Dropdown/selectItem.md:
--------------------------------------------------------------------------------
1 | ## selectItem
2 | selects a item in the dropdown (same as a player would click on a item)
3 |
4 | #### Parameters:
5 | 1. `number` The index which should get selected
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default dropdown with 3 entries and selects the second entry.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aDropdown = mainFrame:addDropdown()
15 | aDropdown:addItem("1. Entry")
16 | aDropdown:addItem("2. Entry",colors.yellow)
17 | aDropdown:addItem("3. Entry",colors.yellow,colors.green)
18 | aDropdown:selectItem(2)
19 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/addLayout.md:
--------------------------------------------------------------------------------
1 | ## addLayout
2 | Adds a new XML Layout into your frame.
3 |
4 | #### Parameters:
5 | 1. `string` Path to your layout
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Creates a new base frame and adds the mainframe.xml layout
12 | ```lua
13 | local myFrame = basalt.createFrame():addLayout("mainframe.xml")
14 | ```
15 | ```xml
16 |
17 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/addLayoutFromString.md:
--------------------------------------------------------------------------------
1 | ## addLayoutFromString
2 | Adds a new XML Layout as string into your frame.
3 |
4 | #### Parameters:
5 | 1. `string` xml
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Creates a new base frame and adds the mainframe.xml layout
12 | ```lua
13 | local myFrame = basalt.createFrame():addLayoutFromString("")
14 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/addObject.md:
--------------------------------------------------------------------------------
1 | ## add<Object>
2 | Adds a new object. Don't use add<Object> please use addTheObjectYouNeed For example if you want a new Frame, use
3 | addFrame, if you want to add a button, use addButton
4 |
5 | #### Parameters:
6 | 1. `string` optional - the id if you don't add a id it will autimatically generate one for you
7 |
8 | #### Returns:
9 | 1. `object` The new object you've created
10 |
11 | #### Usage:
12 | * Creates some example objects
13 | ```lua
14 | local main = basalt.createFrame()
15 | local button = main:addButton()
16 | local label = main:addLabel()
17 | local frame = main:addFrame()
18 | ```
19 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/getFocusedObject.md:
--------------------------------------------------------------------------------
1 | ## getFocusedObject
2 | Gets the currently focused object
3 |
4 | #### Returns:
5 | 1. `object` The currently focused object
6 |
7 | #### Usage:
8 | * Gets the currently focused object from the frame, storing it in a variable
9 | ```lua
10 | local focusedObject = myFrame:getFocusedObject()
11 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/getLastLayout.md:
--------------------------------------------------------------------------------
1 | ## getLastLayout
2 | returns a table of all objects this frame has created via xml (useful if you'd like to access all of them for some reason)
3 |
4 | #### Returns:
5 | 1. `table` table with objects
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/getObject.md:
--------------------------------------------------------------------------------
1 | ## getObject
2 | Returns a child object of the frame
3 |
4 | #### Parameters:
5 | 1. `string` The name of the child object
6 |
7 | #### Returns:
8 | 1. `object | nil` The object with the supplied name, or `nil` if there is no object present with the given name
9 |
10 | #### Usage:
11 | * Adds a button with id "myFirstButton", then retrieves it again through the frame object
12 | ```lua
13 | myFrame:addButton("myFirstButton")
14 | local aButton = myFrame:getObject("myFirstButton")
15 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/getOffset.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/docs1_6/objects/Frame/getOffset.md
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/removeFocusedObject.md:
--------------------------------------------------------------------------------
1 | ## removeFocusedObject
2 | Removes the currently focused object of that frame
3 |
4 | #### Returns:
5 | 1. `frame` The frame being used
6 |
7 | #### Usage:
8 | * Creates a new button then removes the focus from that button when clicking on it
9 | ```lua
10 | local main = basalt.createFrame()
11 | local input = main:addInput():setFocus()
12 | local aButton = main:addButton():onClick(function()
13 | main:removeFocusedObject()
14 | end)
15 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/removeObject.md:
--------------------------------------------------------------------------------
1 | ## removeObject
2 | Removes a child object from the frame
3 |
4 | #### Parameters:
5 | 1. `string|object` The name of the child object or the object itself
6 |
7 | #### Returns:
8 | 1. `boolean` Whether the object with the given name was properly removed
9 |
10 | #### Usage:
11 | * Adds a button with the id "myFirstButton", then removes it with the aforementioned id
12 | ```lua
13 | local main = basalt.createFrame()
14 | main:addButton("myFirstButton"):setText("Close")
15 | :onClick(function(self)
16 | main:removeObject("myFirstButton") -- or main:removeObject(self)
17 | end)
18 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/setBarTextAlign.md:
--------------------------------------------------------------------------------
1 | ## setBarTextAlign
2 | Sets the frame's bar-text alignment
3 |
4 | #### Parameters:
5 | 1. `string` Can be supplied with "left", "center", or "right"
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Set the title of myFrame to "My first frame!", and align it to the right.
12 | ```lua
13 | myFrame:setBar("My first Frame!"):setBarTextAlign("right")
14 | ```
15 | ```xml
16 |
17 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/setFocusedObject.md:
--------------------------------------------------------------------------------
1 | ## setFocusedObject
2 | Sets the currently focused object
3 |
4 | #### Parameters:
5 | 1. `object` The child object to focus on
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Creates a new button, sets the focused object to the previously mentioned button
12 | ```lua
13 | local aButton = myFrame:addButton()
14 | myFrame:setFocusedObject(aButton)
15 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/setMirror.md:
--------------------------------------------------------------------------------
1 | ## setMirror
2 | mirrors this frame to another peripheral monitor object.
3 |
4 | #### Parameters:
5 | 1. `string` The monitor name ("right", "left",... "monitor_1", "monitor_2",...)
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Creates mirror of your main frame to a monitor on the left side.
12 | ```lua
13 | local mainFrame = basalt.createFrame():setMirror("left")
14 | ```
15 | ```xml
16 |
17 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/setMonitorScale.md:
--------------------------------------------------------------------------------
1 | ## setMonitorScale
2 | Changes the scale on the the monitor which the frame is attached to
3 |
4 | #### Parameters:
5 | 1. `number` A number from 0.5 to 5
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Creates a new base frame, sets the frame as a monitor frame and changes the monitor scale
12 | ```lua
13 | local myFrame = basalt.createFrame()setMonitor("left"):setMonitorScale(2)
14 | myFrame:addLabel("Monitor scale is bigger")
15 | ```
16 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/setMovable.md:
--------------------------------------------------------------------------------
1 | ## setMovable
2 | Sets whether the frame can be moved. _In order to move the frame click and drag the upper bar of the frame_
3 |
4 | #### Parameters:
5 | 1. `boolean` Whether the object is movable
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Creates a frame with id "myFirstFrame" and makes it movable
12 | ```lua
13 | local myFrame = basalt.createFrame():setMovable(true)
14 | ```
15 | ```xml
16 |
17 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/setScrollAmount.md:
--------------------------------------------------------------------------------
1 | ## setScrollAmount
2 | Sets the maximum offset it is allowed to scroll
3 |
4 | #### Parameters:
5 | 1. `number` maximum y offset
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Creates a new base frame and makes it scrollable and sets the maximum amount to 25
12 | ```lua
13 | local myFrame = basalt.createFrame():setScrollable():setScrollAmount(25)
14 | ```
15 | ```xml
16 |
17 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/setScrollable.md:
--------------------------------------------------------------------------------
1 | ## setScrollable
2 | Makes the frame scrollable with mousewheel.
3 |
4 | #### Parameters:
5 | 1. `bool` scrollable or not
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Creates a new base frame and makes it scrollable
12 | ```lua
13 | local myFrame = basalt.createFrame():setScrollable()
14 | ```
15 | ```xml
16 |
17 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Frame/showBar.md:
--------------------------------------------------------------------------------
1 | ## showBar
2 | Toggles the frame's upper bar
3 |
4 | #### Parameters:
5 | 1. `boolean | nil` Whether the frame's bar is visible or if supplied `nil`, is automatically visible
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Sets myFrame to have a bar titled "Hello World!" and subsequently displays it.
12 | ```lua
13 | myFrame:setBar("Hello World!"):showBar()
14 | ```
15 | ```xml
16 |
17 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Image/getImageSize.md:
--------------------------------------------------------------------------------
1 | ## getImageSize
2 | Returns the current image size
3 |
4 | #### Returns:
5 | 1. `number` width
6 | 2. `number` height
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Image/getMetadata.md:
--------------------------------------------------------------------------------
1 | ## getMetadata
2 | Returns the metadata set in the image
3 |
4 | #### Parameter:
5 |
6 | 1. `string` the metadata key (for example: title, description, author, creator, data, width, height,...)
7 |
8 | #### Returns:
9 | 1. `any` metadata value
10 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Image/loadImage.md:
--------------------------------------------------------------------------------
1 | ## loadImage
2 | This method is used to load an image file into the image object.
3 |
4 | #### Parameters:
5 |
6 | 1. `path` the absolute file path
7 |
8 | #### Returns:
9 |
10 | 1. `object` The object in use
11 |
12 | #### Usage:
13 |
14 | * Creates a default image and loads a test.nfp file
15 |
16 | ```lua
17 | local mainFrame = basalt.createFrame()
18 | local aImage = mainFrame:addImage():loadImage("test.nfp")
19 | ```
20 |
21 | ```xml
22 |
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Image/play.md:
--------------------------------------------------------------------------------
1 | ## play
2 | Plays a bimg animation. This can only work if the bimg has more than 1 frame.
3 |
4 | #### Parameters:
5 |
6 | 1. `boolean` If the image animation should play
7 |
8 | #### Returns:
9 |
10 | 1. `object` The object in use
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Image/selectFrame.md:
--------------------------------------------------------------------------------
1 | ## selectFrame
2 | The selectFrame method allows you to change the current frame of an image object. It takes a single parameter, the index of the frame you want to display.
3 |
4 | #### Parameters:
5 |
6 | 1. `number` the frame index
7 |
8 | #### Returns:
9 |
10 | 1. `object` The object in use
11 |
12 | #### Usage:
13 |
14 | * Creates a default image and loads a test.nfp file
15 |
16 | ```lua
17 | local mainFrame = basalt.createFrame()
18 | local aImage = mainFrame:addImage():loadImage("test.bimg"):selectFrame(2)
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Image/setImage.md:
--------------------------------------------------------------------------------
1 | ## setImage
2 | Sets a new image
3 |
4 | #### Parameter:
5 |
6 | 1. `table` A table in bimg or nfp format.
7 | 1. `string` The format in which the image should be loaded (nfp or bimg)
8 |
9 | #### Usage:
10 |
11 | * Creates a default image and loads a test.nfp file
12 |
13 | ```lua
14 | local mainFrame = basalt.createFrame()
15 |
16 | local bimg = {
17 | [1] = {
18 | {"Hello", "fffff", "33333"}
19 | }
20 | }
21 |
22 | local aImage = mainFrame:addImage():setImage(bimg)
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Image/shrink.md:
--------------------------------------------------------------------------------
1 | ## shrink
2 | Shrinks the current image into a blittle image.
3 |
4 | #### Returns:
5 | 1. `object` The object in use
6 |
7 | #### Usage:
8 | * Creates a default image and loads a test.nfp file
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aImage = mainFrame:addImage():loadImage("test.nfp"):shrink()
12 | ```
13 | ```xml
14 |
15 | ```
16 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Image/usePalette.md:
--------------------------------------------------------------------------------
1 | ## usePalette
2 |
3 | Changes the palette colors of the image, if the bimg image has palette metadata.
4 |
5 | #### Parameter:
6 |
7 | 1. `boolean` if the image should change the palette
8 |
9 | #### Returns:
10 |
11 | 1. `object` The object in use
12 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Input.md:
--------------------------------------------------------------------------------
1 | With input's you are able to create a object where the user can type something in.
2 |
3 | [Object](objects/Object.md) methods also apply for input objects.
4 |
5 | | | |
6 | |---|---|
7 | |[setInputType](objects/Input/setInputType.md)|Sets the input type
8 | |[getInputType](objects/Input/getInputType.md)|Returns the input type
9 | |[setDefaultText](objects/Input/setDefaultText.md)|Sets the default text
10 | |[setInputLimit](objects/Input/setInputLimit.md)|Sets a limit to be able to write
11 | |[getInputLimit](objects/Input/getInputLimit.md)|Returns the limit
12 |
13 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Input/getInputLimit.md:
--------------------------------------------------------------------------------
1 | ## getInputLimit
2 | Returns the input limit.
3 |
4 | #### Returns:
5 | 1. `number` character limit
6 |
7 | #### Usage:
8 | * Creates a default input and sets the character limit to 8. Prints the current limit.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aInput = mainFrame:addInput():setInputLimit(8)
12 | basalt.debug(aInput:getInputLimit())
13 | ```
14 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Input/getInputType.md:
--------------------------------------------------------------------------------
1 | ## getInputType
2 | Gets the current input type
3 |
4 | #### Returns:
5 | 1. `string` input type
6 |
7 | #### Usage:
8 | * Creates a default input and sets it to numbers only. Also prints the current input type to log.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aInput = mainFrame:addInput():setInputType("number")
12 | basalt.debug(aInput:getInputType())
13 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Input/setDefaultText.md:
--------------------------------------------------------------------------------
1 | ## setDefaultText
2 | Sets the default text. This will only be displayed if there is no input set by the user.
3 |
4 | #### Parameters:
5 | 1. `string` input type ("text", "password", "number")
6 | 2. `number|color` default background color - optional
7 | 3. `number|color` default text color - optional
8 |
9 | #### Returns:
10 | 1. `object` The object in use
11 |
12 | #### Usage:
13 | * Creates a default input and sets the default text to "...".
14 | ```lua
15 | local mainFrame = basalt.createFrame()
16 | local aInput = mainFrame:addInput():setDefaultText("...")
17 | ```
18 | ```xml
19 |
20 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Input/setInputLimit.md:
--------------------------------------------------------------------------------
1 | ## setInputLimit
2 | Sets a character limit to the input.
3 |
4 | #### Parameters:
5 | 1. `number` character limit
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default input and sets the character limit to 8.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aInput = mainFrame:addInput():setInputLimit(8)
15 | ```
16 | ```xml
17 |
18 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Input/setInputType.md:
--------------------------------------------------------------------------------
1 | ## setInputType
2 | Changes the input type. default: text
3 |
4 | #### Parameters:
5 | 1. `string` input type ("text", "password", "number")
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default input and sets it to numbers only.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aInput = mainFrame:addInput():setInputType("number")
15 | ```
16 | ```xml
17 |
18 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Label.md:
--------------------------------------------------------------------------------
1 | A label is for adding simple text.
2 |
3 | By default label's width is auto sizing based on the length of the text. If you change the size with setSize it will automatically stop autosizing the width.
4 |
5 | The fontsize feature is calculated by bigfonts, a library made by Wojbie (http://www.computercraft.info/forums2/index.php?/topic/25367-bigfont-api-write-bigger-letters-v10/)
6 |
7 | [Object](objects/Object.md) methods also apply for labels.
8 |
9 | | | |
10 | |---|---|
11 | |[setText](objects/Label/setText.md)|Sets the input type
12 | |[setFontSize](objects/Label/setFontSize.md)|Returns the input type
13 | |[getFontSize](objects/Label/getFontSize.md)|Sets the default text
14 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Label/getFontSize.md:
--------------------------------------------------------------------------------
1 | ## getFontSize
2 | Returns the current font size
3 |
4 | #### Returns:
5 | 1. `number` font size
6 |
7 | #### Usage:
8 | * Creates a default label, sets the text to "Basalt!" and its font size to 2. Also prints the current fontsize.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aLabel = mainFrame:addLabel():setText("Basalt!"):setFontSize(2)
12 | basalt.debug(aLabel:getFontSize())
13 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Label/setFontSize.md:
--------------------------------------------------------------------------------
1 | ## setFontSize
2 | Sets the font size, calculated by bigfonts. Default size is 1.
3 |
4 | #### Parameters:
5 | 1. `number` The size (1, 2, 3, 4)
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default label, sets the text to "Basalt!" and its font size to 2.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aLabel = mainFrame:addLabel():setText("Basalt!"):setFontSize(2)
15 | ```
16 | ```xml
17 |
18 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Label/setText.md:
--------------------------------------------------------------------------------
1 | ## setText
2 | Sets the text which gets displayed.
3 |
4 | #### Parameters:
5 | 1. `string` The text which should be displayed
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default label with text "Some random text".
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aLabel = mainFrame:addLabel():setText("Some random text")
15 | ```
16 | ```xml
17 |
18 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/List/clear.md:
--------------------------------------------------------------------------------
1 | ## clear
2 | Removes all items.
3 |
4 | #### Returns:
5 | 1. `object` The object in use
6 |
7 | #### Usage:
8 | * Creates a default list with 3 entries and removes them immediatley. Which makes no sense.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aList = mainFrame:addList()
12 | aList:addItem("1. Entry")
13 | aList:addItem("2. Entry",colors.yellow)
14 | aList:addItem("3. Entry",colors.yellow,colors.green)
15 | aList:clear()
16 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/List/getAll.md:
--------------------------------------------------------------------------------
1 | ## getAll
2 | Returns all items as table
3 |
4 | #### Returns:
5 | 1. `table` All items
6 |
7 | #### Usage:
8 | * Creates a default menubar with 3 entries and prints a table.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aList = mainFrame:addList()
12 | aList:addItem("1. Entry")
13 | aList:addItem("2. Entry",colors.yellow)
14 | aList:addItem("3. Entry",colors.yellow,colors.green)
15 | basalt.debug(aList:getAll())
16 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/List/getItem.md:
--------------------------------------------------------------------------------
1 | ## getItem
2 | Returns a item by index
3 |
4 | #### Parameters:
5 | 1. `number` The index which should be returned
6 |
7 | #### Returns:
8 | 1. `table` The item table example: {text="1. Entry", bgCol=colors.black, fgCol=colors.white}
9 |
10 | #### Usage:
11 | * Creates a default list with 3 entries and edits the second one.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aList = mainFrame:addList()
15 | aList:addItem("1. Entry")
16 | aList:addItem("2. Entry",colors.yellow)
17 | aList:addItem("3. Entry",colors.yellow,colors.green)
18 | basalt.debug(aList:getItem(2).text)
19 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/List/getItemCount.md:
--------------------------------------------------------------------------------
1 | ## getItemCount
2 | Returns the current item count
3 |
4 | #### Returns:
5 | 1. `number` The item list count
6 |
7 | #### Usage:
8 | * Creates a default list with 3 entries and prints the current item count.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aList = mainFrame:addList()
12 | aList:addItem("1. Entry")
13 | aList:addItem("2. Entry",colors.yellow)
14 | aList:addItem("3. Entry",colors.yellow,colors.green)
15 | basalt.debug(aList:getItemCount())
16 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/List/getItemIndex.md:
--------------------------------------------------------------------------------
1 | ## getItemIndex
2 | returns the item index of the currently selected item
3 |
4 | #### Returns:
5 | 1. `number` The current index
6 |
7 | #### Usage:
8 | * Creates a default list with 3 entries selects the second entry and prints the currently selected index.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aList = mainFrame:addList()
12 | aList:addItem("1. Entry")
13 | aList:addItem("2. Entry",colors.yellow)
14 | aList:addItem("3. Entry",colors.yellow,colors.green)
15 | aList:selectItem(2)
16 | basalt.debug(aList:getItemIndex())
17 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/List/getOffset.md:
--------------------------------------------------------------------------------
1 | ## getOffset
2 | Returns the current index offset
3 |
4 | #### Returns:
5 | 1. `number` offset value
6 |
7 | #### Usage:
8 | * Creates a default dropdown with 6 entries and sets the offset to 3, also prints the current offset.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aList = mainFrame:addList()
12 | :addItem("1. Entry")
13 | :addItem("2. Entry")
14 | :addItem("3. Entry")
15 | :addItem("4. Entry")
16 | :addItem("5. Entry")
17 | :addItem("6. Entry")
18 | :addItem("7. Entry")
19 | :addItem("8. Entry")
20 | :setOffset(3)
21 | basalt.debug(aList:getOffset())
22 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/List/removeItem.md:
--------------------------------------------------------------------------------
1 | ## removeItem
2 | Removes a item from the list
3 |
4 | #### Parameters:
5 | 1. `number` The index which should get removed
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default list with 3 entries and removes the second one.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aList = mainFrame:addList()
15 | aList:addItem("1. Entry")
16 | aList:addItem("2. Entry",colors.yellow)
17 | aList:addItem("3. Entry",colors.yellow,colors.green)
18 | aList:removeItem(2)
19 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/List/selectItem.md:
--------------------------------------------------------------------------------
1 | ## selectItem
2 | selects a item in the list (same as a player would click on a item)
3 |
4 | #### Parameters:
5 | 1. `number` The index which should get selected
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default list with 3 entries and selects the second entry.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aList = mainFrame:addList()
15 | aList:addItem("1. Entry")
16 | aList:addItem("2. Entry",colors.yellow)
17 | aList:addItem("3. Entry",colors.yellow,colors.green)
18 | aList:selectItem(2)
19 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Menubar/clear.md:
--------------------------------------------------------------------------------
1 | ## clear
2 | Removes all items.
3 |
4 | #### Returns:
5 | 1. `object` The object in use
6 |
7 | #### Usage:
8 | * Creates a default menubar with 3 entries and removes them immediatley. Which makes no sense.
9 | ```lua
10 | local main = basalt.createFrame()
11 | local aMenubar = main:addMenubar()
12 | :addItem("1. Entry")
13 | :addItem("2. Entry",colors.yellow)
14 | :addItem("3. Entry",colors.yellow,colors.green)
15 | aMenubar:clear()
16 | ```
17 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Menubar/getAll.md:
--------------------------------------------------------------------------------
1 | ## getAll
2 | Returns all items as table
3 |
4 | #### Returns:
5 | 1. `table` All items
6 |
7 | #### Usage:
8 | * Creates a default menubar with 3 entries and prints a table.
9 | ```lua
10 | local main = basalt.createFrame()
11 | local aMenubar = main:addMenubar()
12 | :addItem("1. Entry")
13 | :addItem("2. Entry",colors.yellow)
14 | :addItem("3. Entry",colors.yellow,colors.green)
15 | basalt.debug(aMenubar:getAll())
16 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Menubar/getItem.md:
--------------------------------------------------------------------------------
1 | ## getItem
2 | Returns a item by index
3 |
4 | #### Parameters:
5 | 1. `number` The index which should be returned
6 |
7 | #### Returns:
8 | 1. `table` The item table example: {text="1. Entry", bgCol=colors.black, fgCol=colors.white}
9 |
10 | #### Usage:
11 | * Creates a default menubar with 3 entries and edits the second one.
12 | ```lua
13 | local main = basalt.createFrame()
14 | local aMenubar = main:addMeubar()
15 | :addItem("1. Entry")
16 | :addItem("2. Entry",colors.yellow)
17 | :addItem("3. Entry",colors.yellow,colors.green)
18 | basalt.debug(aMenubar:getItem(2).text)
19 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Menubar/getItemCount.md:
--------------------------------------------------------------------------------
1 | ## getItemCount
2 | Returns the current item count
3 |
4 | #### Returns:
5 | 1. `number` The item list count
6 |
7 | #### Usage:
8 | * Creates a default menubar with 3 entries and prints the current item count.
9 | ```lua
10 | local main = basalt.createFrame()
11 | local aMenubar = main:addMenubar()
12 | :addItem("1. Entry")
13 | :addItem("2. Entry",colors.yellow)
14 | :addItem("3. Entry",colors.yellow,colors.green)
15 | basalt.debug(aMenubar:getItemCount())
16 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Menubar/getItemIndex.md:
--------------------------------------------------------------------------------
1 | ## getItemIndex
2 | returns the item index of the currently selected item
3 |
4 | #### Returns:
5 | 1. `number` The current index
6 |
7 | #### Usage:
8 | * Creates a default menubar with 3 entries selects the second entry and prints the currently selected index.
9 | ```lua
10 | local main = basalt.createFrame()
11 | local aMenubar = main:addMenubar()
12 | :addItem("1. Entry")
13 | :addItem("2. Entry",colors.yellow)
14 | :addItem("3. Entry",colors.yellow,colors.green)
15 | :selectItem(2)
16 | basalt.debug(aMenubar:getItemIndex())
17 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Menubar/getOffset.md:
--------------------------------------------------------------------------------
1 | ## getOffset
2 | Returns the current index offset
3 |
4 | #### Returns:
5 | 1. `number` offset value
6 |
7 | #### Usage:
8 | * Creates a default menubar with 6 entries and sets the offset to 3, also prints the current offset.
9 | ```lua
10 | local main = basalt.createFrame()
11 | local aMenubar = main:addMenubar()
12 | :addItem("1. Entry")
13 | :addItem("2. Entry")
14 | :addItem("3. Entry")
15 | :addItem("4. Entry")
16 | :addItem("5. Entry")
17 | :addItem("6. Entry")
18 | :addItem("7. Entry")
19 | :addItem("8. Entry")
20 | :setOffset(3)
21 | basalt.debug(aMenubar:getOffset())
22 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Menubar/removeItem.md:
--------------------------------------------------------------------------------
1 | ## removeItem
2 | Removes a item from the menubar
3 |
4 | #### Parameters:
5 | 1. `number` The index which should get removed
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default menubar with 3 entries and removes the second one.
12 | ```lua
13 | local main = basalt.createFrame()
14 | local aMenubar = main:addMenubar()
15 | :addItem("1. Entry")
16 | :addItem("2. Entry",colors.yellow)
17 | :addItem("3. Entry",colors.yellow,colors.green)
18 | :removeItem(2)
19 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Menubar/selectItem.md:
--------------------------------------------------------------------------------
1 | ## selectItem
2 | selects a item in the menubar (same as a player would click on a item)
3 |
4 | #### Parameters:
5 | 1. `number` The index which should get selected
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default menubar with 3 entries and selects the second entry.
12 | ```lua
13 | local main = basalt.createFrame()
14 | local aMenubar = main:addMenubar()
15 | :addItem("1. Entry")
16 | :addItem("2. Entry",colors.yellow)
17 | :addItem("3. Entry",colors.yellow,colors.green)
18 | :selectItem(2)
19 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/disable.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## disable
4 |
5 | Disables the object's event listeners
6 |
7 | This will disable the object. Which means it doesn't listen to any events anymore.
8 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/enable.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## enable
4 |
5 | Enables the object's event listeners
6 |
7 | If the object's is disabled, it will stop listening to incoming events, this will reenable it.
8 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/getAbsolutePosition.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## getAbsolutePosition
4 |
5 | Converts the relative coordinates into absolute coordinates
6 |
7 | ### Parameters
8 |
9 | 1. `number|nil` x
10 | 2. `number|nil` y
11 |
12 | ### Returns
13 |
14 | 1. `object` The object in use
15 |
16 | ### Usage
17 |
18 | * Creates a frame and a button and prints the button's absolute position to the debug console
19 |
20 | ```lua
21 | local mainFrame = basalt.createFrame():setPosition(3,3)
22 | local aButton = mainFrame:addButton():setSize(8,1):setPosition(4,2)
23 | basalt.debug(aButton:getAbsolutePosition()) -- returns 7,5 (frame coords + own coords) instead of 4,2
24 | ```
25 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/getBackground.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## getBackground
4 |
5 | Returns the current background color
6 |
7 | ### Returns
8 |
9 | 1. `number` color
10 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/getForeground.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## getForeground
4 |
5 | Returns the current foreground color
6 |
7 | ### Returns
8 |
9 | 1. `number` color
10 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/getName.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## getName
4 |
5 | Returns the given name of the object
6 |
7 | ### Returns
8 |
9 | 1. `string` name
10 |
11 | #### Usage
12 |
13 | * Prints name of object to debug window
14 |
15 | ```lua
16 | local main = basalt.createFrame()
17 | basalt.debug(main:getName()) -- returns the uuid
18 | ```
19 |
20 | ```lua
21 | local main = basalt.createFrame("myFirstMainFrame")
22 | basalt.debug(main:getName()) -- returns myFirstMainFrame
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/getPosition.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## getPosition
4 |
5 | Returns the object's position
6 |
7 | ### Returns
8 |
9 | 1. `number` x
10 | 2. `number` y
11 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/getSize.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## getSize
4 |
5 | Returns the object's size
6 |
7 | ### Returns
8 |
9 | 1. `number` w
10 | 2. `number` h
11 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/getValue.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## getValue
4 |
5 | Returns the currently saved value
6 |
7 | ### Returns
8 |
9 | 1. `any` Object's value
10 |
11 | ### Usage
12 |
13 | * Prints the value of the checkbox to the debug console
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aCheckbox = mainFrame:addCheckbox():setValue(true)
18 | basalt.debug(aCheckbox:getValue()) -- returns true
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/hide.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## hide
4 |
5 | Hides the object
6 |
7 | ### Returns
8 |
9 | 1. `object` The object in use
10 |
11 | #### Usage
12 |
13 | * Hides a frame
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local button = mainFrame:addButton():setText("Close"):onClick(function() mainFrame:hide() end)
18 | ```
19 |
20 | ```xml
21 |
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/isFocused.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## isFocused
4 |
5 | Returns if the object is currently the focused object of the parent frame
6 |
7 | ### Returns
8 |
9 | 1. `boolean` Whether the object is focused
10 |
11 | #### Usage
12 |
13 | * Prints whether the button is focused to the debug console
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aButton = mainFrame:addButton()
18 | basalt.debug(aButton:isFocused()) -- shows true or false as a debug message
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/isVisible.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## isVisible
4 |
5 | Returns if the object is currently visible
6 |
7 | ### Returns
8 |
9 | 1. `boolean`
10 |
11 | #### Usage
12 |
13 | * Prints boolean visibility of object to debug console
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aButton = mainFrame:addButton():setSize(5,8)
18 | basalt.debug(aButton:isVisible()) -- returns true
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/onChar.md:
--------------------------------------------------------------------------------
1 | # Object - Event
2 |
3 | ## onChar
4 |
5 | `onChar(self, event, char)`
6 |
7 | The computercraft event which triggers this method is `char`.
8 |
9 | The char event always happens after the key event (just like in cc:tweaked)
10 |
11 | Here is a example on how to add a onChar event to your frame:
12 |
13 | ```lua
14 | local basalt = require("basalt")
15 |
16 | local main = basalt.createFrame()
17 | local subFrame = main:addFrame()
18 | :setPosition(3,3)
19 | :setSize(18,6)
20 | :hide()
21 |
22 | function openSubFrame(self, event, char)
23 | if(char=="a")then
24 | subFrame:show()
25 | end
26 | end
27 | main:onChar(openSubFrame)
28 | ```
29 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/onGetFocus.md:
--------------------------------------------------------------------------------
1 | # Object - Event
2 |
3 | ## onGetFocus
4 |
5 | `onGetFocus(self)`
6 |
7 | This event gets triggered as soon as the object is the currently focused object.
8 |
9 | ```lua
10 | local basalt = require("basalt")
11 |
12 | local main = basalt.createFrame()
13 | local aButton = main:addButton()
14 | :setPosition(3,3)
15 | :onGetFocus(
16 | function(self)
17 | basalt.debug("Welcome back!")
18 | end
19 | )
20 | ```
21 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/onHover.md:
--------------------------------------------------------------------------------
1 | # Object - Event
2 |
3 | ## onHover
4 |
5 | `onHover(self, event, button, x, y)`
6 |
7 | The computercraft event which triggers this method is `mouse_move` - only available in [CraftOS-PC](https://www.craftos-pc.cc).
8 |
9 | Here is a example on how to add a onHover event to your button:
10 |
11 | ```lua
12 | local basalt = require("basalt")
13 |
14 | local main = basalt.createFrame()
15 | local button = main:addButton()
16 | :setPosition(3,3)
17 | :setSize(12,3)
18 | :setText("Hover")
19 |
20 | function buttonOnHover()
21 | basalt.debug("The mouse hovers over the button!")
22 | end
23 | button:onHover(buttonOnHover)
24 | ```
25 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/onKey.md:
--------------------------------------------------------------------------------
1 | # Object - Event
2 |
3 | ## onKey
4 |
5 | `onKey(self, event, key)`
6 |
7 | The computercraft event which triggers this method is `key` and `char`.
8 |
9 | Here is a example on how to add a onKey event to your frame:
10 |
11 | ```lua
12 | local basalt = require("basalt")
13 |
14 | local main = basalt.createFrame()
15 | local subFrame = main:addFrame()
16 | :setPosition(3,3)
17 | :setSize(18,6)
18 | :hide()
19 |
20 | function openSubFrame(self, event, key)
21 | if(key==keys.c)then
22 | subFrame:show()
23 | end
24 | end
25 | main:onKey(openSubFrame)
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/onKeyUp.md:
--------------------------------------------------------------------------------
1 | # Object - Event
2 |
3 | ## onKeyUp
4 |
5 | `onKeyUp(self, event, key)`
6 |
7 | The computercraft event which triggers this method is `key_up`.
8 |
9 | Here is a example on how to add a onKeyUp event to your frame:
10 |
11 | ```lua
12 | local basalt = require("basalt")
13 |
14 | local main = basalt.createFrame()
15 | local subFrame = main:addFrame()
16 | :setPosition(3,3)
17 | :setSize(18,6)
18 |
19 | function openSubFrame(self, event, key)
20 | if(key==keys.c)then
21 | subFrame:show()
22 | end
23 | end
24 | main:onKeyUp(openSubFrame)
25 | ```
26 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/onLeave.md:
--------------------------------------------------------------------------------
1 | # Object - Event
2 |
3 | ## onLeave
4 |
5 | `onLeave(self, event, button, x, y)`
6 |
7 | The computercraft event which triggers this method is `mouse_move` - only available in [CraftOS-PC](https://www.craftos-pc.cc).
8 |
9 | Here is a example on how to add a onLeave event to your button:
10 |
11 | ```lua
12 | local basalt = require("basalt")
13 |
14 | local main = basalt.createFrame()
15 | local button = main:addButton()
16 | :setPosition(3,3)
17 | :setSize(12,3)
18 | :setText("Leave")
19 |
20 | function buttonOnLeave()
21 | basalt.debug("The mouse left the button!")
22 | end
23 | button:onLeave(buttonOnLeave)
24 | ```
25 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/onLoseFocus.md:
--------------------------------------------------------------------------------
1 | # Object - Event
2 |
3 | ## onLoseFocus
4 |
5 | `onLoseFocus(self)`
6 |
7 | This event gets triggered as soon as the object loses its focus.
8 |
9 | ```lua
10 | local basalt = require("basalt")
11 |
12 | local main = basalt.createFrame()
13 | local aButton = main:addButton()
14 | :setPosition(3,3)
15 | :onLoseFocus(
16 | function(self)
17 | basalt.debug("Please come back...")
18 | end
19 | )
20 | ```
21 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/onReposition.md:
--------------------------------------------------------------------------------
1 | # Object - Event
2 |
3 | ## onReposition
4 |
5 | `onReposition(self)`
6 |
7 | This is a custom event which gets triggered as soon as the object gets repositioned (for example by dynamic value).
8 |
9 | Here is a example on how to add a onReposition event to your button:
10 |
11 | ```lua
12 | local basalt = require("basalt")
13 |
14 | local main = basalt.createFrame()
15 | local aButton = main:addButton():setPosition(3,3)
16 |
17 | local function onButtonReposition(self)
18 | self:setSize(self:getWidth() - self:getX(), 3)
19 | end
20 |
21 | aButton:onReposition(onButtonReposition)
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/onResize.md:
--------------------------------------------------------------------------------
1 | # Object - Event
2 |
3 | ## onResize
4 |
5 | `onResize(self)`
6 |
7 | This is a custom event which gets triggered as soon as the parent frame gets resized.
8 |
9 | Here is a example on how to add a onResize event to your button:
10 |
11 | ```lua
12 | local basalt = require("basalt")
13 |
14 | local main = basalt.createFrame()
15 | local aButton = main:addButton():setPosition(3,3)
16 |
17 | local function onButtonResize(self)
18 | local width = main:getWidth()
19 | self:setSize(width, 3)
20 | end
21 |
22 | aButton:onResize(onButtonResize)
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/onScroll.md:
--------------------------------------------------------------------------------
1 | # Object - Event
2 |
3 | ## onScroll
4 |
5 | `onScroll(self, event, direction, x, y)`
6 |
7 | The computercraft event which triggers this method is `mouse_scroll`.
8 |
9 | Here is a example on how to add a onScroll event to your button:
10 |
11 | ```lua
12 | local basalt = require("basalt")
13 |
14 | local main = basalt.createFrame()
15 | local button = main:addButton()
16 | :setPosition(3,3)
17 | :setSize(12,3)
18 | :setText("Click")
19 |
20 | function buttonOnScroll(self, direction, x, y)
21 | basalt.debug("Someone scrolls on me!")
22 | end
23 | button:onScroll(buttonOnScroll)
24 | ```
25 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/remove.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## remove
4 |
5 | Removes the object from it's parent frame. This won't 'destroy' the object, It will continue to exist as long as you still have pointers to it.
6 |
7 | Here is a example on how a button will be fully removed from the memory:
8 |
9 | ```lua
10 | local main = basalt.createFrame()
11 | local button = main:addButton():setPosition(2,2):setText("Close")
12 |
13 | button:remove()
14 | button = nil
15 | ```
16 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/setAnchor.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## setAnchor
4 |
5 | Sets the anchor of the object
6 |
7 | ### Parameters
8 |
9 | 1. `string` Anchor sides `("topLeft" "top", "topRight", "right", "bottomRight", "bottom", "bottomLeft", "left", "center")`
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Sets the button to have an anchor of `bottomRight`
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame():show()
21 | local aButton = mainFrame:addButton()
22 | :setAnchor("bottomRight")
23 | :setSize(8,1)
24 | :setPosition(-8,1)
25 | ```
26 |
27 | ```xml
28 |
29 | ```
30 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/setFocus.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## setFocus
4 |
5 | Sets the object to be the focused object.
6 | If you click on an object, it's normally automatically the focused object. For example, if you call :show() on a frame, and you want this particular frame to be in
7 | the foreground, you should also use :setFocus()
8 |
9 | ### Returns
10 |
11 | 1. `object` The object in use
12 |
13 | ### Usage
14 |
15 | * Sets the button to the focused object
16 |
17 | ```lua
18 | local mainFrame = basalt.createFrame()
19 | local aButton = mainFrame:addButton():setFocus()
20 | ```
21 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/setForeground.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## setForeground
4 |
5 | Changes the object text color
6 |
7 | ### Parameters
8 |
9 | 1. `number|color` Foreground color
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a frame, and sets its foreground color to `colors.green`
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame():setForeground(colors.green)
21 | ```
22 |
23 | ```xml
24 |
25 | ```
26 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/setParent.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## setParent
4 |
5 | Sets the parent frame of the object
6 |
7 | ### Parameters
8 |
9 | 1. `frame` The to-be parent frame
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Sets the parent frame of the random frame, adding it to the main frame when the button is clicked"
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aRandomFrame = basalt.createFrame()
22 | local aButton = mainFrame:addButton():onClick(
23 | function()
24 | aRandomFrame:setParent(mainFrame)
25 | end
26 | )
27 | ```
28 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/setShadow.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## setShadow
4 |
5 | Sets the shadow color - default: false
6 |
7 | ### Parameters
8 |
9 | 1. `number|color` Shadow color
10 |
11 | #### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | #### Usage
16 |
17 | * Sets the shadow to green and shows it:
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local subFrame = mainFrame:addFrame()
22 | :setMovable()
23 | :setSize(18,6)
24 | :setShadow(colors.green)
25 | ```
26 |
27 | Or:
28 |
29 | ```xml
30 |
31 | ```
32 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/setSize.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## setSize
4 |
5 | Changes the object size
6 |
7 | ### Parameters
8 |
9 | 1. `number|string` width as number or dynamicvalue as string
10 | 2. `number|string` height as number or dynamicvalue as string
11 |
12 | ### Returns
13 |
14 | 1. `object` The object in use
15 |
16 | ### Usage
17 |
18 | * Sets the frame to have a width of 15 and a height of 12
19 |
20 | ```lua
21 | local mainFrame = basalt.createFrame()
22 | local subFrame = mainFrame:addFrame():setSize(15,12)
23 | ```
24 |
25 | ```xml
26 |
27 | ```
28 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/setValue.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## setValue
4 |
5 | Sets the value of that object (input, label, checkbox, textfield, scrollbar,...)
6 |
7 | ### Parameters
8 |
9 | 1. `any` Value to set the object to
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a checkbox and ticks it
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aCheckbox = mainFrame:addCheckbox():setValue(true)
22 | ```
23 |
24 | ```xml
25 |
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Object/show.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## show
4 |
5 | Shows the object (only if the parent frame is already visible)
6 |
7 | ### Returns
8 |
9 | 1. `object` The object in use
10 |
11 | ### Usage
12 |
13 | * Shows a frame
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local button = mainFrame:addButton()
18 | button:show()
19 | ```
20 |
21 | ```xml
22 |
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Program/execute.md:
--------------------------------------------------------------------------------
1 | ## execute
2 | Executes the given path or program
3 |
4 | #### Parameters:
5 | 1. `string|function` the path to your file as string, or function which should be called
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Executes worm
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aProgram = mainFrame:addProgram()
15 | aProgram:execute("rom/programs/fun/worm.lua") -- executes worm
16 | ```
17 | ```xml
18 |
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Program/getStatus.md:
--------------------------------------------------------------------------------
1 | ## getStatus
2 | returns the current process status
3 |
4 | #### Returns:
5 | 1. `string` current status ("running", "normal, "suspended", or "dead")
6 |
7 | #### Usage:
8 | * Prints current status
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aProgram = mainFrame:addProgram()
12 | basalt.debug(aProgram:getStatus())
13 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Program/isPaused.md:
--------------------------------------------------------------------------------
1 | ## isPaused
2 | returns if the program is paused
3 |
4 | #### Returns:
5 | 1. `boolean` pause status
6 |
7 | #### Usage:
8 | * Prints the pause status of the program
9 | ```lua
10 | local mainFrame = basalt.createFrame():show()
11 | local aProgram = mainFrame:addProgram():execute("rom/programs/shell.lua"):show()
12 | basalt.debug(aProgram:isPaused())
13 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Program/onDone.md:
--------------------------------------------------------------------------------
1 | # onDone
2 |
3 | `onDone(self, err)`
4 | This is a custom event which gets triggered as soon as the program has finished.
5 |
6 | Here is a example on how to add a onDone event to your program:
7 |
8 | ```lua
9 | local basalt = require("basalt")
10 |
11 | local main = basalt.createFrame()
12 | local aProgram = main:addProgram():execute("rom/programs/shell.lua")
13 |
14 | local function onProgramDone()
15 | basalt.debug("Program has finished")
16 | end
17 |
18 | aProgram:onDone(onProgramDone)
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Program/pause.md:
--------------------------------------------------------------------------------
1 | ## pause
2 | pauses the current program (prevents the program from receiving events)
3 |
4 | #### Parameters:
5 | 1. `boolean` true, false or nothing
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Pauses worm by clicking a button
12 | ```lua
13 | local mainFrame = basalt.createFrame():show()
14 | local aProgram = mainFrame:addProgram():execute("rom/programs/shell.lua"):show()
15 | mainFrame:addButton():setText("Pause"):onClick(function() aProgram:pause(true) end):show()
16 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Program/setEnviroment.md:
--------------------------------------------------------------------------------
1 | ## setEnviroment
2 | Changes the default enviroment to a custom enviroment
3 |
4 | #### Parameters:
5 |
6 | 1. `table` - Enviroment table
7 |
8 | #### Returns:
9 |
10 | 1. `program` Program in use
11 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Program/stop.md:
--------------------------------------------------------------------------------
1 | ## stop
2 | Stops a currently running program
3 |
4 | #### Returns:
5 | 1. `object` The object in use
6 |
7 | #### Usage:
8 | * Stops worm by clicking a button
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aProgram = mainFrame:addProgram()
12 | aProgram:execute("rom/programs/fun/worm.lua") -- executes worm
13 | mainFrame:addButton():setText("Pause"):onClick(function() aProgram:stop() end):show()
14 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Progressbar/getProgress.md:
--------------------------------------------------------------------------------
1 | ## getProgress
2 | Returns the current progress status
3 |
4 | #### Returns:
5 | 1. `number` progress (0-100)
6 |
7 | #### Usage:
8 | * Creates a progressbar, sets the current progress to 50 and prints the current progress
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aProgressbar = mainFrame:addProgressbar()
12 | aProgressbar:setProgress(50)
13 | basalt.debug(aProgressbar:getProgress())
14 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Progressbar/onDone.md:
--------------------------------------------------------------------------------
1 | # onDone
2 |
3 | `onDone(self, err)`
4 | This is a custom event which gets triggered as soon as the progress is done.
5 |
6 | Here is a example on how to add a onDone event to your progressbar:
7 |
8 | ```lua
9 | local basalt = require("basalt")
10 |
11 | local main = basalt.createFrame()
12 | local aProgressbar = main:addProgressbar()
13 |
14 | local function onProgressDone()
15 | basalt.debug("Progress is done")
16 | end
17 |
18 | aProgressbar:onDone(onProgressDone)
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Progressbar/setBackgroundSymbol.md:
--------------------------------------------------------------------------------
1 | ## setBackgroundSymbol
2 | This will change the background symbol (default is " " - space)
3 |
4 | #### Parameters:
5 | 1. `char` the background symbol
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a progressbar and sets the progressbar background symbol to X
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aProgressbar = mainFrame:addProgressbar()
15 | aProgressbar:setBackgroundSymbol("X")
16 | ```
17 | ```xml
18 |
19 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Progressbar/setDirection.md:
--------------------------------------------------------------------------------
1 | ## setDirection
2 | Sets the direction in which the bar should be expanding.
3 |
4 | #### Parameters:
5 | 1. `number` x direction (0 = left to right, 1 = top to bottom, 2 = right to left and 3 = bottom to top)
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a progressbar and sets the direction from bottom to top
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aProgressbar = mainFrame:addProgressbar()
15 | aProgressbar:setDirection(3)
16 | ```
17 | ```xml
18 |
19 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Progressbar/setProgress.md:
--------------------------------------------------------------------------------
1 | ## setProgress
2 | This is the function you need to call if you want the progression to change.
3 |
4 | #### Parameters:
5 | 1. `number` a number from 0 to 100
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a progressbar and sets the current progress to 50
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aProgressbar = mainFrame:addProgressbar()
15 | aProgressbar:setProgress(50)
16 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Radio/clear.md:
--------------------------------------------------------------------------------
1 | ## clear
2 | Removes all items.
3 |
4 | #### Returns:
5 | 1. `object` The object in use
6 |
7 | #### Usage:
8 | * Creates a default radio with 3 entries and removes them immediatley. Which makes no sense.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aRadio = mainFrame:addRadio()
12 | aRadio:addItem("1. Entry",5,2)
13 | aRadio:addItem("2. Entry",5,4,colors.yellow)
14 | aRadio:addItem("3. Entry",5,6,colors.yellow,colors.green)
15 | aRadio:clear()
16 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Radio/getAll.md:
--------------------------------------------------------------------------------
1 | ## getAll
2 | Returns all items as table
3 |
4 | #### Returns:
5 | 1. `table` All items
6 |
7 | #### Usage:
8 | * Creates a default menubar with 3 entries and prints a table.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aRadio = mainFrame:addRadio()
12 | aRadio:addItem("1. Entry",5,2)
13 | aRadio:addItem("2. Entry",5,4,colors.yellow)
14 | aRadio:addItem("3. Entry",5,6,colors.yellow,colors.green)
15 | basalt.debug(aRadio:getAll())
16 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Radio/getItem.md:
--------------------------------------------------------------------------------
1 | ## getItem
2 | Returns a item by index
3 |
4 | #### Parameters:
5 | 1. `number` The index which should be returned
6 |
7 | #### Returns:
8 | 1. `table` The item table example: {text="1. Entry", bgCol=colors.black, fgCol=colors.white}
9 |
10 | #### Usage:
11 | * Creates a default radio with 3 entries and edits the second one.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aRadio = mainFrame:addRadio()
15 | aRadio:addItem("1. Entry",5,2)
16 | aRadio:addItem("2. Entry",5,4,colors.yellow)
17 | aRadio:addItem("3. Entry",5,6,colors.yellow,colors.green)
18 | basalt.debug(aRadio:getItem(2).text)
19 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Radio/getItemCount.md:
--------------------------------------------------------------------------------
1 | ## getItemCount
2 | Returns the current item count
3 |
4 | #### Returns:
5 | 1. `number` The item radio count
6 |
7 | #### Usage:
8 | * Creates a default radio with 3 entries and prints the current item count.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aRadio = mainFrame:addRadio()
12 | aRadio:addItem("1. Entry",5,2)
13 | aRadio:addItem("2. Entry",5,4,colors.yellow)
14 | aRadio:addItem("3. Entry",5,6,colors.yellow,colors.green)
15 | basalt.debug(aRadio:getItemCount())
16 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Radio/getItemIndex.md:
--------------------------------------------------------------------------------
1 | ## getItemIndex
2 | returns the item index of the currently selected item
3 |
4 | #### Returns:
5 | 1. `number` The current index
6 |
7 | #### Usage:
8 | * Creates a default radio with 3 entries selects the second entry and prints the currently selected index.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aRadio = mainFrame:addRadio()
12 | aRadio:addItem("1. Entry",5,2)
13 | aRadio:addItem("2. Entry",5,4,colors.yellow)
14 | aRadio:addItem("3. Entry",5,6,colors.yellow,colors.green)
15 | aRadio:selectItem(2)
16 | basalt.debug(aRadio:getItemIndex())
17 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Radio/removeItem.md:
--------------------------------------------------------------------------------
1 | ## removeItem
2 | Removes a item from the radio
3 |
4 | #### Parameters:
5 | 1. `number` The index which should get removed
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default radio with 3 entries and removes the second one.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aRadio = mainFrame:addRadio()
15 | aRadio:addItem("1. Entry",5,2)
16 | aRadio:addItem("2. Entry",5,4,colors.yellow)
17 | aRadio:addItem("3. Entry",5,6,colors.yellow,colors.green)
18 | aRadio:removeItem(2)
19 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Radio/selectItem.md:
--------------------------------------------------------------------------------
1 | ## selectItem
2 | selects a item in the radio (same as a player would click on a item)
3 |
4 | #### Parameters:
5 | 1. `number` The index which should get selected
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default radio with 3 entries and selects the second entry.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aRadio = mainFrame:addRadio()
15 | aRadio:addItem("1. Entry",5,2)
16 | aRadio:addItem("2. Entry",5,4,colors.yellow)
17 | aRadio:addItem("3. Entry",5,6,colors.yellow,colors.green)
18 | aRadio:selectItem(2)
19 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Scrollbar/getIndex.md:
--------------------------------------------------------------------------------
1 | ## getIndex
2 | Returns the current index
3 |
4 | #### Returns:
5 | 1. `number` index
6 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Scrollbar/setBackgroundSymbol.md:
--------------------------------------------------------------------------------
1 | ## setBackgroundSymbol
2 | Changes the symbol in the background, default is "\127"
3 |
4 | #### Parameters:
5 | 1. `string` symbol
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a new scrollbar and changes the background symbol to X
12 | ```lua
13 | local main = basalt.createFrame()
14 | local scrollbar = main:addScrollbar():setBackgroundSymbol("X")
15 | ```
16 | ```xml
17 |
18 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Scrollbar/setBarType.md:
--------------------------------------------------------------------------------
1 | ## setBarType
2 | Changes the scrollbar to be vertical or horizontal, default is vertical
3 |
4 | #### Parameters:
5 | 1. `string` vertical or horizontal
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a new scrollbar and changes the bar type to horizontal
12 | ```lua
13 | local main = basalt.createFrame()
14 | local scrollbar = main:addScrollbar():setBarType("horizontal")
15 | ```
16 | ```xml
17 |
18 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Scrollbar/setIndex.md:
--------------------------------------------------------------------------------
1 | ## setIndex
2 | Changes the current index to your choice, for example you could create a button which scrolls up to 1 by using :setIndex(1)
3 |
4 | #### Parameters:
5 | 1. `number` the index
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a new scrollbar and changes the index to 1 as soon as the button got clicked
12 | ```lua
13 | local main = basalt.createFrame()
14 | local scrollbar = main:addScrollbar():setMaxValue(20)
15 | local button = main:addButton(function()
16 | scrollbar:setIndex(1)
17 | end)
18 | ```
19 | ```xml
20 |
21 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Scrollbar/setSymbol.md:
--------------------------------------------------------------------------------
1 | ## setSymbol
2 | Changes the scrollbar symbol, default is " "
3 |
4 | #### Parameters:
5 | 1. `string` symbol
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a new scrollbar and changes the symbol to X
12 | ```lua
13 | local main = basalt.createFrame()
14 | local scrollbar = main:addScrollbar():setSymbol("X")
15 | ```
16 | ```xml
17 |
18 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Slider/getIndex.md:
--------------------------------------------------------------------------------
1 | ## getIndex
2 | Returns the current index
3 |
4 | #### Returns:
5 | 1. `number` index
6 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Slider/setBackgroundSymbol.md:
--------------------------------------------------------------------------------
1 | ## setBackgroundSymbol
2 | Changes the symbol in the background, default is "\140"
3 |
4 | #### Parameters:
5 | 1. `string` symbol
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a new slider and changes the background symbol to X
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local slider = mainFrame:addSlider():setBackgroundSymbol("X")
15 | ```
16 | ```xml
17 |
18 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Slider/setBarType.md:
--------------------------------------------------------------------------------
1 | ## setBarType
2 | Changes the slider to be vertical or horizontal, default is horizontal
3 |
4 | #### Parameters:
5 | 1. `string` vertical or horizontal
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a new slider and changes the bar type to horizontal
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local slider = mainFrame:addSlider():setBarType("vertical")
15 | ```
16 | ```xml
17 |
18 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Slider/setIndex.md:
--------------------------------------------------------------------------------
1 | ## setIndex
2 | Changes the current index to your choice, for example you could create a button which scrolls up to 1 by using :setIndex(1)
3 |
4 | #### Parameters:
5 | 1. `number` the index
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a new slider and changes the index to 1 as soon as the button got clicked
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local slider = mainFrame:addSlider():setMaxValue(20)
15 | local button = mainFrame:addButton(function()
16 | slider:setIndex(1)
17 | end)
18 | ```
19 | ```xml
20 |
21 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Slider/setSymbol.md:
--------------------------------------------------------------------------------
1 | ## setSymbol
2 | Changes the slider symbol, default is " "
3 |
4 | #### Parameters:
5 | 1. `string` symbol
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a new slider and changes the symbol to X
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local slider = mainFrame:addSlider():setSymbol("X")
15 | ```
16 | ```xml
17 |
18 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Textfield.md:
--------------------------------------------------------------------------------
1 | Textfields are objects, where the user can write something in multiple lines. It behaves like the default edit script
2 |
3 | [Object](objects/Object.md) methods also apply for textfields.
4 |
5 | | | |
6 | |---|---|
7 | |[getLines](objects/Textfield/getLines.md)|
8 | |[getLine](objects/Textfield/getLine.md)|
9 | |[editLine](objects/Textfield/editLine.md)|
10 | |[addLine](objects/Textfield/addLine.md)|
11 | |[removeLine](objects/Textfield/removeLine.md)|
12 | |[getTextCursor](objects/Textfield/getTextCursor.md)|
13 | |[addKeywords](objects/Textfield/addKeywords.md)|
14 | |[addRule](objects/Textfield/addRule.md)|
15 |
16 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Textfield/addLine.md:
--------------------------------------------------------------------------------
1 | ## addLine
2 | Adds a line on index position
3 |
4 | #### Parameteres:
5 | 1. `string` text
6 | 2. `number` index
7 |
8 | #### Returns:
9 | 1. `object` The object in use
10 |
11 | #### Usage:
12 | * Adds a line
13 | ```lua
14 | local mainFrame = basalt.createFrame("myFirstFrame"):show()
15 | local aTextfield = mainFrame:addTextfield("myFirstTextfield"):show()
16 | basalt.debug(aTextfield:addLine("Hello!", 1))
17 | ```
18 | ```xml
19 |
20 |
21 | Hello!
22 |
23 |
24 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Textfield/editLine.md:
--------------------------------------------------------------------------------
1 | ## editLine
2 | Edits the line on index position
3 |
4 | #### Parameteres:
5 | 1. `number` index
6 | 2. `string` text
7 |
8 | #### Returns:
9 | 1. `object` The object in use
10 |
11 | #### Usage:
12 | * Edits the line
13 | ```lua
14 | local mainFrame = basalt.createFrame("myFirstFrame"):show()
15 | local aTextfield = mainFrame:addTextfield("myFirstTextfield"):show()
16 | basalt.debug(aTextfield:editLine(1, "Hello!"))
17 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Textfield/getLine.md:
--------------------------------------------------------------------------------
1 | ## getLine
2 | Returns the line on index position
3 |
4 | #### Parameteres:
5 | 1. `number` index
6 |
7 | #### Returns:
8 | 1. `string` line
9 |
10 | #### Usage:
11 | * Prints one line
12 | ```lua
13 | local mainFrame = basalt.createFrame("myFirstFrame"):show()
14 | local aTextfield = mainFrame:addTextfield("myFirstTextfield"):show()
15 | basalt.debug(aTextfield:getLine(1))
16 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Textfield/getLines.md:
--------------------------------------------------------------------------------
1 | ## getLines
2 | Returns all lines
3 |
4 | #### Returns:
5 | 1. `table` lines
6 |
7 | #### Usage:
8 | * Prints all lines
9 | ```lua
10 | local mainFrame = basalt.createFrame("myFirstFrame"):show()
11 | local aTextfield = mainFrame:addTextfield("myFirstTextfield"):show()
12 | basalt.debug(aTextfield:getLines())
13 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Textfield/getTextCursor.md:
--------------------------------------------------------------------------------
1 | ## getTextCursor
2 | Gets text cursor position
3 |
4 | #### Returns:
5 | 1. `number` x position
6 | 2. `number` y position
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Textfield/removeLine.md:
--------------------------------------------------------------------------------
1 | ## removeLine
2 | Removes the line on index position
3 |
4 | #### Parameteres:
5 | 1. `number` index
6 | 2. `string` text
7 |
8 | #### Returns:
9 | 1. `object` The object in use
10 |
11 | #### Usage:
12 | * Removes a line
13 | ```lua
14 | local mainFrame = basalt.createFrame("myFirstFrame"):show()
15 | local aTextfield = mainFrame:addTextfield("myFirstTextfield"):show()
16 | basalt.debug(aTextfield:removeLine())
17 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Thread.md:
--------------------------------------------------------------------------------
1 | ## Methods
2 |
3 | | | |
4 | |---|---|
5 | |[start](objects/Thread/start.md)|starts a new thread and executes the function
6 | |[stop](objects/Thread/stop.md)|stops the currently running thread
7 | |[getStatus](objects/Thread/getStatus.md)|Returns the current thread status
8 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Thread/getStatus.md:
--------------------------------------------------------------------------------
1 | ## getStatus
2 | Returns the current thread status
3 |
4 | #### Returns:
5 | 1. `string` current status - ("running", "normal", "suspended", "dead")
6 |
7 | #### Usage:
8 | ```lua
9 | local mainFrame = basalt.createFrame()
10 | local aThread = mainFrame:addThread()
11 | basalt.debug(aThread:getStatus())
12 | ```
13 |
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Timer.md:
--------------------------------------------------------------------------------
1 | ## Methods
2 |
3 | | | |
4 | |---|---|
5 | |[setTime](objects/Timer/setTime.md)|Sets the time the timer should wait after calling your function
6 | |[start](objects/Timer/start.md)|Starts the timer
7 | |[cancel](objects/Timer/cancel.md)|Cancels the timer
8 |
9 | ## Events
10 |
11 | | | |
12 | |---|---|
13 | |[onCall](objects/Timer/onCall.md)|A custom event which gets triggered as soon as the current timer has finished
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Timer/cancel.md:
--------------------------------------------------------------------------------
1 | ## cancel
2 | Cancels the timer
3 |
4 | #### Returns:
5 | 1. `object` The object
6 |
7 | ```lua
8 | local mainFrame = basalt.createFrame()
9 | local aTimer = mainFrame:addTimer()
10 | aTimer:setTime(2):start()
11 | aTimer:cancel()
12 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Timer/setTime.md:
--------------------------------------------------------------------------------
1 | ## setTime
2 | sets the time the timer should wait after calling your function
3 |
4 | #### Parameters:
5 | 1. `number` the time to delay
6 | 2. `number` how often it should be repeated -1 is infinite
7 |
8 | #### Returns:
9 | 1. `object` The object
10 |
11 | ```lua
12 | local mainFrame = basalt.createFrame()
13 | local aTimer = mainFrame:addTimer()
14 | aTimer:setTime(2)
15 | ```
16 | ```xml
17 |
18 | ```
--------------------------------------------------------------------------------
/docs/docs1_6/objects/Timer/start.md:
--------------------------------------------------------------------------------
1 | ## start
2 | Starts the timer
3 |
4 | #### Returns:
5 | 1. `object` The object
6 |
7 | ```lua
8 | local mainFrame = basalt.createFrame()
9 | local aTimer = mainFrame:addTimer()
10 | aTimer:setTime(2):start()
11 | ```
12 | ```xml
13 |
14 | ```
--------------------------------------------------------------------------------
/docs/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/favicon-16x16.png
--------------------------------------------------------------------------------
/docs/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/favicon-32x32.png
--------------------------------------------------------------------------------
/docs/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pyroxenium/Basalt/64cb0d15e8881a505db52a7673a2122dd178ec52/docs/favicon.ico
--------------------------------------------------------------------------------
/docs/objects/Animation/add.md:
--------------------------------------------------------------------------------
1 | ## add
2 | Adds a new function to an animation
3 | #### Parameters:
4 | 1. `function` The function containing animation logic
5 |
6 | #### Returns:
7 | 1. `animation` Animation in use
8 |
9 |
10 | #### Usage:
11 | * This will set the button position to 3,3, waits 1 second, then sets position to 4,4, waits 2 seconds, and then sets the position to 5,5
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local testButton = mainFrame:addButton()
15 | local aAnimation = mainFrame:addAnimation():add(function() testButton:setPosition(3,3) end):wait(1):add(function() testButton:setPosition(1,1,"r") end):wait(2):add(function() testButton:setPosition(1,1,"r") end)
16 | aAnimation:play()
17 | ```
--------------------------------------------------------------------------------
/docs/objects/Animation/cancel.md:
--------------------------------------------------------------------------------
1 | ## cancel
2 | Cancels the animation
3 |
4 | #### Returns:
5 | 1. `animation` Animation in use
6 |
7 | #### Usage:
8 |
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local testButton = mainFrame:addButton()
12 | local aAnimation = mainFrame:addAnimation():add(function() testButton:setBackground(colors.black) end):wait(1):add(function() aAnimation:cancel() end):wait(1):add(function() testButton:setBackground(colors.lightGray) end)
13 |
14 | aAnimation:play()
15 | ```
--------------------------------------------------------------------------------
/docs/objects/Animation/onStart.md:
--------------------------------------------------------------------------------
1 | ## onStart
2 | `onStart(self)`
3 | This is a event which gets fired as soon as the animation is started.
4 |
5 | ```lua
6 | local basalt = require("Basalt")
7 |
8 | local mainFrame = basalt.createFrame()
9 | local testButton = mainFrame:addButton("buttonToAnimate")
10 | local aAnimation = mainFrame:addAnimation():setObject(testButton):changeTextColor({colors.red, colors.yellow, colors.green}, 2)
11 | aAnimation:onStart(function()
12 | basalt.debug("The animation is started")
13 | end)
14 |
15 | aAnimation:play()
16 | ```
17 |
--------------------------------------------------------------------------------
/docs/objects/Animation/setObject.md:
--------------------------------------------------------------------------------
1 | ## setObject
2 | Sets the object which the animation should reposition/resize
3 |
4 | #### Parameters:
5 | 1. `table` object
6 |
7 | #### Returns:
8 | 1. `animation` Animation in use
9 |
10 | #### Usage:
11 |
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local testButton = mainFrame:addButton()
15 | local aAnimation = mainFrame:addAnimation():setObject(testButton)
16 | ```
17 |
18 | ```lua
19 | local mainFrame = basalt.createFrame()
20 | local testButton = mainFrame:addButton("buttonToAnimate")
21 | ```
22 | ```xml
23 |
24 | ```
--------------------------------------------------------------------------------
/docs/objects/Animation/wait.md:
--------------------------------------------------------------------------------
1 | ## wait
2 | Sets a wait timer for the next function after the previous function got executed, no wait timer calls the next function immediately
3 | #### Parameters:
4 | 1. `number` The length of delay between the functions _(in seconds)_
5 |
6 | #### Returns:
7 | 1. `animation` Animation in use
8 |
9 | #### Usage:
10 | ```lua
11 | local mainFrame = basalt.createFrame()
12 | local testButton = mainFrame:addButton()
13 | local aAnimation = mainFrame:addAnimation():add(function() testButton:setPosition(3,3) end):wait(1):add(function() testButton:setPosition(1,1,"r") end):wait(2):add(function() testButton:setPosition(1,1,"r") end)
14 |
15 | aAnimation:play()
16 | ```
--------------------------------------------------------------------------------
/docs/objects/Basalt/getActiveFrame.md:
--------------------------------------------------------------------------------
1 | ## getActiveFrame
2 |
3 | ### Description
4 |
5 | Returns the currently active/visible base frame.
6 |
7 | ### Returns
8 |
9 | 1. `frame` The current frame
10 |
11 | ### Usage
12 |
13 | * Displays the active frame name in the debug console
14 |
15 | ```lua
16 | local main = basalt.createFrame()
17 | basalt.debug(basalt.getActiveFrame():getName()) -- returns the id
18 | ```
19 |
--------------------------------------------------------------------------------
/docs/objects/Basalt/getTheme.md:
--------------------------------------------------------------------------------
1 | ## getTheme
2 |
3 | ### Description
4 |
5 | Returns the current base-theme. This base-theme can be set using setTheme.lua.
6 |
7 | ### Returns
8 |
9 | 1. `number` The color of the requested base-theme key.
10 |
11 | ### Usage
12 |
13 | * Displays the color of the main background in the debug console
14 |
15 | ```lua
16 | basalt.debug(basalt.getTheme("BasaltBG"))
17 | ```
18 |
--------------------------------------------------------------------------------
/docs/objects/Basalt/getVariable.md:
--------------------------------------------------------------------------------
1 | ## getVariable
2 |
3 | ### Description
4 |
5 | Returns a variable defined with [setVariable](objects/Basalt/setVariable)
6 |
7 | ### Returns
8 |
9 | 1. `variable` The variable stored
10 |
11 | ### Usage
12 |
13 | * Displays the stored variable in the debug console
14 |
15 | ```lua
16 | basalt.setVariable("abc", function()
17 | basalt.debug("I got clicked")
18 | return 1
19 | end)
20 |
21 | basalt.debug(basalt.getVariable("abc")()) -- Should debug log "I got clicked" and debug log 1 (which was returned from the function)
22 | ```
23 |
24 | ```xml
25 |
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/objects/Basalt/getVersion.md:
--------------------------------------------------------------------------------
1 | ## getVersion
2 |
3 | ### Description
4 |
5 | Returns the currently active/visible base frame.
6 |
7 | ### Returns
8 |
9 | 1. `string` The current version of Basalt
10 |
11 | ### Usage
12 |
13 | * Displays the version of Basalt in the debug console
14 |
15 | ```lua
16 | basalt.debug(basalt.getVersion()) -- Example: 1.6.2
17 | ```
18 |
--------------------------------------------------------------------------------
/docs/objects/Basalt/memory.md:
--------------------------------------------------------------------------------
1 | ## memory
2 |
3 | ### Description
4 |
5 | Returns the amount of memory used by Basalt in bytes. This can be useful for monitoring your application's memory usage and performance.
6 |
7 | ### Returns
8 |
9 | 1. `number` The amount of memory used by Basalt in bytes.
10 |
11 | ### Usage
12 |
13 | * Display the memory usage in the debug console
14 |
15 | ```lua
16 | local memoryUsage = basalt.memory()
17 | basalt.debug("Memory usage: ", memoryUsage, " bytes")
18 | ```
19 |
--------------------------------------------------------------------------------
/docs/objects/Basalt/onEvent.md:
--------------------------------------------------------------------------------
1 | ## onEvent
2 |
3 | ### Description
4 |
5 | This is the top-level method to intercept an event before sending it to the object event handlers. If you use `return false`, the event is not passed to the event handlers.
6 |
7 | ### Parameters
8 |
9 | 1. `function` The function which should be called
10 |
11 | ### Usage
12 |
13 | * Prevents the "terminate" event from stopping the program
14 |
15 | ```lua
16 | local basalt = require("basalt")
17 |
18 | basalt.onEvent(function(event)
19 | if(event=="terminate")then
20 | return false
21 | end
22 | end)
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/Basalt/setVariable.md:
--------------------------------------------------------------------------------
1 | ## setVariable
2 |
3 | ### Description
4 |
5 | This method stores a variable that you can access via XML. You can also add a function, which is then called by object events created in XML.
6 |
7 | ### Parameters
8 |
9 | 1. `string` key - A key name to store the variable.
10 | 2. `any` value - Any variable to store under the key.
11 |
12 | ### Usage
13 |
14 | * Adds a reusable function to Basalt.
15 |
16 | ```lua
17 | basalt.setVariable("clickMe", function()
18 | basalt.debug("I got clicked")
19 | end)
20 |
21 | ```
22 |
23 | ```xml
24 |
25 | ```
26 |
--------------------------------------------------------------------------------
/docs/objects/Basalt/stopUpdate.md:
--------------------------------------------------------------------------------
1 | ## stopUpdate / stop
2 |
3 | ### Description
4 |
5 | This method stops the automatic draw and event handler that was started by `basalt.autoUpdate()`.
6 | `basalt.autoUpdate(false)` achieves the same result.
7 |
8 | ### Usage
9 |
10 | * When the quit button is clicked, the button stops Basalt's event listeners and draw handlers.
11 |
12 | ```lua
13 | local main = basalt.createFrame()
14 | main:addButton()
15 | :setPosition(2,2)
16 | :setText("Stop Basalt!")
17 | :onClick(function()
18 | basalt.stopUpdate()
19 | end)
20 | basalt.autoUpdate()
21 | ```
22 |
--------------------------------------------------------------------------------
/docs/objects/Basalt/update.md:
--------------------------------------------------------------------------------
1 | ## update
2 |
3 | Calls the draw and event handler once - this gives more flexibility about which events basalt should process. For example you could filter the terminate event.
4 | Which means you have to pass the events into basalt.update.
5 |
6 | ### Parameters
7 |
8 | 1. `string` The event to be received
9 | 2. `...` Additional event variables to capture
10 |
11 | ### Usage
12 |
13 | * Creates and starts a custom update cycle
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | mainFrame:addButton():setPosition(2,2)
18 | while true do
19 | local ev = table.pack(os.pullEventRaw())
20 | basalt.update(table.unpack(ev))
21 | end
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/BaseFrame/getOffset.md:
--------------------------------------------------------------------------------
1 | ## getOffset
2 |
3 | ### Description
4 |
5 | Returns the offset
6 |
7 | ### Returns
8 |
9 | 1. `number` x position
10 | 2. `number` y position
11 |
12 | ### Usage
13 |
14 | * Prints the offset amount to the console
15 |
16 | ```lua
17 | local main = basalt.createFrame()
18 | local button = mainFrame:addButton()
19 |
20 | basalt.debug(main:getOffset())
21 | ```
22 |
--------------------------------------------------------------------------------
/docs/objects/BaseFrame/setOffset.md:
--------------------------------------------------------------------------------
1 | ## setOffset
2 |
3 | ### Description
4 |
5 | Sets the frame's offset, this offset is beeing used to move all children object's by the offset's position
6 |
7 | ### Parameters
8 |
9 | 1. `number` x position
10 | 2. `number` y position
11 |
12 | ### Returns
13 |
14 | 1. `object` The object in use
15 |
16 | ### Usage
17 |
18 | * Sets the baseframes offset by y5.
19 |
20 | ```lua
21 | local main = basalt.createFrame()
22 | local button = mainFrame:addButton()
23 |
24 | main:setOffset(0, 5)
25 | ```
26 |
--------------------------------------------------------------------------------
/docs/objects/Button/setHorizontalAlign.md:
--------------------------------------------------------------------------------
1 | ## setHorizontalAlign
2 |
3 | ### Description
4 |
5 | Sets the horizontal align of the button text
6 |
7 | ### Parameters
8 |
9 | 1. `string` the position as string ("left", "center", "right") - default is center.
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Sets the button's horizontal text align to right.
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local button = mainFrame:addButton()
22 | :setText("Click me!")
23 | :setHorizontalAlign("right")
24 | ```
25 |
26 | ```xml
27 |
28 | ```
29 |
--------------------------------------------------------------------------------
/docs/objects/Button/setText.md:
--------------------------------------------------------------------------------
1 | ## setText
2 |
3 | ### Description
4 |
5 | Sets the displayed button text
6 |
7 | ### Parameters
8 |
9 | 1. `string` the text the button should show
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a button with "Click me!" as text.
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local button = mainFrame:addButton():setText("Click me!")
22 | ```
23 |
24 | ```xml
25 |
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/objects/ChangeableObject.md:
--------------------------------------------------------------------------------
1 | The ChangeableObject class is a subclass of VisualObject and Object that provides additional methods for handling changes to objects.
2 |
3 | In addition to the Object and VisualObject methods, ChangeableObjects also have the following methods:
4 |
5 | | | |
6 | |---|---|
7 | |[setValue](objects/ChangeableObject/setValue.md)|Sets the value of your object
8 | |[getValue](objects/ChangeableObject/getValue.md)|Gets the value of your object
9 |
10 | ## Events
11 |
12 | | | |
13 | |---|---|
14 | |[onChange](objects/ChangeableObject/onChange.md)|Fires when the object value has changed
15 |
--------------------------------------------------------------------------------
/docs/objects/ChangeableObject/getValue.md:
--------------------------------------------------------------------------------
1 | ## getValue
2 |
3 | ### Description
4 |
5 | Gets the value of your object
6 |
7 | ### Returns
8 |
9 | 1. `any` The current value of the object
10 |
11 | ### Usage
12 |
13 | * Retrieves the value of a Slider.
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local slider = mainFrame:addSlider():setValue(50)
18 | local currentValue = slider:getValue()
19 |
20 | basalt.debug("The current value of the slider is:", currentValue)
21 | ```
22 |
--------------------------------------------------------------------------------
/docs/objects/ChangeableObject/setValue.md:
--------------------------------------------------------------------------------
1 | ## setValue
2 |
3 | ### Description
4 |
5 | Sets the value of your object
6 |
7 | ### Parameters
8 |
9 | 1. `any` new value
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a Slider with a value of 50.
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local slider = mainFrame:addSlider():setValue(50)
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/Checkbox/setSymbol.md:
--------------------------------------------------------------------------------
1 | ## setSymbol
2 |
3 | ### Description
4 |
5 | Changes the checkbox symbol, default is "\42"
6 |
7 | ### Parameters
8 |
9 | 1. `string` symbol
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a new checkbox and changes the symbol to o
18 |
19 | ```lua
20 | local main = basalt.createFrame()
21 | local checkbox = main:addCheckbox():setSymbol("o")
22 | ```
23 |
24 | ```xml
25 |
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/objects/Container/addChild.md:
--------------------------------------------------------------------------------
1 | ## addChild
2 |
3 | ### Description
4 |
5 | Adds a object to the container
6 |
7 | ### Parameters
8 |
9 | 1. `object` any object
10 |
11 | ### Returns
12 |
13 | 1. `object` The object which got added
14 |
--------------------------------------------------------------------------------
/docs/objects/Container/removeChildren.md:
--------------------------------------------------------------------------------
1 | ## removeChildren
2 |
3 | ### Description
4 |
5 | The `removeChildren` method allows you to remove all child objects from a parent container. This is helpful when you want to clear all elements within a container object, such as a frame, and start with a clean slate.
6 |
7 | ### Returns
8 |
9 | 1. `object` The object in use
10 |
11 | ### Usage
12 |
13 | ```lua
14 | local mainFrame = basalt.createFrame()
15 |
16 | -- Add some child objects to the frame
17 | mainFrame:addLabel("label1", "Hello", 5, 5)
18 | mainFrame:addButton("button1", "Click Me", 5, 10)
19 |
20 | -- Remove all child objects from the frame
21 | mainFrame:removeChildren()
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/Container/sortElementOrder.md:
--------------------------------------------------------------------------------
1 | ## sortElementOrder
2 |
3 | ### Description
4 |
5 | This function is called internally and automatically after objects are added or removed from the container. It sorts all objects by their z-index and the time they were added, ensuring the correct order is maintained. This is essential for proper event handling and drawing order of objects within the container.
6 |
7 | As a user, you don't need to call this function directly, as it's automatically taken care of by the library.
8 |
9 | ### Usage
10 |
11 | No direct usage example is provided since this function is called automatically by the library when needed.
12 |
--------------------------------------------------------------------------------
/docs/objects/Dropdown/clear.md:
--------------------------------------------------------------------------------
1 | ## clear
2 | Removes all items.
3 |
4 | #### Returns:
5 | 1. `object` The object in use
6 |
7 | #### Usage:
8 | * Creates a default dropdown with 3 entries and removes them immediatley. Which makes no sense.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aDropdown = mainFrame:addDropdown()
12 | aDropdown:addItem("1. Entry")
13 | aDropdown:addItem("2. Entry",colors.yellow)
14 | aDropdown:addItem("3. Entry",colors.yellow,colors.green)
15 | aDropdown:clear()
16 | ```
--------------------------------------------------------------------------------
/docs/objects/Dropdown/getAll.md:
--------------------------------------------------------------------------------
1 | ## getAll
2 | Returns all items as table
3 |
4 | #### Returns:
5 | 1. `table` All items
6 |
7 | #### Usage:
8 | * Creates a default menubar with 3 entries and prints a table.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aDropdown = mainFrame:addDropdown()
12 | aDropdown:addItem("1. Entry")
13 | aDropdown:addItem("2. Entry",colors.yellow)
14 | aDropdown:addItem("3. Entry",colors.yellow,colors.green)
15 | basalt.debug(aDropdown:getAll())
16 | ```
--------------------------------------------------------------------------------
/docs/objects/Dropdown/getItem.md:
--------------------------------------------------------------------------------
1 | ## getItem
2 | Returns a item by index
3 |
4 | #### Parameters:
5 | 1. `number` The index which should be returned
6 |
7 | #### Returns:
8 | 1. `table` The item table example: {text="1. Entry", bgCol=colors.black, fgCol=colors.white}
9 |
10 | #### Usage:
11 | * Creates a default dropdown with 3 entries and edits the second one.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aDropdown = mainFrame:addDropdown()
15 | aDropdown:addItem("1. Entry")
16 | aDropdown:addItem("2. Entry",colors.yellow)
17 | aDropdown:addItem("3. Entry",colors.yellow,colors.green)
18 | basalt.debug(aDropdown:getItem(2).text)
19 | ```
--------------------------------------------------------------------------------
/docs/objects/Dropdown/getItemCount.md:
--------------------------------------------------------------------------------
1 | ## getItemCount
2 | Returns the current item count
3 |
4 | #### Returns:
5 | 1. `number` The item list count
6 |
7 | #### Usage:
8 | * Creates a default dropdown with 3 entries and prints the current item count.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aDropdown = mainFrame:addDropdown()
12 | aDropdown:addItem("1. Entry")
13 | aDropdown:addItem("2. Entry",colors.yellow)
14 | aDropdown:addItem("3. Entry",colors.yellow,colors.green)
15 | basalt.debug(aDropdown:getItemCount())
16 | ```
--------------------------------------------------------------------------------
/docs/objects/Dropdown/getItemIndex.md:
--------------------------------------------------------------------------------
1 | ## getItemIndex
2 | returns the item index of the currently selected item
3 |
4 | #### Returns:
5 | 1. `number` The current index
6 |
7 | #### Usage:
8 | * Creates a default dropdown with 3 entries selects the second entry and prints the currently selected index.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aDropdown = mainFrame:addDropdown()
12 | aDropdown:addItem("1. Entry")
13 | aDropdown:addItem("2. Entry",colors.yellow)
14 | aDropdown:addItem("3. Entry",colors.yellow,colors.green)
15 | aDropdown:selectItem(2)
16 | basalt.debug(aDropdown:getItemIndex())
17 | ```
--------------------------------------------------------------------------------
/docs/objects/Dropdown/getOffset.md:
--------------------------------------------------------------------------------
1 | ## getOffset
2 | Returns the current index offset
3 |
4 | #### Returns:
5 | 1. `number` offset value
6 |
7 | #### Usage:
8 | * Creates a default dropdown with 6 entries and sets the offset to 3, also prints the current offset.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aDropdown = mainFrame:addDropdown()
12 | :addItem("1. Entry")
13 | :addItem("2. Entry")
14 | :addItem("3. Entry")
15 | :addItem("4. Entry")
16 | :addItem("5. Entry")
17 | :addItem("6. Entry")
18 | :setOffset(3)
19 | basalt.debug(aDropdown:getOffset())
20 | ```
--------------------------------------------------------------------------------
/docs/objects/Dropdown/removeItem.md:
--------------------------------------------------------------------------------
1 | ## removeItem
2 | Removes a item from the dropdown
3 |
4 | #### Parameters:
5 | 1. `number` The index which should get removed
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default dropdown with 3 entries and removes the second one.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aDropdown = mainFrame:addDropdown()
15 | aDropdown:addItem("1. Entry")
16 | aDropdown:addItem("2. Entry",colors.yellow)
17 | aDropdown:addItem("3. Entry",colors.yellow,colors.green)
18 | aDropdown:removeItem(2)
19 | ```
--------------------------------------------------------------------------------
/docs/objects/Dropdown/selectItem.md:
--------------------------------------------------------------------------------
1 | ## selectItem
2 | selects a item in the dropdown (same as a player would click on a item)
3 |
4 | #### Parameters:
5 | 1. `number` The index which should get selected
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default dropdown with 3 entries and selects the second entry.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aDropdown = mainFrame:addDropdown()
15 | aDropdown:addItem("1. Entry")
16 | aDropdown:addItem("2. Entry",colors.yellow)
17 | aDropdown:addItem("3. Entry",colors.yellow,colors.green)
18 | aDropdown:selectItem(2)
19 | ```
--------------------------------------------------------------------------------
/docs/objects/Dropdown/setDropdownSize.md:
--------------------------------------------------------------------------------
1 | ## setDropdownSize
2 |
3 | ### Description
4 |
5 | Sets the width and height of the dropdown menu for a Dropdown object.
6 |
7 | ### Parameters
8 |
9 | 1. `width`
10 |
11 | 2. `height`
12 |
13 | ### Returns
14 |
15 | 1. `object` The object in use
16 |
17 | #### Usage
18 |
19 | ```lua
20 | local main = basalt.createFrame()
21 | local aDropdown = main:addDropdown()
22 | aDropdown:setDropdownSize(10, 5)
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/Flexbox/getDirection.md:
--------------------------------------------------------------------------------
1 | ## getDirection
2 |
3 | ### Description
4 |
5 | Returns the current direction in which the child objects are arranged within the Flexbox.
6 |
7 | ### Returns
8 |
9 | 1. `string` The direction in which the child objects are arranged. Possible values are: row, column.
10 |
11 | ### Usage
12 |
13 | * Creates a default Flexbox, sets the direction, and then retrieves it.
14 |
15 | ```lua
16 | local main = basalt.createFrame()
17 | local flexbox = mainFrame:addFlexbox()
18 | :setDirection("column")
19 | local direction = flexbox:getDirection() -- returns "column"
20 | ```
21 |
--------------------------------------------------------------------------------
/docs/objects/Flexbox/getSpacing.md:
--------------------------------------------------------------------------------
1 | ## getSpacing
2 |
3 | ### Description
4 |
5 | Returns the space between objects
6 |
7 | ### Returns
8 |
9 | 1. `number` Number of pixels of spacing between each object
10 |
11 | ### Usage
12 |
13 | * Creates a default flexbox and prints the default spacing.
14 |
15 | ```lua
16 | local main = basalt.createFrame()
17 | local flexbox = mainFrame:addFlexbox()
18 | basalt.debug(flexbox:getSpacing())
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/objects/Flexbox/getWrap.md:
--------------------------------------------------------------------------------
1 | ## getWrap
2 |
3 | ### Description
4 |
5 | Returns the current setting for whether the child objects should wrap onto the next line if there isn't enough room on the main axis within the Flexbox.
6 |
7 | ### Returns
8 |
9 | 1. `string` returns `nowrap` or `wrap`
10 |
11 | ### Usage
12 |
13 | * Creates a default Flexbox, sets the wrap, and then retrieves it.
14 |
15 | ```lua
16 | local main = basalt.createFrame()
17 | local flexbox = mainFrame:addFlexbox()
18 | :setWrap("wrap")
19 | local wrapSetting = flexbox:getWrap() -- returns wrap
20 | ```
21 |
--------------------------------------------------------------------------------
/docs/objects/Flexbox/setDirection.md:
--------------------------------------------------------------------------------
1 | ## setDirection
2 |
3 | ### Description
4 |
5 | Sets the direction in which the children will be placed
6 |
7 | ### Parameters
8 |
9 | 1. `string` One of ("row", "column") - default is row
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a default flexbox and sets the flex direction to column.
18 |
19 | ```lua
20 | local main = basalt.createFrame()
21 | local flexbox = mainFrame:addFlexbox()
22 | :setDirection("column")
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/Flexbox/setSpacing.md:
--------------------------------------------------------------------------------
1 | ## setSpacing
2 |
3 | ### Description
4 |
5 | Sets the space between objects
6 |
7 | ### Parameters
8 |
9 | 1. `number` Number of pixels of spacing between each object - default is 1
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a default flexbox and sets the spacing to 5 pixels.
18 |
19 | ```lua
20 | local main = basalt.createFrame()
21 | local flexbox = mainFrame:addFlexbox()
22 | :setSpacing(5)
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/Frame/addLayout.md:
--------------------------------------------------------------------------------
1 | ## addLayout
2 | Adds a new XML Layout into your frame.
3 |
4 | #### Parameters:
5 | 1. `string` Path to your layout
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Creates a new base frame and adds the mainframe.xml layout
12 | ```lua
13 | local myFrame = basalt.createFrame():addLayout("mainframe.xml")
14 | ```
15 | ```xml
16 |
17 | ```
--------------------------------------------------------------------------------
/docs/objects/Frame/addLayoutFromString.md:
--------------------------------------------------------------------------------
1 | ## addLayoutFromString
2 | Adds a new XML Layout as string into your frame.
3 |
4 | #### Parameters:
5 | 1. `string` xml
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Creates a new base frame and adds the mainframe.xml layout
12 | ```lua
13 | local myFrame = basalt.createFrame():addLayoutFromString("")
14 | ```
--------------------------------------------------------------------------------
/docs/objects/Frame/addObject.md:
--------------------------------------------------------------------------------
1 | ## add<Object>
2 | Adds a new object. Don't use add<Object> please use addTheObjectYouNeed. For example if you want a new Frame, use
3 | addFrame, if you want to add a button, use addButton.
4 |
5 | #### Parameters:
6 | 1. `string` optional - the id if you don't add a id it will automatically generate one for you
7 |
8 | #### Returns:
9 | 1. `object` The new object you've created
10 |
11 | #### Usage:
12 | * Creates some example objects
13 | ```lua
14 | local main = basalt.createFrame()
15 | local button = main:addButton()
16 | local label = main:addLabel()
17 | local frame = main:addFrame()
18 | ```
19 |
--------------------------------------------------------------------------------
/docs/objects/Frame/getFocusedObject.md:
--------------------------------------------------------------------------------
1 | ## getFocusedObject
2 | Gets the currently focused object
3 |
4 | #### Returns:
5 | 1. `object` The currently focused object
6 |
7 | #### Usage:
8 | * Gets the currently focused object from the frame, storing it in a variable
9 | ```lua
10 | local focusedObject = myFrame:getFocusedObject()
11 | ```
--------------------------------------------------------------------------------
/docs/objects/Frame/getLastLayout.md:
--------------------------------------------------------------------------------
1 | ## getLastLayout
2 | returns a table of all objects this frame has created via xml (useful if you'd like to access all of them for some reason)
3 |
4 | #### Returns:
5 | 1. `table` table with objects
--------------------------------------------------------------------------------
/docs/objects/Frame/getObject.md:
--------------------------------------------------------------------------------
1 | ## getObject
2 | Returns a child object of the frame
3 |
4 | #### Parameters:
5 | 1. `string` The name of the child object
6 |
7 | #### Returns:
8 | 1. `object | nil` The object with the supplied name, or `nil` if there is no object present with the given name
9 |
10 | #### Usage:
11 | * Adds a button with id "myFirstButton", then retrieves it again through the frame object
12 | ```lua
13 | myFrame:addButton("myFirstButton")
14 | local aButton = myFrame:getObject("myFirstButton")
15 | ```
--------------------------------------------------------------------------------
/docs/objects/Frame/getOffset.md:
--------------------------------------------------------------------------------
1 | ## getOffset
2 |
3 | ### Description
4 |
5 | Returns the current offset
6 |
7 | ### Returns
8 |
9 | 1. `x` the x coordinate
10 | 2. `y` the y coordinate
11 |
12 | ### Usage
13 |
14 | * Returns the offset coordinates
15 |
16 | ```lua
17 | local myFrame = basalt.createFrame():setOffset(5, 3)
18 |
19 | basalt.debug(myFrame:getOffset())
20 | ```
21 |
--------------------------------------------------------------------------------
/docs/objects/Frame/removeFocusedObject.md:
--------------------------------------------------------------------------------
1 | ## removeFocusedObject
2 | Removes the currently focused object of that frame
3 |
4 | #### Returns:
5 | 1. `frame` The frame being used
6 |
7 | #### Usage:
8 | * Creates a new button then removes the focus from that button when clicking on it
9 | ```lua
10 | local main = basalt.createFrame()
11 | local input = main:addInput():setFocus()
12 | local aButton = main:addButton():onClick(function()
13 | main:removeFocusedObject()
14 | end)
15 | ```
--------------------------------------------------------------------------------
/docs/objects/Frame/removeObject.md:
--------------------------------------------------------------------------------
1 | ## removeObject
2 | Removes a child object from the frame
3 |
4 | #### Parameters:
5 | 1. `string|object` The name of the child object or the object itself
6 |
7 | #### Returns:
8 | 1. `boolean` Whether the object with the given name was properly removed
9 |
10 | #### Usage:
11 | * Adds a button with the id "myFirstButton", then removes it with the aforementioned id
12 | ```lua
13 | local main = basalt.createFrame()
14 | main:addButton("myFirstButton"):setText("Close")
15 | :onClick(function(self)
16 | main:removeObject("myFirstButton") -- or main:removeObject(self)
17 | end)
18 | ```
--------------------------------------------------------------------------------
/docs/objects/Frame/setBarTextAlign.md:
--------------------------------------------------------------------------------
1 | ## setBarTextAlign
2 | Sets the frame's bar-text alignment
3 |
4 | #### Parameters:
5 | 1. `string` Can be supplied with "left", "center", or "right"
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Set the title of myFrame to "My first frame!", and align it to the right.
12 | ```lua
13 | myFrame:setBar("My first Frame!"):setBarTextAlign("right")
14 | ```
15 | ```xml
16 |
17 | ```
--------------------------------------------------------------------------------
/docs/objects/Frame/setFocusedObject.md:
--------------------------------------------------------------------------------
1 | ## setFocusedObject
2 | Sets the currently focused object
3 |
4 | #### Parameters:
5 | 1. `object` The child object to focus on
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Creates a new button, sets the focused object to the previously mentioned button
12 | ```lua
13 | local aButton = myFrame:addButton()
14 | myFrame:setFocusedObject(aButton)
15 | ```
--------------------------------------------------------------------------------
/docs/objects/Frame/setMirror.md:
--------------------------------------------------------------------------------
1 | ## setMirror
2 | mirrors this frame to another peripheral monitor object.
3 |
4 | #### Parameters:
5 | 1. `string` The monitor name ("right", "left",... "monitor_1", "monitor_2",...)
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Creates mirror of your main frame to a monitor on the left side.
12 | ```lua
13 | local mainFrame = basalt.createFrame():setMirror("left")
14 | ```
15 | ```xml
16 |
17 | ```
--------------------------------------------------------------------------------
/docs/objects/Frame/setMonitorScale.md:
--------------------------------------------------------------------------------
1 | ## setMonitorScale
2 | Changes the scale on the the monitor which the frame is attached to
3 |
4 | #### Parameters:
5 | 1. `number` A number from 0.5 to 5
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Creates a new base frame, sets the frame as a monitor frame and changes the monitor scale
12 | ```lua
13 | local myFrame = basalt.createFrame()setMonitor("left"):setMonitorScale(2)
14 | myFrame:addLabel("Monitor scale is bigger")
15 | ```
16 |
--------------------------------------------------------------------------------
/docs/objects/Frame/setMovable.md:
--------------------------------------------------------------------------------
1 | ## setMovable
2 | Sets whether the frame can be moved. _In order to move the frame click and drag the upper bar of the frame_
3 |
4 | #### Parameters:
5 | 1. `boolean` Whether the object is movable
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Creates a frame with id "myFirstFrame" and makes it movable
12 | ```lua
13 | local myFrame = basalt.createFrame():setMovable(true)
14 | ```
15 | ```xml
16 |
17 | ```
--------------------------------------------------------------------------------
/docs/objects/Frame/setScrollAmount.md:
--------------------------------------------------------------------------------
1 | ## setScrollAmount
2 | Sets the maximum offset it is allowed to scroll
3 |
4 | #### Parameters:
5 | 1. `number` maximum y offset
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Creates a new base frame and makes it scrollable and sets the maximum amount to 25
12 | ```lua
13 | local myFrame = basalt.createFrame():setScrollable():setScrollAmount(25)
14 | ```
15 | ```xml
16 |
17 | ```
--------------------------------------------------------------------------------
/docs/objects/Frame/setScrollable.md:
--------------------------------------------------------------------------------
1 | ## setScrollable
2 | Makes the frame scrollable with mousewheel.
3 |
4 | #### Parameters:
5 | 1. `bool` scrollable or not
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Creates a new base frame and makes it scrollable
12 | ```lua
13 | local myFrame = basalt.createFrame():setScrollable()
14 | ```
15 | ```xml
16 |
17 | ```
--------------------------------------------------------------------------------
/docs/objects/Frame/showBar.md:
--------------------------------------------------------------------------------
1 | ## showBar
2 | Toggles the frame's upper bar
3 |
4 | #### Parameters:
5 | 1. `boolean | nil` Whether the frame's bar is visible or if supplied `nil`, is automatically visible
6 |
7 | #### Returns:
8 | 1. `frame` The frame being used
9 |
10 | #### Usage:
11 | * Sets myFrame to have a bar titled "Hello World!" and subsequently displays it.
12 | ```lua
13 | myFrame:setBar("Hello World!"):showBar()
14 | ```
15 | ```xml
16 |
17 | ```
--------------------------------------------------------------------------------
/docs/objects/Graph/Textdokument (neu).txt:
--------------------------------------------------------------------------------
1 | ## getMinValue
2 |
3 | ### Description
4 |
5 | Returns the current minimum value of the graph.
6 |
7 | ### Returns
8 |
9 | 1. `number` minValue - The current minimum value of the graph.
10 |
11 | ### Usage
12 |
13 | * Gets the minimum value of the graph
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aGraph = mainFrame:addGraph()
18 | local minValue = aGraph:getMinValue()
19 | basalt.debug("Min value:", minValue)
20 | ```
21 |
--------------------------------------------------------------------------------
/docs/objects/Graph/addDataPoint.md:
--------------------------------------------------------------------------------
1 | ## addDataPoint
2 |
3 | ### Description
4 |
5 | Sets a data point in the graph with specified value.
6 |
7 | ### Parameters
8 |
9 | 1. `number` value - The value of the data point. (0-100)
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Sets a data point in the graph
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aGraph = mainFrame:addGraph()
22 | aGraph:addDataPoint(13)
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/Graph/getGraphSymbol.md:
--------------------------------------------------------------------------------
1 | ## getGraphSymbol
2 |
3 | ### Description
4 |
5 | Returns the current symbol used for the graph.
6 |
7 | ### Returns
8 |
9 | 1. `string` graphSymbol - The symbol used for the graph line.
10 |
11 | ### Usage
12 |
13 | * Gets the graph symbol
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aGraph = mainFrame:addGraph()
18 | local graphSymbol = aGraph:getGraphSymbol()
19 | basalt.debug(graphSymbol)
20 | ```
21 |
--------------------------------------------------------------------------------
/docs/objects/Graph/getMaxEntries.md:
--------------------------------------------------------------------------------
1 | ## getMaxEntries
2 |
3 | ### Description
4 |
5 | Returns the maximum number of data points that can be stored in the graph.
6 |
7 | ### Returns
8 |
9 | 1. `number` maxEntries - The maximum number of data points
10 |
11 | ### Usage
12 |
13 | * Gets the maximum number of data points in the graph
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aGraph = mainFrame:addGraph():setMaxEntries(100)
18 | local maxEntries = aGraph:getMaxEntries()
19 | basalt.debug(maxEntries)
20 | ```
21 |
--------------------------------------------------------------------------------
/docs/objects/Graph/getMaxValue.md:
--------------------------------------------------------------------------------
1 | ## getMaxValue
2 |
3 | ### Description
4 |
5 | Returns the current maximum value of the graph.
6 |
7 | ### Returns
8 |
9 | 1. `number` maxValue - The current maximum value of the graph.
10 |
11 | ### Usage
12 |
13 | * Gets the maximum value of the graph
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aGraph = mainFrame:addGraph()
18 | local maxValue = aGraph:getMaxValue()
19 | basalt.debug("Max value:", maxValue)
20 | ```
21 |
--------------------------------------------------------------------------------
/docs/objects/Graph/setGraphColor.md:
--------------------------------------------------------------------------------
1 | ## setGraphColor
2 |
3 | ### Description
4 |
5 | Sets the color of the graph symbol.
6 |
7 | ### Parameters
8 |
9 | 1. `number` color - The color you want to set for the graph line.
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Sets the color of the graph line:
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aGraph = mainFrame:addGraph()
22 | aGraph:setGraphColor(colors.blue)
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/Graph/setGraphSymbol.md:
--------------------------------------------------------------------------------
1 | ## setGraphSymbol
2 |
3 | ### Description
4 |
5 | Sets the symbol used for the graph.
6 |
7 | ### Parameters
8 |
9 | 1. `string` symbol - The symbol to be used for the graph.
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Sets the graph symbol to "X"
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aGraph = mainFrame:addGraph():setGraphSymbol("X")
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/Graph/setGraphType.md:
--------------------------------------------------------------------------------
1 | ## setGraphType
2 |
3 | ### Description
4 |
5 | Sets the type of the graph to scatter, line, or bar. Default: line.
6 |
7 | ### Parameters
8 |
9 | 1. `number` graphType - The type of the graph ("scatter", "line", or "bar").
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Sets the graph type to a line graph
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aGraph = mainFrame:addGraph():setGraphType("scatter")
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/Graph/setMaxEntries.md:
--------------------------------------------------------------------------------
1 | ## setMaxEntries
2 |
3 | ### Description
4 |
5 | Sets the maximum number of data points that can be stored in the graph.
6 |
7 | ### Parameters
8 |
9 | 1. `number` maxEntries - The maximum number of data points
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Sets the maximum number of data points in the graph
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aGraph = mainFrame:addGraph()
22 | aGraph:setMaxEntries(100)
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/Graph/setMaxValue.md:
--------------------------------------------------------------------------------
1 | ## setMaxValue
2 |
3 | ### Description
4 |
5 | Sets the maximum value for the graph.
6 |
7 | ### Parameters
8 |
9 | 1. `number` maxValue - The maximum value for the graph.
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Sets the maximum value for the graph to 100
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aGraph = mainFrame:addGraph():setMaxValue(100)
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/Graph/setMinValue.md:
--------------------------------------------------------------------------------
1 | ## setMinValue
2 |
3 | ### Description
4 |
5 | Sets the minimum value for the graph.
6 |
7 | ### Parameters
8 |
9 | 1. `number` minValue - The minimum value for the graph.
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Sets the minimum value for the graph to 10
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aGraph = mainFrame:addGraph():setMinValue(10)
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/Image/clear.md:
--------------------------------------------------------------------------------
1 | ## clear
2 |
3 | ### Description
4 |
5 | Clears all frames from the image object.
6 |
7 | ### Returns
8 |
9 | 1. `object` The object in use
10 |
11 | ### Usage
12 |
13 | * Creates a new image object, loads a bimg image, and clears all frames.
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aImage = mainFrame:addImage():loadImage("test.bimg")
18 | aImage:clear()
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/objects/Image/getActiveFrame.md:
--------------------------------------------------------------------------------
1 | ## getActiveFrame
2 |
3 | ### Description
4 |
5 | Returns the index of the currently active frame in the image object.
6 |
7 | ### Returns
8 |
9 | 1. `number` The index of the currently active frame in the image object.
10 |
11 | ### Usage
12 |
13 | * Creates a new image object, loads a bimg image, and retrieves the index of the active frame.
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aImage = mainFrame:addImage():loadImage("test.bimg")
18 | local activeFrame = aImage:getActiveFrame()
19 | basalt.debug(activeFrame)
20 | ```
21 |
--------------------------------------------------------------------------------
/docs/objects/Image/getFrame.md:
--------------------------------------------------------------------------------
1 | ## getFrame
2 |
3 | ### Description
4 |
5 | Retrieves a frame from the image object at the specified index.
6 |
7 | ### Parameters
8 |
9 | 1. `number` index - The index of the frame to retrieve.
10 |
11 | ### Returns
12 |
13 | 1. `table` The frame at the specified index in bimg format.
14 |
15 | ### Usage
16 |
17 | * Creates a new image object, loads a bimg image, and retrieves the frame at index 2.
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aImage = mainFrame:addImage():loadImage("test.bimg")
22 | local frame = aImage:getFrame(2)
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/Image/getFrameCount.md:
--------------------------------------------------------------------------------
1 | ## getFrameCount
2 |
3 | ### Description
4 |
5 | Returns the total number of frames in the image object.
6 |
7 | ### Returns
8 |
9 | 1. `number` The total number of frames in the image object.
10 |
11 | ### Usage
12 |
13 | * Creates a new image object, loads a bimg image, and retrieves the frame count
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aImage = mainFrame:addImage():loadImage("test.bimg")
18 | local frameCount = aImage:getFrameCount()
19 | basalt.debug(frameCount)
20 | ```
21 |
--------------------------------------------------------------------------------
/docs/objects/Image/getFrames.md:
--------------------------------------------------------------------------------
1 | ## getFrames
2 |
3 | ### Description
4 |
5 | Retrieves a table containing all the frames in the image object..
6 |
7 | ### Returns
8 |
9 | 1. `table` A table containing all the frames in the image object.
10 |
11 | ### Usage
12 |
13 | * Creates a new image object, loads a bimg image, and retrieves all the frames.
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aImage = mainFrame:addImage():loadImage("test.bimg")
18 | local frames = aImage:getFrames()
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/objects/Image/getImage.md:
--------------------------------------------------------------------------------
1 | ## getImage
2 |
3 | ### Description
4 |
5 | Returns the current image of the image object in its internal format. This is useful if you need to access the raw image data for manipulation or analysis purposes.
6 |
7 | ### Returns
8 |
9 | 1. `table` The current image in the image object
10 |
11 | ### Usage
12 |
13 | * Creates a new image object, loads an image, and gets the current image
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aImage = mainFrame:addImage():loadImage("test.bimg")
18 | local currentImage = aImage:getImage()
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/objects/Image/getImageSize.md:
--------------------------------------------------------------------------------
1 | ## getImageSize
2 |
3 | ### Description
4 |
5 | Returns the current image size
6 |
7 | ### Returns
8 |
9 | 1. `number` width - The current width of the image
10 | 2. `number` height - The current height of the image object
11 |
12 | ### Usage
13 |
14 | * Gets the size of an image and prints it
15 |
16 | ```lua
17 | local mainFrame = basalt.createFrame()
18 | local aImage = mainFrame:addImage():loadImage("test.nfp")
19 | local width, height = aImage:getImageSize()
20 | basalt.debug("Image width:", width, "Image height:", height)
21 | ```
22 |
--------------------------------------------------------------------------------
/docs/objects/Image/getMetadata.md:
--------------------------------------------------------------------------------
1 | ## getMetadata
2 |
3 | ### Description
4 |
5 | Returns the metadata set in the image
6 |
7 | ### Parameter
8 |
9 | 1. `string` the metadata key (for example: title, description, author, creator, data, width, height,...)
10 |
11 | ### Returns
12 |
13 | 1. `any` metadata value
14 |
15 | ### Usage
16 |
17 | * Load an image and get the metadata for the "title" key
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aImage = mainFrame:addImage():loadImage("test.bimg")
22 | local title = aImage:getMetadata("title")
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/Image/loadImage.md:
--------------------------------------------------------------------------------
1 | ## loadImage
2 |
3 | ### Description
4 |
5 | This method is used to load an image file into the image object.
6 |
7 | ### Parameters
8 |
9 | 1. `string` path - The absolute file path
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a default image and loads a test.nfp file
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aImage = mainFrame:addImage():loadImage("test.nfp")
22 | ```
23 |
24 | ```xml
25 |
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/objects/Image/play.md:
--------------------------------------------------------------------------------
1 | ## play
2 |
3 | ### Description
4 |
5 | Plays a bimg animation. This can only work if the bimg has more than 1 frame.
6 |
7 | ### Parameters
8 |
9 | 1. `boolean` If the image animation should play
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates an image and plays the animation.
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aImage = mainFrame:addImage():loadImage("animated_bimg.bimg"):play(true)
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/Image/removeFrame.md:
--------------------------------------------------------------------------------
1 | ## removeFrame
2 |
3 | ### Description
4 |
5 | Removes a frame from the image object at the specified index.
6 |
7 | ### Parameters
8 |
9 | 1. `number` index - The index of the frame to remove.
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a new image object, loads a bimg image, and removes the frame at index 2.
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aImage = mainFrame:addImage():loadImage("test.bimg")
22 | aImage:removeFrame(2)
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/Image/selectFrame.md:
--------------------------------------------------------------------------------
1 | ## selectFrame
2 |
3 | ### Description
4 |
5 | The selectFrame method allows you to change the current frame of an image object. It takes a single parameter, the index of the frame you want to display.
6 |
7 | ### Parameters
8 |
9 | 1. `number` the frame index
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a default image and loads a test.bimg file, then selects the second frame
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aImage = mainFrame:addImage():loadImage("test.bimg"):selectFrame(2)
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/Image/setImage.md:
--------------------------------------------------------------------------------
1 | ## setImage
2 |
3 | ### Description
4 |
5 | Sets a new image
6 |
7 | ### Parameter
8 |
9 | 1. `table` A table in bimg or nfp format.
10 | 1. `string` The format in which the image should be loaded (nfp or bimg)
11 |
12 | ### Usage
13 |
14 | * Creates a default image and loads a test.nfp
15 |
16 | ```lua
17 | local mainFrame = basalt.createFrame()
18 |
19 | local bimg = {
20 | [1] = {
21 | {"Hello", "fffff", "33333"}
22 | }
23 | }
24 |
25 | local aImage = mainFrame:addImage():setImage(bimg)
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/objects/Image/setImageSize.md:
--------------------------------------------------------------------------------
1 | ## setImageSize
2 |
3 | ### Description
4 |
5 | Sets the size of the image object. This can be useful when you need to scale an image to fit a specific area.
6 |
7 | ### Parameters
8 |
9 | 1. `number` width - The desired width of the image object
10 | 2. `number` height - The desired height of the image object
11 |
12 | ### Returns
13 |
14 | 1. `object` The object in use
15 |
16 | ### Usage
17 |
18 | * Creates an image and sets its size to 10x5
19 |
20 | ```lua
21 | local mainFrame = basalt.createFrame()
22 | local aImage = mainFrame:addImage():loadImage("test.nfp"):setImageSize(10, 5)
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/Image/usePalette.md:
--------------------------------------------------------------------------------
1 | ## usePalette
2 |
3 | ### Description
4 |
5 | Changes the palette colors of the image, if the bimg image has palette metadata.
6 |
7 | ### Parameter
8 |
9 | 1. `boolean` if the image should change the palette
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates an image and enables the use of the palette.
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aImage = mainFrame:addImage():loadImage("test_with_palette.bimg"):usePalette(true)
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/Input/getInputLimit.md:
--------------------------------------------------------------------------------
1 | ## getInputLimit
2 |
3 | ### Description
4 |
5 | Returns the character limit set for the Input object.
6 |
7 | ### Returns
8 |
9 | 1. `number` character limit
10 |
11 | ### Usage
12 |
13 | * Creates a default input and sets the character limit to 8. Prints the current limit.
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aInput = mainFrame:addInput():setInputLimit(8)
18 | basalt.debug(aInput:getInputLimit())
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/objects/Input/getInputType.md:
--------------------------------------------------------------------------------
1 | ## getInputType
2 |
3 | ### Description
4 |
5 | Gets the current input type of the Input object.
6 |
7 | ### Returns
8 |
9 | 1. `string` inputType - The current input type.
10 |
11 | ### Usage
12 |
13 | * Creates a default input, sets it to accept numbers only, and prints the current input type to the log.
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aInput = mainFrame:addInput():setInputType("number")
18 | basalt.debug(aInput:getInputType())
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/objects/Input/getOffset.md:
--------------------------------------------------------------------------------
1 | ## getOffset
2 |
3 | ### Description
4 |
5 | Returns the current offset
6 |
7 | ### Returns
8 |
9 | 1. `number` the offset
10 |
--------------------------------------------------------------------------------
/docs/objects/Input/getTextOffset.md:
--------------------------------------------------------------------------------
1 | ## getTextOffset
2 |
3 | ### Description
4 |
5 | Returns the current text offset
6 |
7 | ### Returns
8 |
9 | 1. `number` the text offset
10 |
--------------------------------------------------------------------------------
/docs/objects/Input/setInputLimit.md:
--------------------------------------------------------------------------------
1 | ## setInputLimit
2 |
3 | ### Description
4 |
5 | Sets a character limit for the Input object, restricting the number of characters that can be entered.
6 |
7 | ### Parameters
8 |
9 | 1. `number` characterLimit - The maximum number of characters allowed.
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a default input and sets the character limit to 8.
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aInput = mainFrame:addInput():setInputLimit(8)
22 | ```
23 |
24 | ```xml
25 |
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/objects/Input/setInputType.md:
--------------------------------------------------------------------------------
1 | ## setInputType
2 |
3 | ### Description
4 |
5 | Changes the input type of the Input object. The default input type is "text".
6 |
7 | ### Parameters
8 |
9 | 1. `string` inputType - The input type to set. Accepted values are "text", "password", and "number".
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a default input and sets it to numbers only.
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aInput = mainFrame:addInput():setInputType("number")
22 | ```
23 |
24 | ```xml
25 |
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/objects/Input/setOffset.md:
--------------------------------------------------------------------------------
1 | ## setOffset
2 |
3 | ### Description
4 |
5 | Sets the input offset
6 |
7 | ### Parameters
8 |
9 | 1. `number` offset - The offset you want it to be
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a default input and changes the offset to 2
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aInput = mainFrame:addInput():setOffset(2)
22 | ```
--------------------------------------------------------------------------------
/docs/objects/Input/setTextOffset.md:
--------------------------------------------------------------------------------
1 | ## setTextOffset
2 |
3 | ### Description
4 |
5 | Sets the input text offset
6 |
7 | ### Parameters
8 |
9 | 1. `number` text offset - The offset you want it to be
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a default input and changes the text offset to 2
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aInput = mainFrame:addInput():setTextOffset(2)
22 | ```
--------------------------------------------------------------------------------
/docs/objects/Label/getFontSize.md:
--------------------------------------------------------------------------------
1 | ## getFontSize
2 |
3 | ### Description
4 |
5 | Returns the current font size
6 |
7 | ### Returns
8 |
9 | 1. `number` font size
10 |
11 | ### Usage
12 |
13 | * Creates a default label, sets the text to "Basalt!" and its font size to 2. Also prints the current fontsize.
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aLabel = mainFrame:addLabel():setText("Basalt!"):setFontSize(2)
18 | basalt.debug(aLabel:getFontSize())
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/objects/Label/setFontSize.md:
--------------------------------------------------------------------------------
1 | ## setFontSize
2 |
3 | ### Description
4 |
5 | Sets the font size for the Label object, calculated by bigfonts. Default size is 1.
6 |
7 | ### Parameters
8 |
9 | 1. `number` The size (1, 2, 3, 4)
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a default label, sets the text to "Basalt!" and its font size to 2.
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aLabel = mainFrame:addLabel():setText("Basalt!"):setFontSize(2)
22 | ```
23 |
24 | ```xml
25 |
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/objects/Label/setText.md:
--------------------------------------------------------------------------------
1 | ## setText
2 |
3 | Sets the text which gets displayed in the Label object.
4 |
5 | ### Parameters
6 |
7 | 1. `string` The text which should be displayed
8 |
9 | ### Returns
10 |
11 | 1. `object` The object in use
12 |
13 | ### Usage
14 |
15 | * Creates a default label with text "Some random text".
16 |
17 | ```lua
18 | local mainFrame = basalt.createFrame()
19 | local aLabel = mainFrame:addLabel():setText("Some random text")
20 | ```
21 |
22 | ```xml
23 |
24 | ```
25 |
--------------------------------------------------------------------------------
/docs/objects/Label/setTextAlign.md:
--------------------------------------------------------------------------------
1 | ## setTextAlign
2 |
3 | Sets the text alignment within the Label object. It can be left, center, or right aligned.
4 |
5 | ### Parameters
6 |
7 | 1. `string` The text alignment ("left", "center", "right")
8 |
9 | ### Returns
10 |
11 | 1. `object` The object in use
12 |
13 | ### Usage
14 |
15 | * Creates a default label with text "Some random text" and sets the text alignment to "center".
16 |
17 | ```lua
18 | local mainFrame = basalt.createFrame()
19 | local aLabel = mainFrame:addLabel():setText("Some random text"):setTextAlign("center")
20 | ```
21 |
22 | ```xml
23 |
24 | ```
25 |
--------------------------------------------------------------------------------
/docs/objects/List/clear.md:
--------------------------------------------------------------------------------
1 | ## clear
2 |
3 | ### Description
4 |
5 | Removes all items from the list.
6 |
7 | #### Returns
8 |
9 | 1. `object` The object in use
10 |
11 | ### Usage
12 |
13 | * Creates a default list with 3 entries and removes them immediately.
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aList = mainFrame:addList()
18 | aList:addItem("1. Entry")
19 | aList:addItem("2. Entry", colors.yellow)
20 | aList:addItem("3. Entry", colors.yellow, colors.green)
21 | aList:clear()
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/List/getAll.md:
--------------------------------------------------------------------------------
1 | ## getAll
2 |
3 | ### Description
4 |
5 | Returns all items as a table.
6 |
7 | #### Returns
8 |
9 | 1. `table` All items
10 |
11 | ### Usage
12 |
13 | * Creates a default list with 3 entries and prints a table.
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aList = mainFrame:addList()
18 | aList:addItem("1. Entry")
19 | aList:addItem("2. Entry", colors.yellow)
20 | aList:addItem("3. Entry", colors.yellow, colors.green)
21 | basalt.debug(aList:getAll())
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/List/getItem.md:
--------------------------------------------------------------------------------
1 | ## getItem
2 |
3 | ### Description
4 |
5 | Returns an item by index.
6 |
7 | ### Parameters
8 |
9 | 1. `number` The index of the item to be returned
10 |
11 | #### Returns
12 |
13 | 1. `table` The item table, for example: {text="1. Entry", bgCol=colors.black, fgCol=colors.white, args={}}
14 |
15 | ### Usage
16 |
17 | * Creates a default list with 3 entries and retrieves the second one.
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aList = mainFrame:addList()
22 | aList:addItem("1. Entry")
23 | aList:addItem("2. Entry", colors.yellow)
24 | aList:addItem("3. Entry", colors.yellow, colors.green)
25 | basalt.debug(aList:getItem(2).text)
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/objects/List/getItemCount.md:
--------------------------------------------------------------------------------
1 | ## getItemCount
2 |
3 | ### Description
4 |
5 | Returns the current item count.
6 |
7 | #### Returns
8 |
9 | 1. `number` The item list count
10 |
11 | ### Usage
12 |
13 | * Creates a default list with 3 entries and prints the current item count.
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aList = mainFrame:addList()
18 | aList:addItem("1. Entry")
19 | aList:addItem("2. Entry", colors.yellow)
20 | aList:addItem("3. Entry", colors.yellow, colors.green)
21 | basalt.debug(aList:getItemCount())
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/List/getItemIndex.md:
--------------------------------------------------------------------------------
1 | ## getItemIndex
2 |
3 | ### Description
4 |
5 | Returns the item index of the currently selected item.
6 |
7 | #### Returns
8 |
9 | 1. `number` The current index
10 |
11 | ### Usage
12 |
13 | * Creates a default list with 3 entries and removes the second one.
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aList = mainFrame:addList()
18 | aList:addItem("1. Entry")
19 | aList:addItem("2. Entry", colors.yellow)
20 | aList:addItem("3. Entry", colors.yellow, colors.green)
21 | aList:selectItem(2)
22 | basalt.debug(aList:getItemIndex())
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/List/getOptions.md:
--------------------------------------------------------------------------------
1 | ## getOptions
2 |
3 | ### Description
4 |
5 | Returns all items as a table.
6 |
7 | #### Returns
8 |
9 | 1. `table` All items
10 |
11 | ### Usage
12 |
13 | * Creates a default list with 3 entries and prints a table.
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aList = mainFrame:addList()
18 | aList:addItem("1. Entry")
19 | aList:addItem("2. Entry", colors.yellow)
20 | aList:addItem("3. Entry", colors.yellow, colors.green)
21 | basalt.debug(aList:getOptions())
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/List/onSelect.md:
--------------------------------------------------------------------------------
1 | ## onSelect
2 |
3 | ### Description
4 |
5 | `onSelect(self, event, item)`
6 |
7 | The onSelect event is triggered when a item on the list gets selected.
8 |
9 | ### Returns
10 |
11 | 1. `object` The object in use
12 |
13 | ### Usage
14 |
15 | * Add an onSelect event to a list:
16 |
17 | ```lua
18 | local basalt = require("basalt")
19 |
20 | local main = basalt.createFrame()
21 | local list = main:addList()
22 |
23 | list:addItem("Entry 1")
24 | list:addItem("Entry 2")
25 |
26 | function listOnSelect(self, event, item)
27 | basalt.debug("Item got selected:", item.text)
28 | end
29 |
30 | list:onSelect(listOnSelect)
31 |
32 | basalt.autoUpdate()
33 | ```
34 |
--------------------------------------------------------------------------------
/docs/objects/List/removeItem.md:
--------------------------------------------------------------------------------
1 | ## removeItem
2 |
3 | ### Description
4 |
5 | Removes an item from the list.
6 |
7 | ### Parameters
8 |
9 | 1. `number` The index of the item to be removed
10 |
11 | #### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a default list with 3 entries and removes the second one.
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aList = mainFrame:addList()
22 | aList:addItem("1. Entry")
23 | aList:addItem("2. Entry", colors.yellow)
24 | aList:addItem("3. Entry", colors.yellow, colors.green)
25 | aList:removeItem(2)
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/objects/List/selectItem.md:
--------------------------------------------------------------------------------
1 | ## selectItem
2 |
3 | ### Description
4 |
5 | Selects an item in the list (same as a user would click on an item).
6 |
7 | ### Parameters
8 |
9 | 1. `number` The index of the item that should be selected
10 |
11 | #### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a default list with 3 entries and selects the second entry
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aList = mainFrame:addList()
22 | aList:addItem("1. Entry")
23 | aList:addItem("2. Entry", colors.yellow)
24 | aList:addItem("3. Entry", colors.yellow, colors.green)
25 | aList:selectItem(2)
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/objects/Menubar/clear.md:
--------------------------------------------------------------------------------
1 | ## clear
2 | Removes all items.
3 |
4 | #### Returns:
5 | 1. `object` The object in use
6 |
7 | #### Usage:
8 | * Creates a default menubar with 3 entries and removes them immediatley. Which makes no sense.
9 | ```lua
10 | local main = basalt.createFrame()
11 | local aMenubar = main:addMenubar()
12 | :addItem("1. Entry")
13 | :addItem("2. Entry",colors.yellow)
14 | :addItem("3. Entry",colors.yellow,colors.green)
15 | aMenubar:clear()
16 | ```
17 |
--------------------------------------------------------------------------------
/docs/objects/Menubar/getAll.md:
--------------------------------------------------------------------------------
1 | ## getAll
2 | Returns all items as table
3 |
4 | #### Returns:
5 | 1. `table` All items
6 |
7 | #### Usage:
8 | * Creates a default menubar with 3 entries and prints a table.
9 | ```lua
10 | local main = basalt.createFrame()
11 | local aMenubar = main:addMenubar()
12 | :addItem("1. Entry")
13 | :addItem("2. Entry",colors.yellow)
14 | :addItem("3. Entry",colors.yellow,colors.green)
15 | basalt.debug(aMenubar:getAll())
16 | ```
--------------------------------------------------------------------------------
/docs/objects/Menubar/getItem.md:
--------------------------------------------------------------------------------
1 | ## getItem
2 | Returns a item by index
3 |
4 | #### Parameters:
5 | 1. `number` The index which should be returned
6 |
7 | #### Returns:
8 | 1. `table` The item table example: {text="1. Entry", bgCol=colors.black, fgCol=colors.white}
9 |
10 | #### Usage:
11 | * Creates a default menubar with 3 entries and edits the second one.
12 | ```lua
13 | local main = basalt.createFrame()
14 | local aMenubar = main:addMeubar()
15 | :addItem("1. Entry")
16 | :addItem("2. Entry",colors.yellow)
17 | :addItem("3. Entry",colors.yellow,colors.green)
18 | basalt.debug(aMenubar:getItem(2).text)
19 | ```
--------------------------------------------------------------------------------
/docs/objects/Menubar/getItemCount.md:
--------------------------------------------------------------------------------
1 | ## getItemCount
2 | Returns the current item count
3 |
4 | #### Returns:
5 | 1. `number` The item list count
6 |
7 | #### Usage:
8 | * Creates a default menubar with 3 entries and prints the current item count.
9 | ```lua
10 | local main = basalt.createFrame()
11 | local aMenubar = main:addMenubar()
12 | :addItem("1. Entry")
13 | :addItem("2. Entry",colors.yellow)
14 | :addItem("3. Entry",colors.yellow,colors.green)
15 | basalt.debug(aMenubar:getItemCount())
16 | ```
--------------------------------------------------------------------------------
/docs/objects/Menubar/getItemIndex.md:
--------------------------------------------------------------------------------
1 | ## getItemIndex
2 | returns the item index of the currently selected item
3 |
4 | #### Returns:
5 | 1. `number` The current index
6 |
7 | #### Usage:
8 | * Creates a default menubar with 3 entries selects the second entry and prints the currently selected index.
9 | ```lua
10 | local main = basalt.createFrame()
11 | local aMenubar = main:addMenubar()
12 | :addItem("1. Entry")
13 | :addItem("2. Entry",colors.yellow)
14 | :addItem("3. Entry",colors.yellow,colors.green)
15 | :selectItem(2)
16 | basalt.debug(aMenubar:getItemIndex())
17 | ```
--------------------------------------------------------------------------------
/docs/objects/Menubar/getOffset.md:
--------------------------------------------------------------------------------
1 | ## getOffset
2 | Returns the current index offset
3 |
4 | #### Returns:
5 | 1. `number` offset value
6 |
7 | #### Usage:
8 | * Creates a default menubar with 6 entries and sets the offset to 3, also prints the current offset.
9 | ```lua
10 | local main = basalt.createFrame()
11 | local aMenubar = main:addMenubar()
12 | :addItem("1. Entry")
13 | :addItem("2. Entry")
14 | :addItem("3. Entry")
15 | :addItem("4. Entry")
16 | :addItem("5. Entry")
17 | :addItem("6. Entry")
18 | :addItem("7. Entry")
19 | :addItem("8. Entry")
20 | :setOffset(3)
21 | basalt.debug(aMenubar:getOffset())
22 | ```
--------------------------------------------------------------------------------
/docs/objects/Menubar/getSpace.md:
--------------------------------------------------------------------------------
1 | ## getSpace
2 |
3 | ### Description
4 |
5 | Returns the space between the entries in the menubar.
6 |
7 | ### Returns
8 |
9 | 1. `number` The space between the entries
10 |
11 | ### Usage
12 |
13 | * Creates a default menubar with 4 entries, sets the space between them to 3, and prints the current space.
14 |
15 | ```lua
16 | local main = basalt.createFrame()
17 | local aMenubar = main:addMenubar()
18 | :addItem("1. Entry")
19 | :addItem("2. Entry",colors.yellow)
20 | :addItem("3. Entry",colors.yellow,colors.green)
21 | :addItem("4. Entry")
22 | :setSpace(3)
23 | basalt.debug(aMenubar:getSpace())
24 | ```
25 |
--------------------------------------------------------------------------------
/docs/objects/Menubar/removeItem.md:
--------------------------------------------------------------------------------
1 | ## removeItem
2 | Removes a item from the menubar
3 |
4 | #### Parameters:
5 | 1. `number` The index which should get removed
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default menubar with 3 entries and removes the second one.
12 | ```lua
13 | local main = basalt.createFrame()
14 | local aMenubar = main:addMenubar()
15 | :addItem("1. Entry")
16 | :addItem("2. Entry",colors.yellow)
17 | :addItem("3. Entry",colors.yellow,colors.green)
18 | :removeItem(2)
19 | ```
--------------------------------------------------------------------------------
/docs/objects/Menubar/selectItem.md:
--------------------------------------------------------------------------------
1 | ## selectItem
2 | selects a item in the menubar (same as a player would click on a item)
3 |
4 | #### Parameters:
5 | 1. `number` The index which should get selected
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default menubar with 3 entries and selects the second entry.
12 | ```lua
13 | local main = basalt.createFrame()
14 | local aMenubar = main:addMenubar()
15 | :addItem("1. Entry")
16 | :addItem("2. Entry",colors.yellow)
17 | :addItem("3. Entry",colors.yellow,colors.green)
18 | :selectItem(2)
19 | ```
--------------------------------------------------------------------------------
/docs/objects/Object/disable.md:
--------------------------------------------------------------------------------
1 | ## enable
2 |
3 | ### Description
4 |
5 | Disables the object's event listeners
6 |
7 | If the object is enabled, it will listen to incoming events. Disabling it will stop listening to events.
8 |
9 | ### Returns
10 |
11 | 1. `object` The object in use
12 |
13 | ### Usage
14 |
15 | * Creates a default button and disables it, then re-enables it.
16 |
17 | ```lua
18 | local mainFrame = basalt.createFrame()
19 | local aButton = mainFrame:addButton():setText("Disabled Button")
20 | aButton:disable()
21 | ```
22 |
--------------------------------------------------------------------------------
/docs/objects/Object/enable.md:
--------------------------------------------------------------------------------
1 | ## enable
2 |
3 | ### Description
4 |
5 | Enables the object's event listeners
6 |
7 | If the object is disabled, it will stop listening to incoming events, this will reenable it.
8 |
9 | ### Returns
10 |
11 | 1. `object` The object in use
12 |
13 | ### Usage
14 |
15 | * Creates a default button and disables it, then re-enables it.
16 |
17 | ```lua
18 | local mainFrame = basalt.createFrame()
19 | local aButton = mainFrame:addButton():setText("Enabled Button")
20 | aButton:enable()
21 | ```
22 |
--------------------------------------------------------------------------------
/docs/objects/Object/getAbsolutePosition.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## getAbsolutePosition
4 |
5 | Converts the relative coordinates into absolute coordinates
6 |
7 | ### Parameters
8 |
9 | 1. `number|nil` x
10 | 2. `number|nil` y
11 |
12 | ### Returns
13 |
14 | 1. `object` The object in use
15 |
16 | ### Usage
17 |
18 | * Creates a frame and a button and prints the button's absolute position to the debug console
19 |
20 | ```lua
21 | local mainFrame = basalt.createFrame():setPosition(3,3)
22 | local aButton = mainFrame:addButton():setSize(8,1):setPosition(4,2)
23 | basalt.debug(aButton:getAbsolutePosition()) -- returns 7,5 (frame coords + own coords) instead of 4,2
24 | ```
25 |
--------------------------------------------------------------------------------
/docs/objects/Object/getBackground.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## getBackground
4 |
5 | Returns the current background color
6 |
7 | ### Returns
8 |
9 | 1. `number` color
10 |
--------------------------------------------------------------------------------
/docs/objects/Object/getForeground.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## getForeground
4 |
5 | Returns the current foreground color
6 |
7 | ### Returns
8 |
9 | 1. `number` color
10 |
--------------------------------------------------------------------------------
/docs/objects/Object/getName.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## getName
4 |
5 | Returns the name of the object
6 |
7 | ### Returns
8 |
9 | 1. `string` The name of the object, or a uuid if no name was assigned
10 |
11 | #### Usage
12 |
13 | * Prints name of object to debug window
14 |
15 | ```lua
16 | local main = basalt.createFrame()
17 | basalt.debug(main:getName()) -- returns a uuid
18 | ```
19 |
20 | ```lua
21 | local main = basalt.createFrame("myFirstMainFrame")
22 | basalt.debug(main:getName()) -- returns myFirstMainFrame
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/Object/getParent.md:
--------------------------------------------------------------------------------
1 | ## getParent
2 |
3 | ### Description
4 |
5 | Returns the parent of the object
6 |
7 | This method is used to get the parent of the object, which is the object that contains it.
8 |
9 | ### Returns
10 |
11 | 1. `object` The parent object, or nil if the object has no parent
12 |
13 | ### Usage
14 |
15 | * Creates a default frame with a button and gets the parent of the button.
16 |
17 | ```lua
18 | local mainFrame = basalt.createFrame()
19 | local aButton = mainFrame:addButton():setText("My Button")
20 | local parent = aButton:getParent()
21 | basalt.debug(parent) -- The parent object (mainFrame) will be output
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/Object/getPosition.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## getPosition
4 |
5 | Returns the object's position
6 |
7 | ### Returns
8 |
9 | 1. `number` x
10 | 2. `number` y
11 |
--------------------------------------------------------------------------------
/docs/objects/Object/getSize.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## getSize
4 |
5 | Returns the object's size
6 |
7 | ### Returns
8 |
9 | 1. `number` w
10 | 2. `number` h
11 |
--------------------------------------------------------------------------------
/docs/objects/Object/getType.md:
--------------------------------------------------------------------------------
1 | ## getType
2 |
3 | ### Description
4 |
5 | Returns the type of the object
6 |
7 | This method is used to get the type of the object, such as 'Button', 'Label', 'List', etc.
8 |
9 | ### Returns
10 |
11 | 1. `object` The type of the object
12 |
13 | ### Usage
14 |
15 | * Creates a default button and prints its type.
16 |
17 | ```lua
18 | local mainFrame = basalt.createFrame()
19 | local aButton = mainFrame:addButton():setText("My Button")
20 | basalt.debug(aButton:getType())
21 | ```
22 |
--------------------------------------------------------------------------------
/docs/objects/Object/getValue.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## getValue
4 |
5 | Returns the currently saved value
6 |
7 | ### Returns
8 |
9 | 1. `any` Object's value
10 |
11 | ### Usage
12 |
13 | * Prints the value of the checkbox to the debug console
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aCheckbox = mainFrame:addCheckbox():setValue(true)
18 | basalt.debug(aCheckbox:getValue()) -- returns true
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/objects/Object/getZIndex.md:
--------------------------------------------------------------------------------
1 | ## getZIndex
2 |
3 | ### Description
4 |
5 | Returns the Z-index of the object
6 |
7 | The Z-index determines the order of overlapping objects. Objects with higher Z-index values will be displayed above objects with lower Z-index values.
8 |
9 | ### Returns
10 |
11 | 1. `object` The current Z-index value
12 |
13 | ### Usage
14 |
15 | * Creates a default button and gets its Z-index value.
16 |
17 | ```lua
18 | local mainFrame = basalt.createFrame()
19 | local aButton = mainFrame:addButton():setText("My Button")
20 | local zIndex = aButton:getZIndex()
21 | basalt.debug(zIndex) -- Prints the Z-index value
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/Object/hide.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## hide
4 |
5 | Hides the object
6 |
7 | ### Returns
8 |
9 | 1. `object` The object in use
10 |
11 | #### Usage
12 |
13 | * Hides a frame
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local button = mainFrame:addButton():setText("Close"):onClick(function() mainFrame:hide() end)
18 | ```
19 |
20 | ```xml
21 |
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/Object/isFocused.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## isFocused
4 |
5 | Returns if the object is currently the focused object of the parent frame
6 |
7 | ### Returns
8 |
9 | 1. `boolean` Whether the object is focused
10 |
11 | #### Usage
12 |
13 | * Prints whether the button is focused to the debug console
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aButton = mainFrame:addButton()
18 | basalt.debug(aButton:isFocused()) -- shows true or false as a debug message
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/objects/Object/isVisible.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## isVisible
4 |
5 | Returns if the object is currently visible
6 |
7 | ### Returns
8 |
9 | 1. `boolean`
10 |
11 | #### Usage
12 |
13 | * Prints boolean visibility of object to debug console
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aButton = mainFrame:addButton():setSize(5,8)
18 | basalt.debug(aButton:isVisible()) -- returns true
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/objects/Object/onChar.md:
--------------------------------------------------------------------------------
1 | ## onChar
2 |
3 | ### Description
4 |
5 | `onChar(self, event, char)`
6 |
7 | The onChar event is triggered when a character is typed on the keyboard.
8 |
9 | ### Returns
10 |
11 | 1. `object` The object in use
12 |
13 | ### Usage
14 |
15 | * Add an onChar event to an object:
16 |
17 | ```lua
18 | local basalt = require("basalt")
19 |
20 | local main = basalt.createFrame()
21 | local input = main:addInput()
22 | :setPosition(3,3)
23 | :setSize(12,1)
24 |
25 | function inputOnChar(self, event, char)
26 | basalt.debug("Character typed: " .. char)
27 | end
28 | input:onChar(inputOnChar)
29 | ```
30 |
--------------------------------------------------------------------------------
/docs/objects/Object/onClickUp.md:
--------------------------------------------------------------------------------
1 | ## onClickUp
2 |
3 | ### Description
4 |
5 | `onClickUp(self, event, button, x, y)`
6 |
7 | The onClickUp event is triggered when a mouse click is released on the object.
8 |
9 | ### Returns
10 |
11 | 1. `object` The object in use
12 |
13 | ### Usage
14 |
15 | * Add an onClickUp event to a button:
16 |
17 | ```lua
18 | local basalt = require("basalt")
19 |
20 | local main = basalt.createFrame()
21 | local button = main:addButton()
22 | :setPosition(3,3)
23 | :setSize(12,3)
24 | :setText("Click")
25 |
26 | function buttonOnClickUp()
27 | basalt.debug("Button click released!")
28 | end
29 | button:onClickUp(buttonOnClickUp)
30 | ```
31 |
--------------------------------------------------------------------------------
/docs/objects/Object/onGetFocus.md:
--------------------------------------------------------------------------------
1 | ## onGetFocus
2 |
3 | ### Description
4 |
5 | `onGetFocus(self)`
6 |
7 | The onGetFocus event is triggered when the object gains focus, which occurs when the object is clicked.
8 |
9 | ### Returns
10 |
11 | 1. `object` The object in use
12 |
13 | ### Usage
14 |
15 | * Add an onGetFocus event to a textbox:
16 |
17 | ```lua
18 | local basalt = require("basalt")
19 |
20 | local main = basalt.createFrame()
21 | local textbox = main:addTextbox()
22 | :setPosition(3,3)
23 | :setSize(12,3)
24 |
25 | function textboxOnGetFocus()
26 | basalt.debug("Textbox gained focus!")
27 | end
28 | textbox:onGetFocus(textboxOnGetFocus)
29 | ```
30 |
--------------------------------------------------------------------------------
/docs/objects/Object/onKey.md:
--------------------------------------------------------------------------------
1 | ## onKey
2 |
3 | ### Description
4 |
5 | `onKey(self, event, key)`
6 |
7 | The onKey event is triggered when a key is pressed on the keyboard.
8 |
9 | ### Returns
10 |
11 | 1. `object` The object in use
12 |
13 | ### Usage
14 |
15 | * Add an onKey event to an object:
16 |
17 | ```lua
18 | local basalt = require("basalt")
19 |
20 | local main = basalt.createFrame()
21 | local input = main:addInput()
22 | :setPosition(3,3)
23 | :setSize(12,1)
24 |
25 | function inputnOnKey(self, event, key)
26 | basalt.debug("Key pressed: " .. key)
27 | end
28 | input:onKey(inputnOnKey)
29 | ```
30 |
--------------------------------------------------------------------------------
/docs/objects/Object/onKeyUp.md:
--------------------------------------------------------------------------------
1 | ## onKeyUp
2 |
3 | ### Description
4 |
5 | `onKeyUp(self, event, key)`
6 |
7 | The onKeyUp event is triggered when a key is released on the keyboard.
8 |
9 | ### Returns
10 |
11 | 1. `object` The object in use
12 |
13 | ### Usage
14 |
15 | * Add an onKeyUp event to an object:
16 |
17 | ```lua
18 | local basalt = require("basalt")
19 |
20 | local main = basalt.createFrame()
21 | local input = main:addInput()
22 | :setPosition(3,3)
23 | :setSize(12,1)
24 |
25 | function inputnOnKeyUp(self, event, key)
26 | basalt.debug("Key released: " .. key)
27 | end
28 | input:onKeyUp(inputnOnKey)
29 | ```
30 |
--------------------------------------------------------------------------------
/docs/objects/Object/onLoseFocus.md:
--------------------------------------------------------------------------------
1 | ## onLoseFocus
2 |
3 | ### Description
4 |
5 | `onLoseFocus(self)`
6 |
7 | The onLoseFocus event is triggered when the object loses focus, which occurs when another object is clicked.
8 |
9 | ### Returns
10 |
11 | 1. `object` The object in use
12 |
13 | ### Usage
14 |
15 | * Add an onLoseFocus event to a textbox:
16 |
17 | ```lua
18 | local basalt = require("basalt")
19 |
20 | local main = basalt.createFrame()
21 | local textbox = main:addTextbox()
22 | :setPosition(3,3)
23 | :setSize(12,3)
24 |
25 | function textboxOnLoseFocus()
26 | basalt.debug("Textbox lost focus!")
27 | end
28 | textbox:onLoseFocus(textboxOnLoseFocus)
29 | ```
30 |
--------------------------------------------------------------------------------
/docs/objects/Object/onReposition.md:
--------------------------------------------------------------------------------
1 | # Object - Event
2 |
3 | ## onReposition
4 |
5 | `onReposition(self)`
6 |
7 | This is a custom event which gets triggered as soon as the object gets repositioned (for example by dynamic value).
8 |
9 | Here is a example on how to add a onReposition event to your button:
10 |
11 | ```lua
12 | local basalt = require("basalt")
13 |
14 | local main = basalt.createFrame()
15 | local aButton = main:addButton():setPosition(3,3)
16 |
17 | local function onButtonReposition(self)
18 | self:setSize(self:getWidth() - self:getX(), 3)
19 | end
20 |
21 | aButton:onReposition(onButtonReposition)
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/Object/onResize.md:
--------------------------------------------------------------------------------
1 | # Object - Event
2 |
3 | ## onResize
4 |
5 | `onResize(self)`
6 |
7 | This is a custom event which gets triggered as soon as the parent frame gets resized.
8 |
9 | Here is a example on how to add a onResize event to your button:
10 |
11 | ```lua
12 | local basalt = require("basalt")
13 |
14 | local main = basalt.createFrame()
15 | local aButton = main:addButton():setPosition(3,3)
16 |
17 | local function onButtonResize(self)
18 | local width = main:getWidth()
19 | self:setSize(width, 3)
20 | end
21 |
22 | aButton:onResize(onButtonResize)
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/Object/onScroll.md:
--------------------------------------------------------------------------------
1 | ## onScroll
2 |
3 | `onScroll(self, event, direction, x, y)`
4 |
5 | The `onScroll` event is triggered when a mouse scroll occurs over the object.
6 |
7 | ### Returns
8 |
9 | 1. `object` The object in use
10 |
11 | ### Usage
12 |
13 | * Add an onScroll event to a button:
14 |
15 | ```lua
16 | local basalt = require("basalt")
17 |
18 | local main = basalt.createFrame()
19 | local button = main:addButton()
20 | :setPosition(3,3)
21 | :setSize(12,3)
22 | :setText("Click")
23 |
24 | function buttonOnScroll(self, direction, x, y)
25 | basalt.debug("Someone scrolls on me!")
26 | end
27 | button:onScroll(buttonOnScroll)
28 | ```
29 |
--------------------------------------------------------------------------------
/docs/objects/Object/remove.md:
--------------------------------------------------------------------------------
1 | ## remove
2 |
3 | ### Description
4 |
5 | Removes the object from its parent
6 |
7 | The object will no longer be visible and will not receive any events. Note that this does not destroy the object, and it can be re-added to another parent later if needed.
8 |
9 | ### Returns
10 |
11 | 1. `object` The object in use
12 |
13 | ### Usage
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local aButton = mainFrame:addButton():setText("My Button")
18 | aButton:remove()
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/objects/Object/setAnchor.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## setAnchor
4 |
5 | Sets the anchor of the object
6 |
7 | ### Parameters
8 |
9 | 1. `string` Anchor sides `("topLeft" "top", "topRight", "right", "bottomRight", "bottom", "bottomLeft", "left", "center")`
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Sets the button to have an anchor of `bottomRight`
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame():show()
21 | local aButton = mainFrame:addButton()
22 | :setAnchor("bottomRight")
23 | :setSize(8,1)
24 | :setPosition(-8,1)
25 | ```
26 |
27 | ```xml
28 |
29 | ```
30 |
--------------------------------------------------------------------------------
/docs/objects/Object/setFocus.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## setFocus
4 |
5 | Sets the object to be the focused object.
6 | If you click on an object, it's normally automatically the focused object. For example, if you call :show() on a frame, and you want this particular frame to be in
7 | the foreground, you should also use :setFocus()
8 |
9 | ### Returns
10 |
11 | 1. `object` The object in use
12 |
13 | ### Usage
14 |
15 | * Sets the button to the focused object
16 |
17 | ```lua
18 | local mainFrame = basalt.createFrame()
19 | local aButton = mainFrame:addButton():setFocus()
20 | ```
21 |
--------------------------------------------------------------------------------
/docs/objects/Object/setForeground.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## setForeground
4 |
5 | Changes the object text color
6 |
7 | ### Parameters
8 |
9 | 1. `number|color` Foreground color
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a frame, and sets its foreground color to `colors.green`
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame():setForeground(colors.green)
21 | ```
22 |
23 | ```xml
24 |
25 | ```
26 |
--------------------------------------------------------------------------------
/docs/objects/Object/setShadow.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## setShadow
4 |
5 | Sets the shadow color - default: false
6 |
7 | ### Parameters
8 |
9 | 1. `number|color` Shadow color
10 |
11 | #### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | #### Usage
16 |
17 | * Sets the shadow to green and shows it:
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local subFrame = mainFrame:addFrame()
22 | :setMovable()
23 | :setSize(18,6)
24 | :setShadow(colors.green)
25 | ```
26 |
27 | Or:
28 |
29 | ```xml
30 |
31 | ```
32 |
--------------------------------------------------------------------------------
/docs/objects/Object/setSize.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## setSize
4 |
5 | Changes the object size
6 |
7 | ### Parameters
8 |
9 | 1. `number|string` width as number or dynamicvalue as string
10 | 2. `number|string` height as number or dynamicvalue as string
11 |
12 | ### Returns
13 |
14 | 1. `object` The object in use
15 |
16 | ### Usage
17 |
18 | * Sets the frame to have a width of 15 and a height of 12
19 |
20 | ```lua
21 | local mainFrame = basalt.createFrame()
22 | local subFrame = mainFrame:addFrame():setSize(15,12)
23 | ```
24 |
25 | ```xml
26 |
27 | ```
28 |
--------------------------------------------------------------------------------
/docs/objects/Object/setValue.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## setValue
4 |
5 | Sets the value of that object (input, label, checkbox, textfield, scrollbar,...)
6 |
7 | ### Parameters
8 |
9 | 1. `any` Value to set the object to
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a checkbox and ticks it
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local aCheckbox = mainFrame:addCheckbox():setValue(true)
22 | ```
23 |
24 | ```xml
25 |
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/objects/Object/show.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## show
4 |
5 | Shows the object (only if the parent frame is already visible)
6 |
7 | ### Returns
8 |
9 | 1. `object` The object in use
10 |
11 | ### Usage
12 |
13 | * Shows a frame
14 |
15 | ```lua
16 | local mainFrame = basalt.createFrame()
17 | local button = mainFrame:addButton()
18 | button:show()
19 | ```
20 |
21 | ```xml
22 |
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/Radio/clear.md:
--------------------------------------------------------------------------------
1 | ## clear
2 | Removes all items.
3 |
4 | #### Returns:
5 | 1. `object` The object in use
6 |
7 | #### Usage:
8 | * Creates a default radio with 3 entries and removes them immediatley. Which makes no sense.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aRadio = mainFrame:addRadio()
12 | aRadio:addItem("1. Entry",5,2)
13 | aRadio:addItem("2. Entry",5,4,colors.yellow)
14 | aRadio:addItem("3. Entry",5,6,colors.yellow,colors.green)
15 | aRadio:clear()
16 | ```
--------------------------------------------------------------------------------
/docs/objects/Radio/getAll.md:
--------------------------------------------------------------------------------
1 | ## getAll
2 | Returns all items as table
3 |
4 | #### Returns:
5 | 1. `table` All items
6 |
7 | #### Usage:
8 | * Creates a default menubar with 3 entries and prints a table.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aRadio = mainFrame:addRadio()
12 | aRadio:addItem("1. Entry",5,2)
13 | aRadio:addItem("2. Entry",5,4,colors.yellow)
14 | aRadio:addItem("3. Entry",5,6,colors.yellow,colors.green)
15 | basalt.debug(aRadio:getAll())
16 | ```
--------------------------------------------------------------------------------
/docs/objects/Radio/getItem.md:
--------------------------------------------------------------------------------
1 | ## getItem
2 | Returns a item by index
3 |
4 | #### Parameters:
5 | 1. `number` The index which should be returned
6 |
7 | #### Returns:
8 | 1. `table` The item table example: {text="1. Entry", bgCol=colors.black, fgCol=colors.white}
9 |
10 | #### Usage:
11 | * Creates a default radio with 3 entries and edits the second one.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aRadio = mainFrame:addRadio()
15 | aRadio:addItem("1. Entry",5,2)
16 | aRadio:addItem("2. Entry",5,4,colors.yellow)
17 | aRadio:addItem("3. Entry",5,6,colors.yellow,colors.green)
18 | basalt.debug(aRadio:getItem(2).text)
19 | ```
--------------------------------------------------------------------------------
/docs/objects/Radio/getItemCount.md:
--------------------------------------------------------------------------------
1 | ## getItemCount
2 | Returns the current item count
3 |
4 | #### Returns:
5 | 1. `number` The item radio count
6 |
7 | #### Usage:
8 | * Creates a default radio with 3 entries and prints the current item count.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aRadio = mainFrame:addRadio()
12 | aRadio:addItem("1. Entry",5,2)
13 | aRadio:addItem("2. Entry",5,4,colors.yellow)
14 | aRadio:addItem("3. Entry",5,6,colors.yellow,colors.green)
15 | basalt.debug(aRadio:getItemCount())
16 | ```
--------------------------------------------------------------------------------
/docs/objects/Radio/getItemIndex.md:
--------------------------------------------------------------------------------
1 | ## getItemIndex
2 | returns the item index of the currently selected item
3 |
4 | #### Returns:
5 | 1. `number` The current index
6 |
7 | #### Usage:
8 | * Creates a default radio with 3 entries selects the second entry and prints the currently selected index.
9 | ```lua
10 | local mainFrame = basalt.createFrame()
11 | local aRadio = mainFrame:addRadio()
12 | aRadio:addItem("1. Entry",5,2)
13 | aRadio:addItem("2. Entry",5,4,colors.yellow)
14 | aRadio:addItem("3. Entry",5,6,colors.yellow,colors.green)
15 | aRadio:selectItem(2)
16 | basalt.debug(aRadio:getItemIndex())
17 | ```
--------------------------------------------------------------------------------
/docs/objects/Radio/removeItem.md:
--------------------------------------------------------------------------------
1 | ## removeItem
2 | Removes a item from the radio
3 |
4 | #### Parameters:
5 | 1. `number` The index which should get removed
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default radio with 3 entries and removes the second one.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aRadio = mainFrame:addRadio()
15 | aRadio:addItem("1. Entry",5,2)
16 | aRadio:addItem("2. Entry",5,4,colors.yellow)
17 | aRadio:addItem("3. Entry",5,6,colors.yellow,colors.green)
18 | aRadio:removeItem(2)
19 | ```
--------------------------------------------------------------------------------
/docs/objects/Radio/selectItem.md:
--------------------------------------------------------------------------------
1 | ## selectItem
2 | selects a item in the radio (same as a player would click on a item)
3 |
4 | #### Parameters:
5 | 1. `number` The index which should get selected
6 |
7 | #### Returns:
8 | 1. `object` The object in use
9 |
10 | #### Usage:
11 | * Creates a default radio with 3 entries and selects the second entry.
12 | ```lua
13 | local mainFrame = basalt.createFrame()
14 | local aRadio = mainFrame:addRadio()
15 | aRadio:addItem("1. Entry",5,2)
16 | aRadio:addItem("2. Entry",5,4,colors.yellow)
17 | aRadio:addItem("3. Entry",5,6,colors.yellow,colors.green)
18 | aRadio:selectItem(2)
19 | ```
--------------------------------------------------------------------------------
/docs/objects/Scrollbar/setBackgroundSymbol.md:
--------------------------------------------------------------------------------
1 | ## setBackgroundSymbol
2 |
3 | ### Description
4 |
5 | Changes the symbol in the background, default is "\127"
6 |
7 | ### Parameters
8 |
9 | 1. `string` symbol
10 |
11 | ### Return
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a new scrollbar and changes the background symbol to X
18 |
19 | ```lua
20 | local main = basalt.createFrame()
21 | local scrollbar = main:addScrollbar():setBackgroundSymbol("X")
22 | ```
23 |
24 | ```xml
25 |
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/objects/Textfield/clear.md:
--------------------------------------------------------------------------------
1 | ## clear
2 |
3 | ### Description
4 |
5 | Clears the entire content of a Textfield object, removing all text currently displayed within it.
6 |
7 | ### Returns
8 |
9 | 1. `object ` The object in use
10 |
11 | ### Usage
12 |
13 | ```lua
14 | local basalt = require("basalt")
15 |
16 | local mainFrame = basalt.createFrame()
17 | local aTextfield = mainFrame:addTextfield()
18 |
19 | -- Assume there is some content in the Textfield
20 | aTextfield:clear() -- Clear the entire content
21 |
22 | basalt.autoUpdate()
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/Textfield/getSelection.md:
--------------------------------------------------------------------------------
1 | ## setSelection
2 |
3 | ### Description
4 |
5 | Returns the colors when selecting a text.
6 |
7 | ### Returns
8 |
9 | 1. `number|color` foreground color - The text color.
10 | 2. `number|color` background color - ´The background color.
11 |
--------------------------------------------------------------------------------
/docs/objects/Textfield/setOffset.md:
--------------------------------------------------------------------------------
1 | ## setOffset
2 |
3 | ### Description
4 |
5 | Sets the offset within a Textfield object, allowing you to adjust the viewable portion of the text.
6 |
7 | ### Parameteres
8 |
9 | 1. `number` xOffset - The horizontal offset to set within the Textfield
10 | 2. `number` yOffset - The vertical offset to set within the Textfield
11 |
12 | ### Returns
13 |
14 | 1. `object` The object in use
15 |
16 | ### Usage
17 |
18 | ```lua
19 | local basalt = require("basalt")
20 |
21 | local mainFrame = basalt.createFrame()
22 | local aTextfield = mainFrame:addTextfield()
23 |
24 | -- Scroll 10 units down vertically
25 | aTextfield:setOffset(0, 10)
26 |
27 | basalt.autoUpdate()
28 | ```
29 |
--------------------------------------------------------------------------------
/docs/objects/Textfield/setSelection.md:
--------------------------------------------------------------------------------
1 | ## setSelection
2 |
3 | ### Description
4 |
5 | Changes the color when selecting text.
6 |
7 | ### Parameteres
8 |
9 | 1. `number|color` foreground color - The text color.
10 | 2. `number|color` background color - ´The background color.
11 |
12 | ### Returns
13 |
14 | 1. `object` The object in use
15 |
16 | ### Usage
17 |
18 | ```lua
19 | local basalt = require("basalt")
20 |
21 | local mainFrame = basalt.createFrame()
22 | local aTextfield = mainFrame:addTextfield()
23 |
24 | aTextfield:setSelection(colors.white, colors.blue)
25 |
26 | basalt.autoUpdate()
27 | ```
28 |
--------------------------------------------------------------------------------
/docs/objects/Timer/cancel.md:
--------------------------------------------------------------------------------
1 | ## cancel
2 | Cancels the timer
3 |
4 | #### Returns:
5 | 1. `object` The object
6 |
7 | ```lua
8 | local mainFrame = basalt.createFrame()
9 | local aTimer = mainFrame:addTimer()
10 | aTimer:setTime(2):start()
11 | aTimer:cancel()
12 | ```
--------------------------------------------------------------------------------
/docs/objects/Timer/setTime.md:
--------------------------------------------------------------------------------
1 | ## setTime
2 | sets the time the timer should wait before calling your function
3 |
4 | #### Parameters:
5 | 1. `number` the time to delay between repetitions
6 | 2. `number` how many times it should be repeated -1 is infinite
7 |
8 | #### Returns:
9 | 1. `object` The object
10 |
11 | ```lua
12 | local mainFrame = basalt.createFrame()
13 | local aTimer = mainFrame:addTimer()
14 | aTimer:setTime(2)
15 | ```
16 | ```xml
17 |
18 | ```
19 |
--------------------------------------------------------------------------------
/docs/objects/Timer/start.md:
--------------------------------------------------------------------------------
1 | ## start
2 | Starts the timer
3 |
4 | #### Returns:
5 | 1. `object` The object
6 |
7 | ```lua
8 | local mainFrame = basalt.createFrame()
9 | local aTimer = mainFrame:addTimer()
10 | aTimer:setTime(2):start()
11 | ```
12 | ```xml
13 |
14 | ```
--------------------------------------------------------------------------------
/docs/objects/VisualObject/addTexture.md:
--------------------------------------------------------------------------------
1 | ## addTexture
2 |
3 | ### Description
4 |
5 | Adds a texture to an object. A texture is a bimg image, stored on your computer.
6 |
7 | ### Parameters
8 |
9 | 1. `string` Path to your bimg file
10 | 2. `boolean` Optional - If the bimg image has animations, set this to true to be able to play it (default is false)
11 |
12 | ### Returns
13 |
14 | 1. `object` The object in use
15 |
16 | ### Usage
17 |
18 | * Adds a texture to a frame:
19 |
20 | ```lua
21 | local basalt = require("basalt")
22 |
23 | local mainFrame = basalt.createFrame()
24 |
25 | mainFrame:addTexture("path/to/texture.bimg", true)
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/objects/VisualObject/getBackground.md:
--------------------------------------------------------------------------------
1 | ## getBackground
2 |
3 | ### Description
4 |
5 | Returns the current background color
6 |
7 | ### Returns
8 |
9 | 1. `number|false` color (returns false if the background is transparent)
10 |
11 | ### Usage
12 |
13 | * Retrieves the background color of an object and prints it to the debug console:
14 |
15 | ```lua
16 | local basalt = require("basalt")
17 |
18 | local mainFrame = basalt.createFrame():setBackground(colors.gray)
19 | local bgColor = mainFrame:getBackground()
20 | basalt.debug(bgColor) -- prints colors.gray
21 | ```
22 |
--------------------------------------------------------------------------------
/docs/objects/VisualObject/getForeground.md:
--------------------------------------------------------------------------------
1 | ## getForeground
2 |
3 | ### Description
4 |
5 | Returns the current foreground color
6 |
7 | ### Returns
8 |
9 | 1. `number|color` color
10 |
11 | ### Usage
12 |
13 | * Retrieves the foreground color of an object and prints it to the debug console:
14 |
15 | ```lua
16 | local basalt = require("basalt")
17 |
18 | local mainFrame = basalt.createFrame():setForeground(colors.red)
19 | local fgColor = mainFrame:getForeground()
20 | basalt.debug(fgColor) -- prints colors.red
21 | ```
22 |
--------------------------------------------------------------------------------
/docs/objects/VisualObject/getHeight.md:
--------------------------------------------------------------------------------
1 | ## getHeight
2 |
3 | ### Description
4 |
5 | Returns the object's height.
6 |
7 | ### Returns
8 |
9 | 1. `number` height
10 |
11 | ### Usage
12 |
13 | * Prints the height of a button to the debug console
14 |
15 | ```lua
16 | local basalt = require("basalt")
17 |
18 | local mainFrame = basalt.createFrame()
19 | local aButton = mainFrame:addButton():setSize(10, 3)
20 | local h = aButton:getHeight()
21 | basalt.debug("Button height: " .. h) -- prints "Button height: 3"
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/VisualObject/getPosition.md:
--------------------------------------------------------------------------------
1 | ## getPosition
2 |
3 | ### Description
4 |
5 | Returns the object's position
6 |
7 | ### Returns
8 |
9 | 1. `number` x position
10 | 2. `number` y position
11 |
12 | ### Usage
13 |
14 | * Prints the x and y coordinates of a button to the debug console
15 |
16 | ```lua
17 | local basalt = require("basalt")
18 |
19 | local mainFrame = basalt.createFrame()
20 | local aButton = mainFrame:addButton():setPosition(5, 8)
21 | local x, y = aButton:getPosition()
22 | basalt.debug("Button position: x=" .. x .. ", y=" .. y) -- prints "Button position: x=5, y=8"
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/VisualObject/getShadow.md:
--------------------------------------------------------------------------------
1 | ## getShadow
2 |
3 | ### Description
4 |
5 | Returns the current shadow color of the object.
6 |
7 | ### Returns
8 |
9 | 1. `number|boolean` Shadow color or false if no shadow is set
10 |
11 | ### Usage
12 |
13 | * Prints the shadow color of a frame to the debug console
14 |
15 | ```lua
16 | local basalt = require("basalt")
17 |
18 | local mainFrame = basalt.createFrame()
19 | local subFrame = mainFrame:addMovableFrame()
20 | :setSize(18,6)
21 | :setShadow(colors.green)
22 |
23 | basalt.debug(subFrame:getShadow()) -- returns colors.green or false if no shadow is set
24 | ```
25 |
--------------------------------------------------------------------------------
/docs/objects/VisualObject/getSize.md:
--------------------------------------------------------------------------------
1 | ## getSize
2 |
3 | ### Description
4 |
5 | Returns the object's size
6 |
7 | ### Returns
8 |
9 | 1. `number` width
10 | 2. `number` height
11 |
12 | ### Usage
13 |
14 | * Prints the width and height of a button to the debug console
15 |
16 | ```lua
17 | local basalt = require("basalt")
18 |
19 | local mainFrame = basalt.createFrame()
20 | local aButton = mainFrame:addButton():setSize(10, 3)
21 | local w, h = aButton:getSize()
22 | basalt.debug("Button position: w=" .. w .. ", h=" .. h) -- prints "Button position: w=10, h=3"
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/objects/VisualObject/getWidth.md:
--------------------------------------------------------------------------------
1 | ## getWidth
2 |
3 | ### Description
4 |
5 | Returns the object's width.
6 |
7 | ### Returns
8 |
9 | 1. `number` width
10 |
11 | ### Usage
12 |
13 | * Prints the width of a button to the debug console
14 |
15 | ```lua
16 | local basalt = require("basalt")
17 |
18 | local mainFrame = basalt.createFrame()
19 | local aButton = mainFrame:addButton():setSize(10, 3)
20 | local w = aButton:getWidth()
21 | basalt.debug("Button width: " .. w) -- prints "Button width: 10"
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/VisualObject/getX.md:
--------------------------------------------------------------------------------
1 | ## getX
2 |
3 | ### Description
4 |
5 | Returns the object's x-coordinate.
6 |
7 | ### Returns
8 |
9 | 1. `number` x position
10 |
11 | ### Usage
12 |
13 | * Prints the x-coordinate of a button to the debug console
14 |
15 | ```lua
16 | local basalt = require("basalt")
17 |
18 | local mainFrame = basalt.createFrame()
19 | local aButton = mainFrame:addButton():setPosition(5, 8)
20 | local x = aButton:getX()
21 | basalt.debug("Button x-coordinate: " .. x) -- prints "Button x-coordinate: 5"
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/VisualObject/getY.md:
--------------------------------------------------------------------------------
1 | ## getY
2 |
3 | ### Description
4 |
5 | Returns the object's y-coordinate.
6 |
7 | ### Returns
8 |
9 | 1. `number` y position
10 |
11 | ### Usage
12 |
13 | * Prints the y-coordinate of a button to the debug console
14 |
15 | ```lua
16 | local basalt = require("basalt")
17 |
18 | local mainFrame = basalt.createFrame()
19 | local aButton = mainFrame:addButton():setPosition(5, 8)
20 | local y = aButton:getY()
21 | basalt.debug("Button y-coordinate: " .. y) -- prints "Button y-coordinate: 5"
22 | ```
23 |
--------------------------------------------------------------------------------
/docs/objects/VisualObject/isFocused.md:
--------------------------------------------------------------------------------
1 | ## isFocused
2 |
3 | ### Description
4 |
5 | Returns whether the object is currently the focused object of the parent frame.
6 |
7 | ### Returns
8 |
9 | 1. `boolean` Whether the object is focused
10 |
11 | #### Usage
12 |
13 | * Prints whether the button is focused to the debug console
14 |
15 | ```lua
16 | local basalt = require("basalt")
17 |
18 | local mainFrame = basalt.createFrame()
19 | local aButton = mainFrame:addButton()
20 | basalt.debug(aButton:isFocused()) -- shows true or false as a debug message
21 | ```
22 |
--------------------------------------------------------------------------------
/docs/objects/VisualObject/onResize.md:
--------------------------------------------------------------------------------
1 | ## onResize
2 |
3 | ### Description
4 |
5 | `onResize(self)`
6 |
7 | The `onResize` event is a custom event that gets triggered when the parent frame is resized.
8 |
9 | ### Returns
10 |
11 | 1. `object` The object in use
12 |
13 | ### Usage
14 |
15 | * Add an onResize event to a button:
16 |
17 | ```lua
18 | local basalt = require("basalt")
19 |
20 | local main = basalt.createFrame()
21 | local aButton = main:addButton():setPosition(3,3)
22 |
23 | local function onButtonResize(self)
24 | local width = main:getWidth()
25 | self:setSize(width, 3)
26 | end
27 |
28 | aButton:onResize(onButtonResize)
29 | ```
30 |
--------------------------------------------------------------------------------
/docs/objects/VisualObject/setFocus.md:
--------------------------------------------------------------------------------
1 | # Object
2 |
3 | ## setFocus
4 |
5 | Sets the object to be the focused object.
6 | If you click on an object, it's normally automatically the focused object. For example, if you call :show() on a frame, and you want this particular frame to be in
7 | the foreground, you should also use :setFocus()
8 |
9 | ### Returns
10 |
11 | 1. `object` The object in use
12 |
13 | ### Usage
14 |
15 | * Sets the button to the focused object
16 |
17 | ```lua
18 | local mainFrame = basalt.createFrame()
19 | local aButton = mainFrame:addButton():setFocus()
20 | ```
21 |
--------------------------------------------------------------------------------
/docs/objects/VisualObject/setForeground.md:
--------------------------------------------------------------------------------
1 | ## setForeground
2 |
3 | ### Description
4 |
5 | Changes the object text color
6 |
7 | ### Parameters
8 |
9 | 1. `number|color` Foreground color
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Creates a frame, and sets its foreground color to `colors.green`
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame():setForeground(colors.green)
21 | ```
22 |
23 | ```xml
24 |
25 | ```
26 |
--------------------------------------------------------------------------------
/docs/objects/VisualObject/setInfinitePlay.md:
--------------------------------------------------------------------------------
1 | ## setInfinitePlay
2 |
3 | ### Description
4 |
5 | Sets whether the texture animation should play infinitely or not.
6 |
7 | ### Parameters
8 |
9 | 1. `boolean` Set to true to make the texture animation loop infinitely, false otherwise
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Set to true to make the texture animation loop infinitely, false otherwise
18 |
19 | ```lua
20 | local basalt = require("basalt")
21 |
22 | local mainFrame = basalt.createFrame()
23 |
24 | mainFrame:addTexture("path/to/animated_texture.bimg", true)
25 | mainFrame:setInfinitePlay(true)
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/objects/VisualObject/setShadow.md:
--------------------------------------------------------------------------------
1 | ## setShadow
2 |
3 | ### Description
4 |
5 | Sets the shadow color - default: false
6 |
7 | ### Parameters
8 |
9 | 1. `number|color` Shadow color
10 |
11 | #### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | #### Usage
16 |
17 | * Sets the shadow to green and shows it:
18 |
19 | ```lua
20 | local mainFrame = basalt.createFrame()
21 | local subFrame = mainFrame:addMovableFrame()
22 | :setSize(18,6)
23 | :setShadow(colors.green)
24 | ```
25 |
26 | Or:
27 |
28 | ```xml
29 |
30 | ```
31 |
--------------------------------------------------------------------------------
/docs/objects/VisualObject/setTextureMode.md:
--------------------------------------------------------------------------------
1 | ## setTextureMode
2 |
3 | ### Description
4 |
5 | Sets the texture mode for an object. The texture mode determines how the texture is displayed on the object. Available modes are "default", "center", and "right".
6 |
7 | ### Parameters
8 |
9 | 1. `string` Texture mode ("default", "center", or "right")
10 |
11 | ### Returns
12 |
13 | 1. `object` The object in use
14 |
15 | ### Usage
16 |
17 | * Sets the texture mode of a frame to "center":
18 |
19 | ```lua
20 | local basalt = require("basalt")
21 |
22 | local mainFrame = basalt.createFrame()
23 |
24 | mainFrame:addTexture("path/to/texture.bimg", true)
25 | mainFrame:setTextureMode("center")
26 | ```
27 |
--------------------------------------------------------------------------------