{"id":18299901,"url":"https://github.com/gamestdio/dsplay","last_synced_at":"2025-04-09T09:25:08.667Z","repository":{"id":57216755,"uuid":"50391660","full_name":"gamestdio/dsplay","owner":"gamestdio","description":"A simple display list for canvas 2D.","archived":false,"fork":false,"pushed_at":"2017-01-30T12:23:21.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T02:06:15.263Z","etag":null,"topics":["canvas"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gamestdio.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":"2016-01-26T00:40:24.000Z","updated_at":"2017-02-18T12:58:15.000Z","dependencies_parsed_at":"2022-08-28T21:01:11.335Z","dependency_job_id":null,"html_url":"https://github.com/gamestdio/dsplay","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamestdio%2Fdsplay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamestdio%2Fdsplay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamestdio%2Fdsplay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamestdio%2Fdsplay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gamestdio","download_url":"https://codeload.github.com/gamestdio/dsplay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248010089,"owners_count":21032846,"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":["canvas"],"created_at":"2024-11-05T15:10:40.226Z","updated_at":"2025-04-09T09:25:08.645Z","avatar_url":"https://github.com/gamestdio.png","language":"JavaScript","readme":"# DSPLAY\n\nA simple display list for canvas 2D.\n\n### HTML Setup\n- Download:\n- Include: `\u003cscript src=\"dsplay.min.js\" charset=\"utf-8\"\u003e\u003c/script\u003e`\n\n### Node/Browserify Setup\n- Install: `npm install dsplay`\n- Include: `var dsplay = require('dsplay');`\n\n### Usage\n```javascript\n// Everything starts with a Renderer and a Sprite:\nvar renderer = new dsplay.Renderer(canvas);\nvar container = new dsplay.Sprite();\n\n// Sprites are just transform entities, so you need to draw stuff by yourself:\nvar box = new dsplay.Sprite();\ncontainer.add(box);\nbox.draw = (ctx) =\u003e {\n  ctx.fillStyle = '#FF0000';\n  ctx.fillRect(0, 0, 64, 64);\n}\n\n// Render loop:\nrender();\nfunction render() {\n  renderer.render(container);\n  requestAnimationFrame(render);\n}\n\n// Also, there are some useful sprite-based objects, like Img:\nvar img = new dsplay.Img();\ncontainer.add(img);\nimg.y = 80;\nimg.load('https://goo.gl/QHEIDK');\n\n// And Label:\nvar label = new dsplay.Label();\ncontainer.add(label);\nlabel.x = 80;\nlabel.color = '#FFFFFF';\nlabel.text = 'Hello world!';\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamestdio%2Fdsplay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgamestdio%2Fdsplay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamestdio%2Fdsplay/lists"}