# Texture resource reassignment and live pixel updates. ```{raw} html ▶ Run in browser ``` **Tags:** `2d` Three ways a texture changes at runtime, side by side: - **Reassign** a sprite's ``texture`` to a different source. The renderer re-resolves and the new image appears; the old one is not latched. - **Mutate the pixels in place** behind a :class:`~simvx.core.Texture` and call ``update()``. The GPU slot stays the same, so nothing has to be reassigned -- the image behind the handle is replaced. - **Swap the source** with ``update(new_pixels)``, the cheaper route when the replacement is a fresh array rather than an in-place edit. It has to be the same size: a texture's size is fixed, and a bigger image is a new ``Texture`` assigned over the old -- which is the first case above. A plain path, bytes or ndarray still works everywhere and is the right short spelling for an image that never changes. Wrap it in a ``Texture`` when it does. Press SPACE to pause the animation; the panels keep their last frame. Run: uv run python examples/features/2d/texture_resource.py Headless self-check: uv run python examples/features/2d/texture_resource.py --test ## Source ```{literalinclude} ../../examples/features/2d/texture_resource.py :language: python :linenos: ```