优化棋盘表现问题
This commit is contained in:
@@ -32,6 +32,8 @@ export class CalendarUnit extends Laya.Script {
|
||||
@property(Laya.Sprite)
|
||||
public sprite_pie: Laya.Sprite
|
||||
|
||||
private pieSize: number
|
||||
|
||||
@property(Laya.Sprite)
|
||||
public obj_mask: Laya.Sprite
|
||||
|
||||
@@ -46,7 +48,7 @@ export class CalendarUnit extends Laya.Script {
|
||||
|
||||
// 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次
|
||||
onAwake(): void {
|
||||
|
||||
this.pieSize = this.sprite_pie.width /2
|
||||
}
|
||||
|
||||
public onInit(label_obj: Laya.Label): void {
|
||||
@@ -94,10 +96,6 @@ export class CalendarUnit extends Laya.Script {
|
||||
|
||||
this.obj_star.visible = this.progress >= 1
|
||||
|
||||
let blockSize = 48
|
||||
if (config.H_SCREEN)
|
||||
blockSize = 33
|
||||
|
||||
if (this.selected) {
|
||||
this.label_show.color = "#ffffff"
|
||||
this.obj_selected.visible = true
|
||||
@@ -105,7 +103,7 @@ export class CalendarUnit extends Laya.Script {
|
||||
this.obj_pie.visible = true
|
||||
this.obj_mask.visible = true
|
||||
this.sprite_pie.graphics.clear()
|
||||
this.sprite_pie.graphics.drawPie(blockSize, blockSize, blockSize, 0, 360 * this.progress, "#ffffff")
|
||||
this.sprite_pie.graphics.drawPie(this.pieSize, this.pieSize, this.pieSize, 0, 360 * this.progress, "#ffffff")
|
||||
this.sprite_mask.graphics.clear()
|
||||
this.sprite_mask.graphics.drawCircle(0.5, 0.5, 0.5, "#1d5cdc")
|
||||
} else {
|
||||
@@ -119,7 +117,7 @@ export class CalendarUnit extends Laya.Script {
|
||||
this.obj_pie.visible = true
|
||||
this.obj_mask.visible = true
|
||||
this.sprite_pie.graphics.clear()
|
||||
this.sprite_pie.graphics.drawPie(blockSize, blockSize, blockSize, 0, 360 * this.progress, "#2d3138")
|
||||
this.sprite_pie.graphics.drawPie(this.pieSize, this.pieSize, this.pieSize, 0, 360 * this.progress, "#2d3138")
|
||||
this.sprite_mask.graphics.clear()
|
||||
this.sprite_mask.graphics.drawCircle(0.5, 0.5, 0.5, "#ffffff")
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user