{"id":13524826,"url":"https://github.com/Vovkiv/resolution_solution","last_synced_at":"2025-04-01T03:32:50.317Z","repository":{"id":164989728,"uuid":"445624473","full_name":"Vovkiv/resolution_solution","owner":"Vovkiv","description":"Yet another scaling library. Currently in maintenance-only mode.","archived":false,"fork":false,"pushed_at":"2024-09-16T10:31:21.000Z","size":11101,"stargazers_count":25,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-16T12:08:49.331Z","etag":null,"topics":["documentation","game-development","library","love2d","lua","pixel-perfect","scaling","scaling-methods","single-file","stretch"],"latest_commit_sha":null,"homepage":"https://github.com/Vovkiv/resolution_solution","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vovkiv.png","metadata":{"files":{"readme":"README.md","changelog":"history/readme.md","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":"2022-01-07T19:00:50.000Z","updated_at":"2024-09-16T10:31:25.000Z","dependencies_parsed_at":"2024-01-15T19:20:25.550Z","dependency_job_id":"7e691971-912a-42f6-a170-54be8e2879b5","html_url":"https://github.com/Vovkiv/resolution_solution","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vovkiv%2Fresolution_solution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vovkiv%2Fresolution_solution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vovkiv%2Fresolution_solution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vovkiv%2Fresolution_solution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vovkiv","download_url":"https://codeload.github.com/Vovkiv/resolution_solution/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222698187,"owners_count":17024877,"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":["documentation","game-development","library","love2d","lua","pixel-perfect","scaling","scaling-methods","single-file","stretch"],"created_at":"2024-08-01T06:01:13.784Z","updated_at":"2024-11-02T09:30:32.605Z","avatar_url":"https://github.com/Vovkiv.png","language":"Lua","readme":"\n# Resolution Solution\n\nYet another scaling library. Currently in maintenance-only mode.\n\n---\n\nResolution Solution was inspired by:\n\n* [TLfres](https://love2d.org/wiki/TLfres)\n* [PUSH](https://github.com/Ulydev/push)\n* [SimpleScale](https://github.com/tomlum/simpleScale)\n\nOther similar scaling libraries that you might want to look into:\n\n* [Center](https://github.com/S-Walrus/center)\n* [maid64](https://github.com/adekto/maid64)\n* [love2d-pixelscale](https://github.com/DimitriBarronmore/love2d-pixelscale)\n* [CScreen](https://github.com/CodeNMore/CScreen)\n* [terebi](https://github.com/oniietzschan/terebi)\n* [FSAL](https://sourceforge.net/projects/fsal/)\n* [gb-screen](https://github.com/darkfrei/gb-screen)\n* [lovesize](https://github.com/RicardoBusta/lovesize)\n\n# Video demonstration\n\n[![](https://markdown-videos-api.jorgenkh.no/youtube/cslfWOpetrc)](https://youtu.be/cslfWOpetrc)\n\n# Basic setup\n1. Require library:\n\n```lua\nlocal rs = require(\"resolution_solution\")\n```\n\n2. Configure library:\n\n```lua\nrs.conf({game_width = 640, game_height = 480, scale_mode = rs.PIXEL_PERFECT_MODE})\n```\n\n3. Make window resizable (optionally, but stongly advised):\n\n```lua\nrs.setMode(rs.game_width, rs.game_height, {resizable = true})\n```\n\n4. Hook into `love.resize`:\n ```lua\nlove.resize = function(w, h)\n   rs.resize(w, h)\nend\n``` \n5. Draw something:\n\n_(In this example we used scissors, but there [another way](examples/basic_setup_with_canvas) to achieve this. Read [manual](resolution_solution_documentation.pdf) or check [examples](examples) for more info.)_\n```lua\nlove.draw = function()\n  rs.push()\n    local old_x, old_y, old_w, old_h = love.graphics.getScissor()\n    love.graphics.setScissor(rs.get_game_zone())\n    love.graphics.setColor(1, 1, 1)\n    \n    love.graphics.print(\"Hello, world!\", rs.game_width / 2, rs.game_height / 2)\n    \n    love.graphics.setScissor(old_x, old_y, old_w, old_h)\n  rs.pop()\nend\n```\n\n# Manual, examples, demo\n* [.pdf manual](resolution_solution_documentation.pdf).\n* [.odt manual](resolution_solution_documentation.odt).\n* [.love demo example that you can run](demo.love).\n* [Demo folder that you can run](demo) with `cd demo; love .`\n* [examples folder](examples).\n\n# Selling points of this library\n* Library have 4 scale modes and you can switch between at any time:\n  1. Aspect Scaling mode - scaling with preserved aspect.\n  2. Stretching - stretch game to fill entire window.\n  3. Pixel Perfect - will scale, using only integer scale factors and adds black bars if it can't. Must-have for pixel-art.\n  4. No Scale - as name suggests, nothing will be scalled. Might be useful for debugging or if you make some kind of program (e.g, game engine) where you need to switch between scaling for game itself and no scaling when user editing game scripts.\n\n* Library doesn't force you to use any specific way to scale your content, unlike some libraries. You can choose canvas, scissors, draw rectangles on top of game, shader, etc. Pick whatever you like!\n* Library written with [kikito's guide](https://web.archive.org/web/20190406163041/http://kiki.to/blog/2014/03/30/a-guide-to-authoring-lua-modules/) in mind, which resulted in very monkey-patchable library! No unreachable locals, no globals, nothing like that! Everything that library produces during calculations can be reached by simple accessing library table: `rs.game_width`, `rs.scale_mode`, `rs.game_zone.x`, etc. Hack and slash your way to make library suitable for your game!\n* Library has [.pdf manual](resolution_solution_documentation.pdf), that includes some illustrations, examples, explanations, tips and tricks. Single file documentation, that can be opened in almost anything, including your browser!\n* Written with `snake_case`. Before it was camelCase.\n* Library licensed under [`The Unlicense`](LICENSE). Do whatever you want with it with no restrictions!\n* This library supports type annotations in VSCode. To make it work, you need to use `---@type ResolutionSolution`.\n\n**Example:**\n```lua\nrs = require(\"resolution_solution\") ---@type ResolutionSolution\n```\n\n# Games made using this library\nBy togfoxy:\n\n* [Autarky2](https://github.com/togfoxy/Autarky2)\n* [SpaceFleetBattles](https://github.com/togfoxy/SpaceFleetBattles)\n* [FormulaSpeed](https://github.com/togfoxy/FormulaSpeed)\n* [Silent strike](https://codeberg.org/togfox/SilentStrike)\n\nBy [Gunroar](https://hmmmgames.itch.io/):\n\n* [YOU ARE DRAGON](https://hmmmgames.itch.io/dragon)\n* [Rem Psycho](https://hmmmgames.itch.io/rem-psyche)\n* [Dust: Battle Beneath](https://hmmmgames.itch.io/dust-bb)\n* [Joycoin](https://hmmmgames.itch.io/coingame)\n\nBy [Saxashitter](https://github.com/Saxashitter):\n\n* [UNSTOPPABLE-FUCK-Poyo-and-the-Refill-Mart](https://github.com/Saxashitter/UNSTOPPABLE-FUCK-Poyo-and-the-Refill-Mart/)\n\nIf you made game/program using this library, fell free to ask via [contacts](#contacts) to add your game in this list.\n\n# Announces\nI will post announces when new update will be dropped [here](https://love2d.org/forums/viewtopic.php?t=92494) or will create new release here on GitHub.\n\n# Contacts\nIf you have any questions about this library, have ideas, etc, you can contact me via:\n\n1. [Submit new issue](https://github.com/Vovkiv/resolution_solution/issues/new).\n2. [love forum](https://love2d.org/forums/memberlist.php?mode=viewprofile\u0026u=169762).\n3. [matrix](https://matrix.to/#/@vovkiv:matrix.org).\n4. Email - volkovissocool@gmail.com\n","funding_links":[],"categories":["Drawing"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVovkiv%2Fresolution_solution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVovkiv%2Fresolution_solution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVovkiv%2Fresolution_solution/lists"}