---
name: download_button.aicomponent
description: 下载转化按钮（CTA）。胶囊形状按钮，带呼吸动画，点击时调用 sdk.install() 触发应用安装转化，是试玩广告的核心转化入口。
triggers: 需要在试玩广告中实现下载/安装按钮时触发。
---

# 下载转化按钮（Download CTA Button）

## Scaffold

`src/game/scenes/GameUI/DownloadButton.ts`

## Recipe

| 决策 | 原因 |
|------|------|
| **呼吸动画持续吸引注意** | 静态按钮容易被玩家忽视；轻微的缩放呼吸动画（1.0 → 1.05 → 1.0 循环）在不打扰游戏体验的前提下保持 CTA 可见性 |
| **sdk.install() 集中在组件内** | 下载转化调用点集中在 DownloadButton，不分散在 LevelLifecycle/GameOverPanel 中；便于追踪转化路径和 A/B 测试 |
| **胶囊形状** | 胶囊（圆角矩形）按钮是 App Store CTA 的标准视觉语言，用户识别成本低 |

## Adapter

- **Role**: `downloadCta` — 下载转化按钮（呼吸动画 + sdk.install() 触发）
- **Provides**: `DownloadButton` 类（`show(x, y)`、`hide()`，内置呼吸动画）
- **Requires**: `phaser.aicomponent`、`tencent_playable_sdk.aicomponent`（sdk.install()）
- **Consumed by**: `game_over_panel.aicomponent`（胜利/失败面板内嵌 CTA）
- **Integration point**: `src/game/scenes/GameUI/DownloadButton.ts` → GameOverPanel 内部实例化

## Imports

- `phaser.aicomponent`（硬依赖）
- `tencent_playable_sdk.aicomponent`（硬依赖：sdk.install()）

## Skill Definition

```yaml
tools:
  - read_file
  - write_file
inputs:
  - source: src/game/scenes/GameUI/DownloadButton.ts
outputs:
  - downloadButton: DownloadButton class (with breathing animation + sdk.install call)
```
