{"id":16122113,"url":"https://github.com/foxcapades/renpy-horizontal-parallax","last_synced_at":"2026-01-20T21:02:29.495Z","repository":{"id":184305742,"uuid":"671650474","full_name":"Foxcapades/renpy-horizontal-parallax","owner":"Foxcapades","description":"Configurable scrolling images with a parallax effect.","archived":false,"fork":false,"pushed_at":"2025-02-10T18:23:58.000Z","size":26200,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T11:48:42.470Z","etag":null,"topics":["displayable","parallax","renpy","scrolling"],"latest_commit_sha":null,"homepage":"","language":"Ren'Py","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/Foxcapades.png","metadata":{"files":{"readme":"readme.adoc","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-27T20:16:11.000Z","updated_at":"2025-02-10T18:24:02.000Z","dependencies_parsed_at":"2024-11-01T05:25:27.874Z","dependency_job_id":"be39f338-0859-4901-b279-87c503d0cd8a","html_url":"https://github.com/Foxcapades/renpy-horizontal-parallax","commit_stats":{"total_commits":30,"total_committers":1,"mean_commits":30.0,"dds":0.0,"last_synced_commit":"6a160cdbd82efba4158c58f82d0ef73509846788"},"previous_names":["foxcapades/renpy-parallax-displayable","foxcapades/renpy-parallax-scroll","foxcapades/renpy-horizontal-parallax"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Foxcapades/renpy-horizontal-parallax","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Frenpy-horizontal-parallax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Frenpy-horizontal-parallax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Frenpy-horizontal-parallax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Frenpy-horizontal-parallax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Foxcapades","download_url":"https://codeload.github.com/Foxcapades/renpy-horizontal-parallax/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Frenpy-horizontal-parallax/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28613659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["displayable","parallax","renpy","scrolling"],"created_at":"2024-10-09T21:09:24.379Z","updated_at":"2026-01-20T21:02:29.408Z","avatar_url":"https://github.com/Foxcapades.png","language":"Ren'Py","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Ren'Py Horizontal Parallax\n:icons: font\n\nlink:https://github.com/Foxcapades/renpy-horizontal-parallax/releases/latest[Latest Release]\n|\nlink:https://foxcapades.itch.io/parallax-scroll[Itch.io]\n|\nlink:https://github.com/Foxcapades/renpy-horizontal-parallax/blob/main/game/lib/fxcpds/h_parallax/parallax_ren.py[Source]\n\nSource code and demonstration of a scrolling displayable built on multiple\nlayers with a parallax effect.\n\nimage::.assets/gh-preview.gif[]\n\n[IMPORTANT]\n--\nHParallax is only compatible with Ren'Py 8.1+.\n--\n\n== Usage\n\n=== Via Statement Block\n\n[source, python]\n----\nh_parallax foo:\n    \"images/backgrounds/scrolling_forest/10.png\" 0.0    # Doesn't scroll\n    \"images/backgrounds/scrolling_forest/09.png\" 0.001\n    \"images/backgrounds/scrolling_forest/08.png\" 0.0025\n    \"images/backgrounds/scrolling_forest/07.png\" 0.005\n    \"images/backgrounds/scrolling_forest/06.png\" 0.0075\n    \"images/backgrounds/scrolling_forest/05.png\" 0.025\n    \"images/backgrounds/scrolling_forest/04.png\" 0.025\n    \"images/backgrounds/scrolling_forest/03.png\" 0.05\n    \"images/backgrounds/scrolling_forest/02.png\" 0.05\n    \"images/backgrounds/scrolling_forest/01.png\" 0.075\n    \"images/backgrounds/scrolling_forest/00.png\" 0.1    # Scrolls 10% of its width per second\n----\n\n\nThe `h_parallax` statement declares a new parallax image with the given name\n(\"foo\" in the above example) constructed of the frames and frame scroll speeds\ngiven in the following block.\n\nEach line in the block may be one of the following things:\n\n* An image name/path followed by a scroll speed value.\n* The `height` keyword followed by an int value declaring the ``h_parallax``'s\ndisplay height.\n* The `width` keyword followed by an int value declaring the ``h_parallax``'s\ndisplay width.\n* The `direction` keyword followed by either the string `'left'` or `'right'`.\n* The `render_delay` keyword followed by a float value declaring the delay\nbetween frames in the scrolling animation.\n\nThe given layers are rendered in back to front order with the first declared\nlayer being on the bottom and the last declared layer being on top.\n\n==== Optional Properties\n\n`height \u003cint\u003e`::\nA height value for the `h_parallax`.  Controls the display height that the\nparallax scroll will be cropped to.  This value should match the size of the\nimages being used in the scroll.\n+\nDefaults to `config.screen_height`.\n+\n[source, python]\n----\nh_parallax bar:\n    height 600\n----\n\n`width \u003cint\u003e`::\nA width value for the `h_parallax`.  Controls the display width that the\nparallax scroll will be cropped to.  This value should match the size of the\nimages being used in the scroll.\n+\nDefaults to `config.screen_width`.\n+\n[source, python]\n----\nh_parallax fizz:\n    width 800\n----\n\n`direction \u003c\"left\"|\"right\"\u003e`::\nThe scroll direction for the parallax scroll.  Must be one of the strings\n`\"left\"` or `\"right\"`.\n+\nA value of `\"left\"` causes the parallax scroll to move from right to left.  A\nvalue of `\"right\"` causes the parallax scroll to move from left to right.\n+\nDefaults to `\"left\"`.\n+\n[source, python]\n----\nh_parallax buzz:\n    direction \"left\"\n----\n\n`render_delay \u003cfloat\u003e`::\nThe delay between render frames for the scroll.  A smaller value means a\nsmoother animation.\n+\nDefaults to `0.01`\n+\n[source, python]\n----\nh_parallax foo:\n    render_delay 0.01\n----\n\n\n=== Via Class Constructor\n\n[source, python]\n----\nimage foo = HParallax(\n    (\"images/backgrounds/scrolling_forest/10.png\", 0.0),    # Doesn't scroll\n    (\"images/backgrounds/scrolling_forest/09.png\", 0.001),\n    (\"images/backgrounds/scrolling_forest/08.png\", 0.0025),\n    (\"images/backgrounds/scrolling_forest/07.png\", 0.005),\n    (\"images/backgrounds/scrolling_forest/06.png\", 0.0075),\n    (\"images/backgrounds/scrolling_forest/05.png\", 0.025),\n    (\"images/backgrounds/scrolling_forest/04.png\", 0.025),\n    (\"images/backgrounds/scrolling_forest/03.png\", 0.05),\n    (\"images/backgrounds/scrolling_forest/02.png\", 0.05),\n    (\"images/backgrounds/scrolling_forest/01.png\", 0.075),\n    (\"images/backgrounds/scrolling_forest/00.png\", 0.1),    # Scrolls 10% of its width per second\n)\n----\n\n\n==== `+__init__+`\n\n[source, python]\n----\ndef __init__(self, *layers, **kwargs)\n----\n\n===== Positional Arguments\n\n`*layers : tuple[renpy.Displayable | str, float]`::\n+\nOne or more two-tuples that each contain a displayable to render and a float\nwhich represents the scrolling speed of the layer.\n+\nThe first value of each tuple MUST be either an instance of renpy.Displayable\n(Composite, Image, Transform, etc.) or a string representing the name of or path\nto a defined image or an image file.\n+\nThe second value of each tuple MUST be a float value between `0.0` and `1.0`\ninclusive.  This value represents the percent of the layer image's width that\nwill scroll across the screen per second.\n+\nThe layers are ordered back to front, meaning the first given layer will be the\nfurthest from the player while the last given layer will be the closest.\n\n\n===== Keyword Arguments\n\n`direction : \"left\"|\"right\"`::\n+\nControls the direction the HParallax layers will scroll.\n+\nA value of \"left\" means the layers will scroll from right to left, where a value\nof \"right\" means the layers will scroll from left to right.\n+\nAny other value passed as the `direction` argument will cause an exception to be\nraised.\n+\nDefaults to `\"left\"`.\n\n`render_delay : float`::\n+\nControls the delay between Displayable re-renders.\n+\nDefaults to `0.01`\n\n`height : int`::\n+\nControls the display height of the parallax.  The displayable will be cropped to\nthis height.  This value should match the size of the source image.\n+\nDefaults to `config.screen_height`\n\n`width : int`::\n+\nControls the display width of the parallax.  The displayable will be cropped to\nthis width.  This value should match the size of the source image.\n\n\n\n=== Advanced Usage\n\nThe `HParallax` class extends Ren'Py's `Transform` type, meaning any\nnormal transform keyword argument is permitted and will be applied to the\n`HParallax`.\n\nFor example, the colors of the parallax may be inverted by doing the following:\n\n[source, python]\n----\nHParallax(\n  ... # dimensions\n  ... # layers\n  matrixcolor=InvertMatrix(1.0)\n)\n----\n\nThe exception to the above rule is the `crop` keyword argument, which is used\nto contain the scrollable within it's configured size boundaries.  Specifying\nthe `crop` keyword will result in an `Exception` being raised.\n\n\n=== About Layers\n\nEach layer consists of a single image or Displayable that is repeated on the\nx-axis to fill the target width for the ParallaxScroll.  Each layer is stacked\non top of one another in the given order with each layer given it's own scroll\nspeed to create the parallax effect.\n\nLayer displayables will only be repeated along the x-axis and will be positioned\nat the top of the ParallaxScroll bounding box.\n\nWhile the first layer given (the layer furthest back in the image) may or may\nnot have transparency, the layers above it should have some transparency to show\nthrough to the layers underneath.  This makes PNG files a perfect fit unless you\nare creating the images on the fly via a Creator Defined Displayable or some\nother mechanism.\n\n\n== Credits\n\n* link:https://edermunizz.itch.io/free-pixel-art-forest[Background layers] by https://edermunizz.itch.io/[Eder Muniz]\n\n\n== License\n\nThis source code and project are released under the MIT license, which to\nparaphrase in a way that is not legally binding:\n\n* You can use it for free things\n* You can use it for paid things\n* You can modify it however you see fit\n* You can redistribute it as you see fit\n* Go nuts!\n\nFor a better breakdown of what the license actually means see:\nhttps://choosealicense.com/licenses/mit/\n\nI do ask that you credit me in some way, but if you don't I'm not gonna call the\nopen-source police on you.  If you do choose to credit me you can do so by\nproviding a link to my link:https://github.com/Foxcapades[GitHub], my\nlink:https://foxcapades.itch.io/[Itch.io], or just call me Foxcapades.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxcapades%2Frenpy-horizontal-parallax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxcapades%2Frenpy-horizontal-parallax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxcapades%2Frenpy-horizontal-parallax/lists"}