---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.com/dev/games/doc/en/sdk/construct-3/sprite.md
  - https://yandex.com/dev/games/doc/hi/sdk/construct-3/sprite.md
  - https://yandex.com/dev/games/doc/ko/sdk/construct-3/sprite.md
  - https://yandex.com/dev/games/doc/ru/sdk/construct-3/sprite.md
  - https://yandex.com/dev/games/doc/tr/sdk/construct-3/sprite.md
  - https://yandex.com/dev/games/doc/vi/sdk/construct-3/sprite.md
  - https://yandex.com/dev/games/doc/zh/sdk/construct-3/sprite.md
  - href: zh/sdk/construct-3/sprite.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/games/doc/zh/llms.txt

# 本地化图形精灵

<!-- source: zh/_includes/script-common.md -->
<!-- source: zh/_includes/script/index-js.md -->

<!-- endsource: zh/_includes/script/index-js.md -->

<!-- source: zh/_includes/script/requirements-js.md -->

<!-- endsource: zh/_includes/script/requirements-js.md -->

<!-- source: zh/_includes/script/image-modal-js.md -->

<!-- endsource: zh/_includes/script/image-modal-js.md -->
<!-- endsource: zh/_includes/script-common.md -->

在游戏中有时也需要对图形精灵进行本地化。我们创建了一种方便的方法，让您可以轻松地为不同语言添加图形精灵的变体，而无需对项目的其他部分做任何更改。

{% note info %}

要启用图形精灵的本地化，您需要为所有需要的语言创建翻译文件。

{% endnote %}



## 添加动画 {#animation}

要创建本地化图形精灵，只需在精灵的动画列表中添加带有所需[语言代码](https://yandex.com/dev/games/doc/zh/concepts/languages-and-domains.md)的新动画。

创建图形精灵，添加目标语言代码的新动画，并添加图形。最终结果应如下所示：

{% note warning %}

确保图形精灵中没有名称不匹配任何[支持的语言代码](https://yandex.com/dev/games/doc/zh/concepts/languages-and-domains.md)的额外动画。否则，插件将在本地化期间跳过该精灵。

{% endnote %}

![](../../_images/construct-3/sprite/animations.gif)

现在，当我们点击播放（预览）按钮时，会看到我们的图形精灵自动切换到与玩家当前语言匹配的动画。

![](../../_images/construct-3/sprite/runtime.webp)


---


<!-- source: zh/_includes/button-git.md -->
<a href="https://github.com/yandex-games-plugins/construct3">
  <span class="button">存储库</span>
</a>
<!-- endsource: zh/_includes/button-git.md -->
