{"id":24600739,"url":"https://github.com/SiENcE/luis","last_synced_at":"2025-10-05T21:31:59.783Z","repository":{"id":272255786,"uuid":"862961685","full_name":"SiENcE/luis","owner":"SiENcE","description":"LUIS (Love UI System) is a flexible graphical user interface (GUI) framework built on top of the Löve2D game framework. LUIS provides developers with the tools to create dynamic, grid-centric, layered user interfaces for games and applications.","archived":false,"fork":false,"pushed_at":"2025-01-23T22:01:21.000Z","size":3313,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-23T23:18:14.252Z","etag":null,"topics":["framework","gui","love2d","love2d-gui","love2d-gui-library"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SiENcE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-25T13:35:20.000Z","updated_at":"2025-01-23T22:01:24.000Z","dependencies_parsed_at":"2025-01-14T05:58:57.671Z","dependency_job_id":null,"html_url":"https://github.com/SiENcE/luis","commit_stats":null,"previous_names":["sience/luis"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiENcE%2Fluis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiENcE%2Fluis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiENcE%2Fluis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiENcE%2Fluis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SiENcE","download_url":"https://codeload.github.com/SiENcE/luis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235448520,"owners_count":18991891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["framework","gui","love2d","love2d-gui","love2d-gui-library"],"created_at":"2025-01-24T14:01:25.958Z","updated_at":"2025-10-05T21:31:59.771Z","avatar_url":"https://github.com/SiENcE.png","language":"Lua","funding_links":[],"categories":["Recently Updated","UI"],"sub_categories":["[Jan 22, 2025](/content/2025/01/22/README.md)"],"readme":"# LUIS: Love UI System\n\n\u003cp align=\"center\"\u003e\n \u003ca href=\"https://github.com/SiENcE/luis/blob/main/assets/logo_small.png\"\u003e\n  \u003cimg border=\"0\" src=\"https://github.com/SiENcE/luis/blob/main/assets/logo_small.png\"\u003e\n \u003c/a\u003e\n\u003c/p\u003e\n\n**LUIS** (Love User Interface System) is a flexible graphical user interface (GUI) framework built on top of the [Löve2D](https://love2d.org/) game framework. LUIS provides developers with the tools to create dynamic, grid-centric, layered user interfaces for games and applications.\n\n## LUIS: Samples\n\nLook at our [LUIS-Samples](https://github.com/SiENcE/luis_samples/)\n\n\u003cp align=\"center\"\u003e\n \u003ca href=\"https://github.com/SiENcE/luis_samples/blob/main/assets/recordings/Recording_2024-11-12_00.58.43.gif\"\u003e\n  \u003cimg border=\"0\" style=\"max-width:100%; height:auto;\" src=\"https://github.com/SiENcE/luis_samples/blob/main/assets/recordings/Recording_2024-11-12_00.58.43.gif\"\u003e\n \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n \u003cem\u003eA LUIS UI-Editor made with LUIS.\u003c/em\u003e\n\u003c/p\u003e\n\n## Features\n\n| Feature | Description |\n|---------|-------------|\n| Flexible Layout | Uses a grid-based system and FlexContainers for easy UI layout |\n| Layer Management | Support for multiple UI layers with show/hide functionality \u0026 Z-indexing for element layering |\n| Theme Support | Global theme customization, Per-widget theme overrides |\n| Customizable Theming | Easily change the look and feel of your UI elements |\n| Widget API | Core system for loading and managing widgets (widgets themselves are optional and loaded dynamically) |\n| Event Handling | Built-in support for mouse, touch, keyboard, and gamepad interactions \u0026 focus management |\n| Responsive Design | Automatically scales UI elements and interaction based on screen dimensions |\n| State Management | Tracks and persists element states to save and load configurations |\n| Extensibility | Modular design allowing easy addition of new widgets or removing unneeded widgets (see Widget Types section) |\n| Debug Mode | Toggle grid and element outlines for easy development |\n\n**Note**: These features are all part of the LUIS core library (`core.lua`), which has **zero dependencies**! You can use the core library on its own and implement your own widgets for a lightweight UI system for [Löve2D](https://love2d.org/) without any additional dependencies.\n\n## Widget Types\n\nLUIS comes with a variety of pre-built widgets to create rich user interfaces. While the following widgets are included, they are **completely optional** and are only loaded when you specify a widget folder during initialization. This modular approach allows you to use only the widgets you need or create your own custom widgets:\n\n1. **Button**: Interactive clickable elements\n2. **Slider**: Adjustable value selector\n3. **Switch**: Toggle between two states\n4. **CheckBox**: Select multiple options\n5. **RadioButton**: Select one option from a group\n6. **DropDown**: Select from a list of options\n7. **TextInput**: User text entry field (single-line)\n8. **TextInputMultiLine**: Multi-line text entry\n9. **ProgressBar**: Display progress or loading status\n10. **Label**: Display a text label\n11. **Icon**: Display graphical icons\n12. **ColorPicker**: Choose and Select a color\n13. **Node**: A node to build an interactive NodeGraph\n14. **DialogueWheel**: Circular interface that presents selectable options in a radial format\n15. **Custom**: Add your own drawing function\n16. **FlexContainer**: Special container for flexible layouts\n17. **DialogueBox**: Animated dialogue box with a gradual text reveal effect\n\n## Getting Started\n\n1. **Install Löve2D** (11.5): You can download Löve2D from [here](https://love2d.org/).\n2. **Clone the LUIS Library into your project**:\n    ```bash\n    git clone https://github.com/SiENCE/LUIS.git\n    ```\n3. **Include LUIS in Your Löve2D Project**:\n    ```lua\n    -- Initialize LUIS\n    local initLuis = require(\"luis.init\")\n    \n    -- Direct this to your widgets folder.\n    local luis = initLuis(\"luis/widgets\")\n    ```\n\n4. **Create and Manage UI Elements**:\n    Use LUIS functions to define layers, add UI elements, and manage their states.\n\n## Example\n\nHere's a simple example to create a FlexContainer with two buttons and a slider (press 'TAB' for debug view):\n\nmain.lua\n```lua\nlocal initLuis = require(\"luis.init\")\n\n-- Direct this to your widgets folder.\nlocal luis = initLuis(\"luis/widgets\")\n\n-- register flux in luis, some widgets need it for animations\nluis.flux = require(\"luis.3rdparty.flux\")\n\nfunction love.load()\n    -- Create a FlexContainer\n    local container = luis.newFlexContainer(20, 20, 10, 10)\n\n    -- Add some widgets to the container\n    local button1 = luis.newButton(\"Button 1\", 15, 3, function() print(\"Button 1 clicked!\") end, function() print(\"Button 1 released!\") end, 5, 2)\n    local button2 = luis.newButton(\"Button 2\", 15, 3, function() print(\"Button 2 clicked!\") end, function() print(\"Button 2 released!\") end, 5, 2)\n    local slider = luis.newSlider(0, 100, 50, 10, 2, function(value)\n        print('Slider value:', value)\n    end, 10, 2)\n\n    container:addChild(button1)\n    container:addChild(button2)\n    container:addChild(slider)\n\n    luis.newLayer(\"main\")\n    luis.setCurrentLayer(\"main\")\n    \n    -- Add the container to your LUIS layer\n    luis.createElement(luis.currentLayer, \"FlexContainer\", container)\n\n    love.window.setMode(1280, 1024)\nend\n\nlocal time = 0\nfunction love.update(dt)\n\ttime = time + dt\n\tif time \u003e= 1/60 then\t\n\t\tluis.flux.update(time)\n\t\ttime = 0\n\tend\n\n    luis.update(dt)\nend\n\nfunction love.draw()\n    luis.draw()\nend\n\nfunction love.mousepressed(x, y, button, istouch)\n    luis.mousepressed(x, y, button, istouch)\nend\n\nfunction love.mousereleased(x, y, button, istouch)\n    luis.mousereleased(x, y, button, istouch)\nend\n\nfunction love.keypressed(key)\n    if key == \"escape\" then\n        if luis.currentLayer == \"main\" then\n            love.event.quit()\n        end\n    elseif key == \"tab\" then -- Debug View\n        luis.showGrid = not luis.showGrid\n        luis.showLayerNames = not luis.showLayerNames\n        luis.showElementOutlines = not luis.showElementOutlines\n    else\n        luis.keypressed(key)\n    end\nend\n```\n\n### FlexContainer\n\nThe FlexContainer is a powerful widget that allows for dynamic and responsive layouts:\n\n- **Drag and Resize**: Containers can be moved and resized at runtime\n- **Auto-arranging**: Child elements are automatically arranged within the container\n- **Nested Containers**: Create complex layouts by nesting FlexContainers\n- **Padding Control**: Adjust spacing between child elements\n\nExample usage:\n\n```lua\nlocal container = luis.newFlexContainer(30, 30, 10, 10)\nlocal button1 = luis.newButton(\"Button 1\", 15, 3, function() print(\"Button 1 clicked!\") end, function() print(\"Button 1 released!\") end, 5, 2)\nlocal button2 = luis.newButton(\"Button 2\", 15, 3, function() print(\"Button 2 clicked!\") end, function() print(\"Button 2 released!\") end, 5, 2)\n\ncontainer:addChild(button1)\ncontainer:addChild(button2)\n\nluis.createElement(luis.currentLayer, \"FlexContainer\", container)\n```\n\n## Custom Widgets\n\nLUIS supports the creation of custom widgets to extend its functionality:\n\n1. Create a new Lua file in the `luis/widgets` directory\n2. Define your widget's properties and methods\n3. Implement the required functions: `new()`, `update()`, `draw()`, and `click()`\n4. Use the `setluis()` function to access the core LUIS library\n\nExample of a custom widget:\n\n```lua\nlocal customWidget = {}\n\nlocal luis\nfunction customWidget.setluis(luisObj)\n    luis = luisObj\nend\n\nfunction customWidget.new(width, height, row, col)\n    local widget = {\n        type = \"CustomWidget\",\n        width = width * luis.gridSize,\n        height = height * luis.gridSize,\n        position = luis.Vector2D.new((col - 1) * luis.gridSize, (row - 1) * luis.gridSize),\n        \n        update = function(self, mx, my)\n            -- Update logic here\n        end,\n        \n        draw = function(self)\n            -- Drawing logic here\n        end,\n        \n        click = function(self, x, y)\n            -- Click handling logic here\n        end\n    }\n    return widget\nend\n\nreturn customWidget\n```\n\n## Widget Decorators\n\nLUIS supports the Decorator pattern, allowing you to dynamically add visual effects and behaviors to widgets. Each widget includes built-in support for decorators that can modify their appearance without changing their core functionality.\n\nExample usage:\n\n```lua\n-- Create a button with a glass morphism\nlocal button = luis.newButton(\"Glassmorphism Button\", 15, 3, onClick, onRelease, 5, 2)\nbutton:setDecorator(\"GlassmorphismDecorator\", {1, 0.5, 0, 0.5}, 15)  -- Glass morphism with size 15\n\n-- Create a button with a glow effect\nlocal button = luis.newButton(\"Glowing Button\", 15, 3, onClick, onRelease, 5, 2)\nbutton:setDecorator(\"GlowDecorator\", {1, 0.5, 0, 0.5}, 15)  -- Orange glow with size 15\n\n-- Create a button with a 9-slice border\nlocal button2 = luis.newButton(\"Bordered Button\", 15, 3, onClick, onRelease, 5, 2)\nbutton2:setDecorator(\"Slice9Decorator\", borderImage, 10, 10, 10, 10)  -- 10px borders\n```\n\nAvailable decorators:\n- **GlassmorphismDecorator**: Implements a modern glassmorphism effect with customizable transparency, blur, borders, and shadows.\n- **GlowDecorator**: Adds a customizable glow effect around the widget\n- **Slice9Decorator**: Implements 9-slice scaling for bordered widgets\n\n## Documentation\n\nFor more detailed information on the LUIS API, including layer management, input handling, theming, and state management, please refer to the [LUIS core documentation](luis-api-documentation.md).\n\n## Dependencies\n\n- Löve2D: The game framework used for rendering and managing game objects.\n- The **core** library has **zero dependencies**, so you write your own widgets to have a lightweight ui system (see [basic_ui_sample](https://github.com/SiENcE/luis_samples/blob/main/samples/basic_ui) ).\n\n## known Problems\n\n- DropBox: Selection with the gamepad-analogstick works not for all choices\n- FlexContainer - dropdown select is not possible via gamepad-analogstick\n- TextInput - when changing Theme, we have to adjust the fontsize in TextInput widgets\n- TextInputMultiLine not setConfig/getConfig\n\n## License\n\nThis project is licensed under the MIT License with additional terms - see the [LICENSE](LICENSE) file for details.\n**Important:** Use of this software for training AI or machine learning models is strictly prohibited. See the LICENSE file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSiENcE%2Fluis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSiENcE%2Fluis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSiENcE%2Fluis/lists"}