
目录最终效果核心原理像素块网格翻转动画悬停怎么触发可调参数适用场景完整代码工程下载形变与过渡系列最后一篇,做一个像素化过渡按钮:8×4=32 个小方块铺满按钮,悬停时逐块翻转变色,从旧色像素化过渡到新色。每块有独立的翻转动画和随机延迟,形成波浪式的过渡效果。最终效果200×80 的按钮,由 8×4=32 个 25×20 的小方块覆盖。悬停时逐块翻转(Y 方向压扁→换色→展开),从蓝色像素化过渡到紫色。每块翻转有随机延迟,形成波浪效果。核心原理核心就是 32 个小方块 + 每块独立翻转动画 + 随机延迟。像素块网格Grid { anchors.fill: parent columns: 8 rows: 4 spacing: 0 Repeater { id: pixelRepeater model: 32 Rectangle { id: pix width: 25; height: 20 property int flipDelay: Math.floor(Math.random() * 300) property color norm