Title: DefaultTextureAtlas.render_into and arcade.draw_texture_rect does nothing if atlas is resized · Issue #2760 · pythonarcade/arcade · GitHub
Open Graph Title: DefaultTextureAtlas.render_into and arcade.draw_texture_rect does nothing if atlas is resized · Issue #2760 · pythonarcade/arcade
X Title: DefaultTextureAtlas.render_into and arcade.draw_texture_rect does nothing if atlas is resized · Issue #2760 · pythonarcade/arcade
Description: If you within a DefaultTextureAtlas.render_into context yo use arcade.draw_texture_rect, passing it the current atlas and a texture that is not already in the atlas, then the atlas will get resized so fit the new texture, but the draw co...
Open Graph Description: If you within a DefaultTextureAtlas.render_into context yo use arcade.draw_texture_rect, passing it the current atlas and a texture that is not already in the atlas, then the atlas will get resized...
X Description: If you within a DefaultTextureAtlas.render_into context yo use arcade.draw_texture_rect, passing it the current atlas and a texture that is not already in the atlas, then the atlas will get resized...
Opengraph URL: https://github.com/pythonarcade/arcade/issues/2760
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"DefaultTextureAtlas.render_into and arcade.draw_texture_rect does nothing if atlas is resized","articleBody":"If you within a `DefaultTextureAtlas.render_into` context yo use `arcade.draw_texture_rect`, passing it the current atlas and a texture that is not already in the atlas, then the atlas will get resized so fit the new texture, but the draw command will fail to render anything. I am sure it is the resizing that causes it, since starting out with a big atlas or adding the texture to draw to the atlas beforehand both fixes the problem.\n\nMRE:\n```python\n\nfrom typing import Literal\nimport arcade\n\n\ndef mre(fix: None | Literal[\"big-atlas\", \"pre-add-texture\"]) -\u003e None:\n atlas_size = (1000, 1000) if fix == \"big-atlas\" else (100, 100)\n atlas = arcade.DefaultTextureAtlas(size=atlas_size)\n green_background_texture = arcade.Texture.create_empty(name=\"background\", size=(100, 100), color=arcade.color.GREEN)\n red_overlay_texture = arcade.Texture.create_empty(name=\"overlay\", size=(500, 500), color=arcade.color.RED)\n atlas.add(green_background_texture)\n if fix == \"pre-add-texture\":\n atlas.add(red_overlay_texture)\n with atlas.render_into(green_background_texture):\n arcade.draw_texture_rect(\n texture=red_overlay_texture,\n rect=arcade.Rect.from_kwargs(\n x=green_background_texture.width * 0.5,\n y=green_background_texture.height * 0.5,\n width=green_background_texture.width * 0.9,\n height=green_background_texture.height * 0.9,\n ),\n atlas=atlas,\n )\n atlas.update_texture_image_from_atlas(green_background_texture)\n green_background_texture.image.show(fix or \"broken\")\n\n\nif __name__ == \"__main__\":\n _ = arcade.Window(visible=False)\n mre(fix=None) # The green background texture does NOT have any red drawn on top of it\n mre(fix=\"big-atlas\") # The green background texture has a red square drawn on top of it, as it should\n mre(fix=\"pre-add-texture\") # The green background texture has a red square drawn on top of it, as it should\n```\n\nArcade 3.2.0\n------------\nvendor: Intel\nrenderer: Intel(R) UHD Graphics\nversion: (4, 6)\npython: 3.13.3 (tags/v3.13.3:6280bb5, Apr 8 2025, 14:47:33) [MSC v.1943 64 bit (AMD64)]\nplatform: win32\npyglet version: 2.1.6\nPIL version: 11.0.0\n","author":{"url":"https://github.com/bunny-therapist","@type":"Person","name":"bunny-therapist"},"datePublished":"2025-08-18T16:19:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2760/arcade/issues/2760"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1a841432-2848-6d2d-f3ea-20510269416e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B346:172311:694638:8D15B0:6969284F |
| html-safe-nonce | 6e8fc22efaf2252b447dae7dee0dc53d5b672041b2b92e7dcdda0842c4ad363b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzQ2OjE3MjMxMTo2OTQ2Mzg6OEQxNUIwOjY5NjkyODRGIiwidmlzaXRvcl9pZCI6IjgyMTE3NTE3MzY4MjkzNTYxMTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 281fbe5fc945bd6232eae6952247899cee22617ec0d0740203efde85b0f2e7ac |
| hovercard-subject-tag | issue:3331343428 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pythonarcade/arcade/2760/issue_layout |
| twitter:image | https://opengraph.githubassets.com/abcc801a5646a47030ca399ef0900eb233ba5d5096426f9c191a098d4a9398b5/pythonarcade/arcade/issues/2760 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/abcc801a5646a47030ca399ef0900eb233ba5d5096426f9c191a098d4a9398b5/pythonarcade/arcade/issues/2760 |
| og:image:alt | If you within a DefaultTextureAtlas.render_into context yo use arcade.draw_texture_rect, passing it the current atlas and a texture that is not already in the atlas, then the atlas will get resized... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bunny-therapist |
| hostname | github.com |
| expected-hostname | github.com |
| None | 54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonarcade/arcade git https://github.com/pythonarcade/arcade.git |
| octolytics-dimension-user_id | 39569439 |
| octolytics-dimension-user_login | pythonarcade |
| octolytics-dimension-repository_id | 49003082 |
| octolytics-dimension-repository_nwo | pythonarcade/arcade |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49003082 |
| octolytics-dimension-repository_network_root_nwo | pythonarcade/arcade |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d69ac0477df0f87da03b8b06cebd187012d7a930 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width