Commit 9d84a4bd authored by 邱旭's avatar 邱旭

1

parent 0b0d19d1
......@@ -331,8 +331,13 @@ export default class MainBase extends eui.UILayer {
for (var i = 0; i <= 9; i++) {
RES.getResAsync("propNum" + i + "_png")
}
RES.getResAsync("propNum" + "第" + "_png");
RES.getResAsync("propNum" + "关" + "_png");
for (var i = 0; i <= 9; i++) {
RES.getResAsync("check" + i + "_png")
}
RES.getResAsync("check" + "第" + "_png");
RES.getResAsync("check" + "关" + "_png");
RES.getResAsync("propBg_png"); // 道具栏背景
// for (var i = 1; i <= 5; i++) {
// RES.getResAsync("guideTxt" + i + "_png")
......
egret/resource/assets/mainScene/propNum1.png

779 Bytes | W: | H:

egret/resource/assets/mainScene/propNum1.png

540 Bytes | W: | H:

egret/resource/assets/mainScene/propNum1.png
egret/resource/assets/mainScene/propNum1.png
egret/resource/assets/mainScene/propNum1.png
egret/resource/assets/mainScene/propNum1.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
......@@ -44,9 +44,9 @@ export class ChapterNum extends egret.DisplayObjectContainer {
//如果没有就
let o: BitmapNumber = Pool.takeOut(RecoverName.BITMAP_NUMBER);
if(!o) {
o = new BitmapNumber("propNum");
o = new BitmapNumber("check");
} else {
o.reset("propNum")
o.reset("check")
}
o.num = arr[i];
this.addChild(o)
......
......@@ -5,27 +5,36 @@ export class PropBtnCon extends eui.Component {
boomBtn: CusButton;
hammerBtn: CusButton;
stepBtn: CusButton;
bg: eui.Image;
constructor() {
super();
var textureBg = RES.getRes("propBg_png");
this.bg = new eui.Image(textureBg);
this.bg.y = -137;
this.addChild(this.bg);
this.boomBtn = new CusButton("boomBtn_png");
this.boomBtn.x = 375 - 110 - 50 //110图片宽度,50按钮间隔
this.addChild(this.boomBtn)
this.boomBtn.x = 375 - 110 - 50; //110图片宽度,50按钮间隔
this.addChild(this.boomBtn);
this.hammerBtn = new CusButton("hammerBtn_png");
this.hammerBtn.x = 375;
this.addChild(this.hammerBtn)
this.addChild(this.hammerBtn);
this.stepBtn = new CusButton("stepBtn_png");
this.stepBtn.x = 375 + 110 + 50
this.addChild(this.stepBtn)
this.stepBtn.x = 375 + 110 + 50;
this.addChild(this.stepBtn);
}
}
/**
* 自定义按钮
*/
class CusButton extends eui.Component {
propNumShow: PropNumShow
propNumShow: PropNumShow;
constructor(source: string) {
super();
this.touchChildren = false;
......@@ -34,18 +43,18 @@ class CusButton extends eui.Component {
image.y = -55;
this.addChild(image);
this.propNumShow = new PropNumShow();
this.propNumShow.x = 15;
this.propNumShow.y = 15;
this.propNumShow.x = 30;
this.propNumShow.y = 30;
this.addChild(this.propNumShow);
this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, () => {
this.scaleX = this.scaleY = 0.9;
}, this)
}, this);
this.addEventListener(egret.TouchEvent.TOUCH_END, () => {
this.scaleX = this.scaleY = 1;
}, this)
}, this);
this.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, () => {
this.scaleX = this.scaleY = 1;
}, this)
}, this);
}
}
\ No newline at end of file
......@@ -19,8 +19,9 @@ export class PropNumShow extends egret.DisplayObjectContainer {
get count(): number {
return this._count;
}
set count(value: number) {
if (value <= 0) {
if(value <= 0) {
value = 0;
//变灰
this.filters = [this.colorFlilter];
......@@ -30,6 +31,7 @@ export class PropNumShow extends egret.DisplayObjectContainer {
this._count = value;
this.countNum.num = value;
}
constructor() {
super();
//滤镜
......@@ -41,12 +43,12 @@ export class PropNumShow extends egret.DisplayObjectContainer {
];
this.colorFlilter = new egret.ColorMatrixFilter(colorMatrix);
//背景
var bg = new egret.Bitmap(RES.getRes("propNumBg_png"))
this.addChild(bg)
var bg = new egret.Bitmap(RES.getRes("propNumBg_png"));
this.addChild(bg);
//数字
this.countNum = new PropNumber();
this.countNum.x = 22.5;
this.countNum.y = 7;
this.countNum.x = 23;
this.countNum.y = 7.5;
this.addChild(this.countNum);
}
}
\ No newline at end of file
......@@ -51,7 +51,7 @@ export class ScoreProgress {
//是否超过2星
else if(value >= this.starScores[1]) {
scale = (value - this.starScores[1]) / (this.starScores[2] - this.starScores[1]);
w = (536 - 476) * scale + 476 - 138;
w = (563 - 476) * scale + 476 - 138;
if(this.star2.source != "lightedStar_png") {
this.star2.source = "lightedStar_png";
this.star1.source = "lightedStar_png";
......@@ -110,15 +110,15 @@ export class ScoreProgress {
//星星1 lightedStar_png
var textureStar = RES.getRes("unlightedStar_png");
this.star1 = new eui.Image(textureStar); // width (27 * 2)
this.star1.x = 363;
this.star1.x = 363; // 390
this.star1.y = 201;
p.addChild(this.star1);
this.star2 = new eui.Image(textureStar);
this.star2.x = 449;
this.star2.x = 449; // 476
this.star2.y = 201;
p.addChild(this.star2);
this.star3 = new eui.Image(textureStar);
this.star3.x = 536;
this.star3.x = 536; // 563
this.star3.y = 201;
p.addChild(this.star3);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment