{"id":17011233,"url":"https://github.com/sysl-dev/sysl-pixel","last_synced_at":"2025-08-02T00:39:30.771Z","repository":{"id":191061113,"uuid":"83158989","full_name":"sysl-dev/Sysl-Pixel","owner":"sysl-dev","description":"Pixel Art Focused Game Art Scale Module for Love2D.","archived":false,"fork":false,"pushed_at":"2020-06-10T18:08:43.000Z","size":94,"stargazers_count":31,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T14:05:44.499Z","etag":null,"topics":[],"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/sysl-dev.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}},"created_at":"2017-02-25T20:04:49.000Z","updated_at":"2025-03-23T14:56:24.000Z","dependencies_parsed_at":"2023-08-27T23:40:49.696Z","dependency_job_id":null,"html_url":"https://github.com/sysl-dev/Sysl-Pixel","commit_stats":null,"previous_names":["sysl-dev/sysl-pixel"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysl-dev%2FSysl-Pixel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysl-dev%2FSysl-Pixel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysl-dev%2FSysl-Pixel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysl-dev%2FSysl-Pixel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysl-dev","download_url":"https://codeload.github.com/sysl-dev/Sysl-Pixel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248540845,"owners_count":21121437,"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":[],"created_at":"2024-10-14T06:06:32.984Z","updated_at":"2025-04-12T08:34:35.425Z","avatar_url":"https://github.com/sysl-dev.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SYSL-Pixel\nSYSL-Pixels is a pixel-art focused screen scaling module for Love2d.\n\n## Important Information\nSYSL-Pixel will modify the following global Love2D Settings if ```apply_global_scaling_changes``` is enabled. \n```Lua\nlove.graphics.setDefaultFilter(\"nearest\", \"nearest\", 1)\nlove.graphics.setLineStyle(\"rough\")\n```\nThis will force all graphics added after SYSL-Pixel (Pixel) is loaded to use nearest scaling, and all shapes to use the rough line style.\n\n## Configuration\n* **allow_window_resize**\n\t* Default: false\n\t* Allows the user to resize the window from the system window manager. Disabled by default due to issues with some Linux window managers. Reccomened to test with people before using.\n* **apply_global_scaling_changes**\n\t* Default: true\n\t* See the Important Information above.\n* **pixel_perfect_fullscreen**\n\t*  Default: false\n\t* Forces scaling, even when in full-screen view to be interger scaled. Defaults to off to avoid black borders all around the game content instead of just to the sides or above/below.\n* **m.current_cursor**\n\t*  Default: 1\n\t*  The graphical cursor to use, if you are using the operation system (OS) cursor, set it to 0.\n* **m.show_system_cursor_startup**\n\t* Default: false \n\t* Show or Hide the OS Cursor on game load.\n\n## Cursor Table Format\nPath to Image (String) | -X Offset (Int) | -Y Offset (Int)\n-|-|-\nExample|From|Module\n'assets/cursor1.png' | 0 | 0\n'assets/cursor2.png' | -8 | -8\n'assets/cursor3.png' | -16 | -6\n\n## Using the Module\n**conf.lua requirements**\n```lua\nfunction love.conf(t)\n--Snip\nt.window.width = 320 -- Base Width that we scale up.\nt.window.height = 180 -- Base Height that we scale up.\nt.window.resizable = false -- Controled though allow_window_resize, set false in conf.\nt.window.minwidth = 320 -- Should match Width\nt.window.minheight = 180 -- Should match Height\n--Snip\nend\n```\n\nLoading the Module\n```lua\n-- Assumes you store your modules under a folder called lib, update path as required.\ngscreen = require('lib.sysl.pixel')\ngscreen.load(4) -- Draw at 4x Size.\n```\n\nIn love.draw()\n```lua\nfunction love.draw()\n  gscreen.start()\n  -- EVERYTHING DRAWN BELOW IS SCALED.\n  love.graphics.rectangle(\"fill\", 1,1,1,1) -- Things drawn will scale.\n  -- EVERYTHING DRAWN ABOVE IS SCALED.\n  gscreen.stop()\n  -- Things drawn here will *not* scale.\nend\n```\n\nIn love.update()\n```lua\nfunction love.update(dt)\n-- Update Pixel\n   gscreen.update(dt)\nend\n```\n\n## Module Functions\n\n### Screen Scaling\n\n#### gscreen.set_game_scale(int)\nSet the game scale to the window.width/window.height * your scale. Used to resize the window.\n\n#### gscreen.toggle_fullscreen()\nToggles between full-screen and windowed mode. When returning from full-screen, it will return to the largest possible full-screen window.\n\n### Pixel Mouse\n\n#### gscreen.toggle_cursor()\nToggles the OS Cursor on and off.\n\n#### gscreen.force_cursor(bool)\nTrue/False, enable/disable the system cursor.\n\n#### gscreen.set_cursor(int)\nSet the graphical cursor to one of your cursors defined in the cursor table. \n\n#### gscreen.get_cursor_count()\nReturns the number of cursors in the cursor table.\n\n#### gscreen.mouse_over(int_x, int_y, int_width, int_height)\nCheck to see if the pixel mouse is in an area. Default mouse area is 1x1, see module if you need to make changes.\n\n### Full Screen Shader\n\n#### gscreen.push_shader(love_shader)\nPush a shader to Pixel's shader stack to apply to the screen.\n\n#### gscreen.pop_shader()\nRemove the last shader added to the shader stack.\n\n#### gscreen.clear_all_shader()\nClear all shaders applied to the screen.\n\n#### gscreen.count_shader()\nCount the number of shaders applied to the screen.\n\n#### gscreen.change_draw_after_shader(function)\nDo this function after shaders are applied. Useful for drawing a frame, or other information after the shader.\n\n#### gscreen.clear_draw_after_shader()\nClear the function that was set by you in the function above.\n\n### Screenshot Tools\n\n#### gscreen.capture_canvas(string)\nCapture the current screen, store it as a image for use later. *Does not last past the game closing*\n\n#### gscreen.flush_capture()\nErase all captures.\n\n#### gscreen.remove_capture(string)\nRemove a capture that you took.\n\n#### gscreen.check_capture(string)\nCheck if a capture exists.\n\n#### gscreen.draw_capture(string, ...)\nDraw a capture, checks to see if it exists first. Follows the format of love.graphics.draw() for arguments. \n\n\n### Bonus Notes\n#### Using with HUMP-Camera\nWhen attaching the camera, you'll have to pass along the scale information.\n```camera:attach(0, 0, love.graphics.getWidth() / gscreen.scale, love.graphics.getHeight() / gscreen.scale, \"noclip\")```\n#### Extra Scaling with gscreen.stop()\n```gscreen.stop(hx, hy, hr, hsx, hsy)``` allows you to modify the canvas and adjust the scale. The arguements are as follows:\n* X Postion\n* Y Postion\n* Rotation\n* Scale X\n* Scale Y\n\n### Screenshots \n![Screenshot of Library](/screenshot/i1.png?raw=true)\n![Screenshot of Library](/screenshot/i2.png?raw=true)\n![Screenshot of Library](/screenshot/i3.png?raw=true)\n![Screenshot of Library](/screenshot/i4.png?raw=true)\n![Screenshot of Library](/screenshot/i5.png?raw=true)\n![Screenshot of Library](/screenshot/i6.png?raw=true)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysl-dev%2Fsysl-pixel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysl-dev%2Fsysl-pixel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysl-dev%2Fsysl-pixel/lists"}