{"id":29908234,"url":"https://github.com/zhuravkovigor/love-dialog","last_synced_at":"2026-05-15T21:32:47.425Z","repository":{"id":305827724,"uuid":"1023048975","full_name":"zhuravkovigor/love-dialog","owner":"zhuravkovigor","description":"A modern dialog system library for LÖVE2D games with typewriter text animation","archived":false,"fork":false,"pushed_at":"2025-07-24T05:32:02.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-31T10:51:48.991Z","etag":null,"topics":["dialog","game-development","love2d","lua","module"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhuravkovigor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-07-20T12:21:00.000Z","updated_at":"2025-07-24T05:32:06.000Z","dependencies_parsed_at":"2025-07-22T08:37:48.554Z","dependency_job_id":"51704bee-d041-4db5-bb8a-974b2d46d8fd","html_url":"https://github.com/zhuravkovigor/love-dialog","commit_stats":null,"previous_names":["zhuravkovigor/love-dialog"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zhuravkovigor/love-dialog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuravkovigor%2Flove-dialog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuravkovigor%2Flove-dialog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuravkovigor%2Flove-dialog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuravkovigor%2Flove-dialog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhuravkovigor","download_url":"https://codeload.github.com/zhuravkovigor/love-dialog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuravkovigor%2Flove-dialog/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268315795,"owners_count":24231056,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["dialog","game-development","love2d","lua","module"],"created_at":"2025-08-02T00:00:38.229Z","updated_at":"2026-05-15T21:32:42.405Z","avatar_url":"https://github.com/zhuravkovigor.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Love Dialog\n\nA modern dialog system library for LÖVE2D games with typewriter text animation, branching dialogs, and extensive customization options.\n\n## ✨ Features\n\n- **Typewriter Animation**: Letter-by-letter text display with configurable speed\n- **Dialog Branching**: Complex dialog trees with choices and conditional paths\n- **Mouse \u0026 Keyboard Support**: Unified selection system for both input methods\n- **Customizable UI**: Full control over appearance or use default styled components\n- **Character System**: Associate dialogs with character keys for easy management\n- **Font Support**: Custom fonts for text and character names\n- **Responsive Design**: Automatic text wrapping and choice centering\n\n## 🚀 Quick Start\n\n```lua\nlocal Dialog = require(\"libs.love-dialog\")\n\n-- Create dialog with default settings\nlocal dialog = Dialog.new()\n\n-- Or with custom configuration\nlocal dialog = Dialog.new({\n    text_speed = 0.03,\n    background_color = {0.1, 0.1, 0.2, 0.9},\n    text_color = {0.9, 0.9, 1, 1},\n    choice_color = {0.7, 0.9, 1, 1},\n    choice_selected_color = {1, 1, 0.8, 1},\n    font_size = 18,\n    dialog_height = 120,\n    dialog_max_width = 800,    -- Limit dialog width to 800px\n    dialog_margin_x = 50,      -- 50px margins from screen edges\n    dialog_margin_y = 20,      -- 20px margin from bottom\n    show_background = true\n})\n\nfunction love.load()\n    -- Simple dialog example\n    local simple_dialog = {\n        name = \"System\",\n        text = \"Welcome! Ready to start?\",\n        choices = {\n            {\n                text = \"Yes, let's go!\",\n                key = \"start\",\n                callback = function(key, value)\n                    print(\"User chose to start\")\n                end\n            },\n            {\n                text = \"Not now\",\n                key = \"cancel\"\n            }\n        }\n    }\n\n    dialog:start(simple_dialog)\nend\n\nfunction love.update(dt)\n    dialog:update(dt)\nend\n\nfunction love.draw()\n    dialog:draw()\nend\n\nfunction love.keypressed(key)\n    dialog:keypressed(key)\nend\n\nfunction love.mousepressed(x, y, button)\n    dialog:mousepressed(x, y, button)\nend\n\nfunction love.mousemoved(x, y)\n    dialog:mousemoved(x, y)\nend\n```\n\n````\n\n## 📖 Dialog Structure\n\n### Basic Dialog\n```lua\nlocal dialog_data = {\n    text = \"Hello, world!\",          -- Required: dialog text\n    name = \"Character Name\",         -- Optional: character name\n    key = \"unique_dialog_id\"         -- Optional: unique identifier\n}\n````\n\n### Dialog with Choices\n\n```lua\nlocal branching_dialog = {\n    text = \"What would you like to do?\",\n    name = \"Guide\",\n    choices = {\n        {\n            text = \"Option 1\",\n            key = \"choice1\",\n            next = {\n                text = \"You chose option 1!\",\n                name = \"Guide\"\n            }\n        },\n        {\n            text = \"Option 2\",\n            key = \"choice2\",\n            callback = function(key, value)\n                -- Handle choice selection\n                print(\"Selected:\", key)\n            end,\n            next = function()\n                -- Dynamic next dialog\n                return {\n                    text = \"Dynamic response!\",\n                    name = \"Guide\"\n                }\n            end\n        }\n    }\n}\n```\n\n## ⚙️ Configuration Options\n\n```lua\nlocal config = {\n    -- Text animation\n    text_speed = 0.03,                    -- Seconds per character\n\n    -- Colors (RGBA format)\n    background_color = {0.1, 0.1, 0.2, 0.9},\n    text_color = {0.9, 0.9, 1, 1},\n    name_color = {1, 0.8, 0.6, 1},\n    choice_color = {0.7, 0.9, 1, 1},\n    choice_selected_color = {1, 1, 0.8, 1},\n\n    -- Fonts\n    font_size = 18,\n    name_font_size = 22,\n    font_path = \"path/to/font.ttf\",       -- Optional custom font\n    name_font_path = \"path/to/bold.ttf\",  -- Optional custom name font\n\n    -- Layout\n    padding = 20,\n    dialog_height = 120,\n    dialog_max_width = 800,               -- Maximum dialog width (nil = full screen)\n    dialog_margin_x = 50,                 -- Horizontal margins from screen edges\n    dialog_margin_y = 20,                 -- Vertical margin from bottom\n    name_position = \"top\",                -- \"top\", \"left\", \"none\"\n    show_background = true,               -- Enable/disable default background\n\n    -- Custom rendering callbacks\n    custom_background_draw = function(dialog, x, y, width, height)\n        -- Custom background rendering\n    end,\n    custom_text_draw = function(dialog, text, x, y, width)\n        -- Custom text rendering\n    end,\n    custom_name_draw = function(dialog, name, x, y)\n        -- Custom name rendering\n    end,\n    custom_choices_draw = function(dialog)\n        -- Custom choice rendering\n    end\n}\n```\n\n## 🎮 Controls\n\n### Keyboard\n\n- **↑/↓ Arrow Keys**: Navigate choices\n- **Enter/Space**: Select choice or skip text animation\n- **Escape**: Close dialog\n\n### Mouse\n\n- **Click**: Select choice or skip text animation\n- **Hover**: Highlight choices\n- **Move**: Update selection\n\n## 🌟 Advanced Examples\n\n### Complex Branching Dialog\n\n```lua\nlocal complex_dialog = {\n    text = \"Welcome to the adventure! What's your class?\",\n    name = \"Elder\",\n    key = \"class_selection\",\n    choices = {\n        {\n            text = \"Warrior\",\n            key = \"warrior\",\n            value = {class = \"warrior\", hp = 100},\n            next = {\n                text = \"A mighty warrior! Your journey begins...\",\n                name = \"Elder\",\n                key = \"warrior_intro\"\n            },\n            callback = function(key, value)\n                -- Save player class\n                player.class = value.class\n                player.hp = value.hp\n            end\n        },\n        {\n            text = \"Mage\",\n            key = \"mage\",\n            value = {class = \"mage\", mp = 100},\n            next = function()\n                -- Dynamic dialog based on game state\n                if player.has_magic_item then\n                    return {\n                        text = \"A mage with a magic item! Impressive!\",\n                        name = \"Elder\"\n                    }\n                else\n                    return {\n                        text = \"A wise choice. Magic flows through you.\",\n                        name = \"Elder\"\n                    }\n                end\n            end\n        }\n    }\n}\n```\n\n### Custom Rendering\n\n```lua\nlocal custom_dialog = Dialog.new({\n    show_background = false,\n    custom_background_draw = function(dialog, x, y, width, height)\n        -- Draw custom background with gradient\n        love.graphics.setColor(0.2, 0.1, 0.3, 0.8)\n        love.graphics.rectangle(\"fill\", x, y, width, height)\n\n        -- Add border\n        love.graphics.setColor(0.6, 0.4, 0.8, 1)\n        love.graphics.setLineWidth(2)\n        love.graphics.rectangle(\"line\", x, y, width, height)\n    end,\n    custom_choices_draw = function(dialog)\n        -- Custom choice rendering with animations\n        -- Implementation depends on your needs\n    end\n})\n```\n\n## 📝 API Reference\n\n### Dialog Methods\n\n#### `Dialog.new(config?)`\n\nCreates a new dialog instance with optional configuration.\n\n#### `dialog:start(dialog_data, callback?)`\n\nStarts a dialog with the given data and optional completion callback.\n\n#### `dialog:update(dt)`\n\nUpdates the dialog animation. Call this in `love.update(dt)`.\n\n#### `dialog:draw()`\n\nRenders the dialog. Call this in `love.draw()`.\n\n#### `dialog:keypressed(key)`\n\nHandles keyboard input. Call this in `love.keypressed(key)`.\n\n#### `dialog:mousepressed(x, y, button)`\n\nHandles mouse clicks. Call this in `love.mousepressed(x, y, button)`.\n\n#### `dialog:mousemoved(x, y)`\n\nHandles mouse movement for choice highlighting. Call this in `love.mousemoved(x, y)`.\n\n#### `dialog:isActive()`\n\nReturns true if dialog is currently active.\n\n#### `dialog:close()`\n\nManually closes the dialog.\n\n#### `dialog:setConfig(config)`\n\nUpdates dialog configuration.\n\n#### `dialog:skipTextAnimation()`\n\nImmediately shows full text, skipping animation.\n\n## 📄 License\n\nMIT License - feel free to use in your projects!\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit issues and pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhuravkovigor%2Flove-dialog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhuravkovigor%2Flove-dialog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhuravkovigor%2Flove-dialog/lists"}