topbar hover 效果

This commit is contained in:
2025-06-05 18:05:32 +08:00
parent 4b926ac64c
commit 04ffc99c1a

View File

@@ -148,10 +148,12 @@ export class TopBar extends Laya.Script {
this.item_sprites.forEach((sprite: Laya.Sprite) => {
sprite.graphics.clear()
sprite.graphics.drawRoundRect(0, 0, sprite.width, sprite.height, 12, 12, 12, 12, "#f5f7fb")
sprite.alpha = 1
})
const sprite = this.item_sprites.get(difficulty)
sprite.graphics.clear()
sprite.graphics.drawRoundRect(0, 0, sprite.width, sprite.height, 12, 12, 12, 12, "#f5f7fb", "#1d5cdc", 3)
sprite.alpha = 1
this.item_labels.forEach((label: Laya.Label) => {
label.color = "#0e2a53"
@@ -169,6 +171,7 @@ export class TopBar extends Laya.Script {
const sprite = Box.getChildByName("Sprite") as Laya.Sprite
sprite.graphics.clear()
sprite.graphics.drawRoundRect(0, 0, sprite.width, sprite.height, 12, 12, 12, 12, "#0e2a53")
sprite.alpha = 0.1
}
}
@@ -181,6 +184,7 @@ export class TopBar extends Laya.Script {
const sprite = Box.getChildByName("Sprite") as Laya.Sprite
sprite.graphics.clear()
sprite.graphics.drawRoundRect(0, 0, sprite.width, sprite.height, 12, 12, 12, 12, "#f5f7fb")
sprite.alpha = 0.1
}
}
}