# @combos-fun/plugin-renderer-text

@combos-fun/plugin-renderer-text — part of the Combos Fun engine monorepo.

Keywords: `text`, `label`, `font`, `string`, `2d`.

## Documentation

- Per-package agent / developer notes: [`agent-skill.md`](./agent-skill.md)
- Machine-readable manifest: [`combos-plugin.json`](./combos-plugin.json)
  (validated against `schemas/combos-plugin.schema.json` in the repo
  root)
- Entry skill (single source of truth for AI agents working with this
  monorepo): `skills/combos-engine-development/SKILL.md`

When consumed from npm, the manifest and agent notes are exposed as
stable subpaths:

```ts
import manifest from '@combos-fun/plugin-renderer-text/plugin-manifest';
// or fetch the markdown directly:
// require.resolve('@combos-fun/plugin-renderer-text/agent-skill')
```

## Copy

Every player-facing string is a `text` template: titles, buttons, HUD labels, menus, toasts. Only values that change with logic (scores, counts, timers, names) go in `replacements`. `sourceLocale` is the written language of those templates. List every template in `sourceTexts`, including later screens.

```ts
const textSystem = new TextSystem({
  sourceLocale: 'zh-CN',
  sourceTexts: [
    '{player} 获得了 {score} 分',
    '开始游戏',
    '下一屏文案',
  ],
});
```

```ts
new Text({
  text: '{player} 获得了 {score} 分',
  replacements: {
    player: 'Alice',
    score: 100,
  },
});
```

Missing replacements stay as the `{name}` placeholder. Omitting `sourceLocale` leaves every label in the source language.

## License

Internal workspace package, part of the Combos Fun engine monorepo.
