private refreshBattery() {
this.battery.opacity = 127;
let power: number = cc.sys.getBatteryLevel() * 100;
let currentPower: number = 56 * (power / 100);
let batteryColor: string = '#e8cf92';
let g: cc.Graphics = this.battery.getComponent(cc.Graphics);
g.strokeColor = ColorHelper.getColor(batteryColor);
g.fillColor = ColorHelper.getColor(batteryColor);
g.rect(0, 0, currentPower, 16);
g.fill();
g.stroke();
}
现在使用画图画个电量出来,发现网页版看到的跟手机看到的图片位置不一样,网页看到的图片起点刚好是手机看到的终点