{"id":20596060,"url":"https://github.com/davidfig/rendersheet","last_synced_at":"2025-04-14T23:44:02.992Z","repository":{"id":44741094,"uuid":"62563481","full_name":"davidfig/rendersheet","owner":"davidfig","description":"renders a canvas spritesheet for use with pixi.js","archived":false,"fork":false,"pushed_at":"2022-12-04T23:46:27.000Z","size":3054,"stargazers_count":11,"open_issues_count":11,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T11:51:08.552Z","etag":null,"topics":[],"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/davidfig.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-07-04T13:16:17.000Z","updated_at":"2022-05-29T11:36:54.000Z","dependencies_parsed_at":"2023-01-23T00:45:44.951Z","dependency_job_id":null,"html_url":"https://github.com/davidfig/rendersheet","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/davidfig%2Frendersheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Frendersheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Frendersheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Frendersheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidfig","download_url":"https://codeload.github.com/davidfig/rendersheet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248889037,"owners_count":21178152,"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-11-16T08:14:54.496Z","updated_at":"2025-04-14T23:44:02.976Z","avatar_url":"https://github.com/davidfig.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## rendersheet.js\nGenerate on-the-fly spritesheets for pixi.js\n\n## Rationale\nI needed a way to generate spritesheets based on canvas drawings and/or images. This allows me to resize the drawings based on different resolutions. For canvas drawings, you pass the rendersheet two functions: a drawing function and a measure function.\n\n## Code Example\n\n    // set up rendersheet\n    var sheet = new RenderSheet();\n\n    // draw triangle textures on rendersheet\n    sheet.add('triangle', triangleDraw, triangleMeasure, {size: 50, 'red'});\n\n    // image texture on rendersheet\n    sheet.addImage('image', 'images/test.png');\n\n    // render the sheet\n    sheet.render();\n\n    // create a PIXI.Sprite using the rendersheet\n    var sprite = stage.addChild(sheet.get('triangle'));\n\n    // use a PIXI.Texture from the rendershet\n    var image = stage.addChild(new PIXI.Sprite(sheet.getTexture('image')));\n\n    // drawing function to generate the canvas triangle\n    function triangleDraw(c, params)\n    {\n        var size = params.size;\n        var half = params.size / 2;\n        c.beginPath();\n        c.fillStyle = params.color;\n        c.moveTo(half, 0);\n        c.lineTo(0, size);\n        c.lineTo(size, size);\n        c.closePath();\n        c.fill();\n    }\n\n    // measure function to provide dimensions for canvas triangle\n    function triangleMeasure(c, params)\n    {\n        return { width: params.size, height: params.size };\n    }\n\n## Installation\n\n    npm i yy-rendersheet\n\n## Live Example\nhttps://davidfig.github.io/rendersheet/\n\n## API Documentation\nhttps://davidfig.github.io/rendersheet/jsdoc\n\n## license  \nMIT License  \n(c) 2019 [YOPEY YOPEY LLC](https://yopeyopey.com/) by [David Figatner](https://twitter.com/yopey_yopey/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidfig%2Frendersheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidfig%2Frendersheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidfig%2Frendersheet/lists"}