{"id":15104055,"url":"https://github.com/tourahi/binocles","last_synced_at":"2025-09-27T02:32:17.246Z","repository":{"id":54107263,"uuid":"317580041","full_name":"Tourahi/Binocles","owner":"Tourahi","description":"Debug your Love2D based game in a simple way.","archived":true,"fork":false,"pushed_at":"2021-06-29T22:34:38.000Z","size":130,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-17T14:35:41.901Z","etag":null,"topics":["console","console-debugger","debug","debugging","dump","ingame","love2d","love2d-framework","watch-files","watch-variable"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tourahi.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}},"created_at":"2020-12-01T15:12:37.000Z","updated_at":"2024-05-26T00:59:00.000Z","dependencies_parsed_at":"2022-08-13T06:50:38.566Z","dependency_job_id":null,"html_url":"https://github.com/Tourahi/Binocles","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Tourahi/Binocles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tourahi%2FBinocles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tourahi%2FBinocles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tourahi%2FBinocles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tourahi%2FBinocles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tourahi","download_url":"https://codeload.github.com/Tourahi/Binocles/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tourahi%2FBinocles/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277171589,"owners_count":25773246,"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-09-27T02:00:08.978Z","response_time":73,"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":["console","console-debugger","debug","debugging","dump","ingame","love2d","love2d-framework","watch-files","watch-variable"],"created_at":"2024-09-25T20:00:28.710Z","updated_at":"2025-09-27T02:32:17.019Z","avatar_url":"https://github.com/Tourahi.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Binocles\nDebugging Love2D in a simple way.\n\nBinocles is a module based on Monocle https://github.com/kjarvi/monocle.\nthis module gives the ability to easily :\n\n  1. watch variables and complex expressions\n  2. watch files and reload them when they change\n  3. Reloads the game after any watched files have been changed.\n  4. Custom colors\n  5. Add Global variables to the listener from the console.\n  6. Since the latest updates now you can watch nested tables recursively.\n\nThe setup of a basic main.lua file is as follows:\n\nNote : Make sure to run the game from the console or use --console so you can see the listener output.\n\n```lua\n\nBinocles = require(\"Binocles\");\n\nlocal test = 0;\nlocal player = {\n  healt = 100,\n  x = 10,\n  y = 23.3,\n  skills_lvl = {\n    magic = 2,\n    conjuring = 4,\n    tinkering = 5,\n    sub_skills = {\n      magical_tinkering = 4\n    }\n  }\n}\n\nfunction love.load(arg)\n  Binocles();\n  -- Watch the FPS\n  Binocles:watch(\"FPS\", function() return math.floor(1/love.timer.getDelta()) end);\n  Binocles:watch(\"test\",function() return test end);\n  Binocles:watch(\"player\",function() return player end);\n\n  Binocles:setPosition(10 ,1);\n  Binocles:watchFiles( { 'main.lua' } ); -- Add files so the game reloads if they changed.\n  Binocles:addColors( { {0.9,0.5,0.2,1.0} } ) -- Add colors to the pallete.\n\n  --------------------------------------------------------------------------\n  -- You can use Binocles.dump to print an object to the console directly.--\n  --------------------------------------------------------------------------\nend\n\n\nfunction love.update(dt)\n  Binocles:update();\nend\n\nfunction love.draw()\n  Binocles:draw();\nend\n\nfunction love.keypressed(key)\n  test = test + 1; -- inc test every time a key is pressed\n  Binocles:keypressed(key);\nend\n\n```\n* Result :\n  * ![Screenshot from 2021-03-04 22-47-06](https://github.com/maromaroXD/Binocles/blob/master/public/imgs/Screenshot%20from%202021-06-26%2012-13-57.png)\n\n\nFor Moonscript:\n```lua\n export Binocles = assert require \"Binocles\"\n with love\n   .load = () -\u003e\n     Binocles!\n     Binocles\\watch \"FPS\",-\u003e love.timer.getFPS!\n```\n\nOptions :\n* You can send an options array in the constructor : Binocles(options);\n```lua\noptions.active -- if bonocles is active (drawing)\noptions.customPrinter -- activate printing to console\noptions.draw_x -- x pos of the Bonocles instance (Used in :draw())\noptions.draw_y  -- y pos of the Bonocles instance (Used in :draw())\noptions.printColor -- text color (will be sent to love.graphics.setColor())\noptions.debugToggle -- Toggle (change the satate of self.active)\noptions.consoleToggle -- Start the interaction with the listener from the console\noptions.colorToggle -- toggle to change the printing color\noptions.watchedFiles  -- files to watch\n\noptions.restart --[[\n* if true :  Restarts the game without relaunching the executable. This cleanly shuts down the main Lua state instance and creates a brand new one.\n* if false : will reload only the watched file if it got modified (ctrl-s).\n]]--\n\n```\n\nConsole Example :\n\n![Screenshot from 2021-03-04 22-47-06](https://github.com/maromaroXD/Binocles/blob/master/public/imgs/Screenshot%20from%202021-03-04%2022-47-06.png)\n\n* Click \"f3\" Use \",\" as a delimiter:\n\n![Screenshot from 2021-03-04 22-48-39](https://github.com/maromaroXD/Binocles/blob/master/public/imgs/Screenshot%20from%202021-03-04%2022-48-39.png)\n\n![Screenshot from 2021-03-04 22-48-52](https://github.com/maromaroXD/Binocles/blob/master/public/imgs/Screenshot%20from%202021-03-04%2022-48-52.png)\n\n* Or you can just give the table name :\n\n![Screenshot from 2021-03-09 09-52-33](https://github.com/maromaroXD/Binocles/blob/master/public/imgs/Screenshot%20from%202021-03-09%2009-52-33.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftourahi%2Fbinocles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftourahi%2Fbinocles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftourahi%2Fbinocles/lists"}