{"id":13525423,"url":"https://github.com/rm-code/screenmanager","last_synced_at":"2025-03-23T17:31:17.449Z","repository":{"id":29258434,"uuid":"32791029","full_name":"rm-code/screenmanager","owner":"rm-code","description":"Stackable Screen/State Management for the LÖVE framework.","archived":false,"fork":false,"pushed_at":"2017-11-20T11:07:39.000Z","size":79,"stargazers_count":34,"open_issues_count":3,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T22:27:18.711Z","etag":null,"topics":["love2d","lua","screenmanager","state-management"],"latest_commit_sha":null,"homepage":"http://rm-code.github.io/screenmanager/","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rm-code.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-24T10:14:00.000Z","updated_at":"2025-01-30T21:21:28.000Z","dependencies_parsed_at":"2022-08-07T14:15:48.660Z","dependency_job_id":null,"html_url":"https://github.com/rm-code/screenmanager","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-code%2Fscreenmanager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-code%2Fscreenmanager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-code%2Fscreenmanager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-code%2Fscreenmanager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rm-code","download_url":"https://codeload.github.com/rm-code/screenmanager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245140985,"owners_count":20567485,"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":["love2d","lua","screenmanager","state-management"],"created_at":"2024-08-01T06:01:18.615Z","updated_at":"2025-03-23T17:31:16.868Z","avatar_url":"https://github.com/rm-code.png","language":"Lua","funding_links":[],"categories":["Helpers"],"sub_categories":[],"readme":"# ScreenManager\n\n[![Version](https://img.shields.io/badge/Version-2.1.1-blue.svg)](https://github.com/rm-code/screenmanager/releases/latest)\n[![LOVE](https://img.shields.io/badge/L%C3%96VE-0.10.2-EA316E.svg)](http://love2d.org/)\n[![License](http://img.shields.io/badge/Licence-zlib-brightgreen.svg)](LICENSE.md)\n\nThe ScreenManager library is a state manager at heart which allows some nifty things, like stacking multiple screens on top of each other.\n\nIt also offers hooks for most of LÖVE's callback functions. Based on the type of callback the calls are rerouted to either only the active screen (love.keypressed, love.quit, ...) or to all screens (love.resize, love.visible, ...).\n\n## Example\n\n\u003e For a more complete example check out the [example branch](https://github.com/rm-code/screenmanager/tree/example) in this repository.\n\nThis is a simple example of how the ScreenManager should be used (note: You will have to change the paths in the example to fit your setup).\n\n```lua\n-- main.lua\n\nlocal ScreenManager = require('lib.ScreenManager')\n\nfunction love.load()\n    local screens = {\n        main = require('src.screens.MainScreen')\n    }\n\n    ScreenManager.init(screens, 'main')\nend\n\nfunction love.draw()\n    ScreenManager.draw()\nend\n\nfunction love.update(dt)\n    ScreenManager.update(dt)\nend\n```\nNote how MainScreen inherits from Screen.lua. This isn't mandatory, but recommended since Screen.lua already has templates for most of the callback functions.\n\n```lua\n-- MainScreen.lua\n\nlocal Screen = require('lib.Screen')\n\nlocal MainScreen = {}\n\nfunction MainScreen.new()\n    local self = Screen.new()\n\n    local x, y, w, h = 20, 20, 40, 20\n\n    function self:draw()\n        love.graphics.rectangle('fill', x, y, w, h)\n    end\n\n    function self:update(dt)\n        w = w + 2\n        h = h + 1\n    end\n\n    return self\nend\n\nreturn MainScreen\n```\n\n## Documentation\n\nAn online documentation is available [here](http://rm-code.github.io/screenmanager/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frm-code%2Fscreenmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frm-code%2Fscreenmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frm-code%2Fscreenmanager/lists"}