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

1

parent 0b0d19d1
...@@ -331,8 +331,13 @@ export default class MainBase extends eui.UILayer { ...@@ -331,8 +331,13 @@ export default class MainBase extends eui.UILayer {
for (var i = 0; i <= 9; i++) { for (var i = 0; i <= 9; i++) {
RES.getResAsync("propNum" + i + "_png") RES.getResAsync("propNum" + i + "_png")
} }
RES.getResAsync("propNum" + "第" + "_png"); for (var i = 0; i <= 9; i++) {
RES.getResAsync("propNum" + "关" + "_png"); RES.getResAsync("check" + i + "_png")
}
RES.getResAsync("check" + "第" + "_png");
RES.getResAsync("check" + "关" + "_png");
RES.getResAsync("propBg_png"); // 道具栏背景
// for (var i = 1; i <= 5; i++) { // for (var i = 1; i <= 5; i++) {
// RES.getResAsync("guideTxt" + i + "_png") // 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 { ...@@ -44,9 +44,9 @@ export class ChapterNum extends egret.DisplayObjectContainer {
//如果没有就 //如果没有就
let o: BitmapNumber = Pool.takeOut(RecoverName.BITMAP_NUMBER); let o: BitmapNumber = Pool.takeOut(RecoverName.BITMAP_NUMBER);
if(!o) { if(!o) {
o = new BitmapNumber("propNum"); o = new BitmapNumber("check");
} else { } else {
o.reset("propNum") o.reset("check")
} }
o.num = arr[i]; o.num = arr[i];
this.addChild(o) this.addChild(o)
......
...@@ -5,27 +5,36 @@ export class PropBtnCon extends eui.Component { ...@@ -5,27 +5,36 @@ export class PropBtnCon extends eui.Component {
boomBtn: CusButton; boomBtn: CusButton;
hammerBtn: CusButton; hammerBtn: CusButton;
stepBtn: CusButton; stepBtn: CusButton;
bg: eui.Image;
constructor() { constructor() {
super(); 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 = new CusButton("boomBtn_png");
this.boomBtn.x = 375 - 110 - 50 //110图片宽度,50按钮间隔 this.boomBtn.x = 375 - 110 - 50; //110图片宽度,50按钮间隔
this.addChild(this.boomBtn) this.addChild(this.boomBtn);
this.hammerBtn = new CusButton("hammerBtn_png"); this.hammerBtn = new CusButton("hammerBtn_png");
this.hammerBtn.x = 375; this.hammerBtn.x = 375;
this.addChild(this.hammerBtn) this.addChild(this.hammerBtn);
this.stepBtn = new CusButton("stepBtn_png"); this.stepBtn = new CusButton("stepBtn_png");
this.stepBtn.x = 375 + 110 + 50 this.stepBtn.x = 375 + 110 + 50;
this.addChild(this.stepBtn) this.addChild(this.stepBtn);
} }
} }
/** /**
* 自定义按钮 * 自定义按钮
*/ */
class CusButton extends eui.Component { class CusButton extends eui.Component {
propNumShow: PropNumShow propNumShow: PropNumShow;
constructor(source: string) { constructor(source: string) {
super(); super();
this.touchChildren = false; this.touchChildren = false;
...@@ -34,18 +43,18 @@ class CusButton extends eui.Component { ...@@ -34,18 +43,18 @@ class CusButton extends eui.Component {
image.y = -55; image.y = -55;
this.addChild(image); this.addChild(image);
this.propNumShow = new PropNumShow(); this.propNumShow = new PropNumShow();
this.propNumShow.x = 15; this.propNumShow.x = 30;
this.propNumShow.y = 15; this.propNumShow.y = 30;
this.addChild(this.propNumShow); this.addChild(this.propNumShow);
this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, () => { this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, () => {
this.scaleX = this.scaleY = 0.9; this.scaleX = this.scaleY = 0.9;
}, this) }, this);
this.addEventListener(egret.TouchEvent.TOUCH_END, () => { this.addEventListener(egret.TouchEvent.TOUCH_END, () => {
this.scaleX = this.scaleY = 1; this.scaleX = this.scaleY = 1;
}, this) }, this);
this.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, () => { this.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, () => {
this.scaleX = this.scaleY = 1; this.scaleX = this.scaleY = 1;
}, this) }, this);
} }
} }
\ No newline at end of file
...@@ -19,8 +19,9 @@ export class PropNumShow extends egret.DisplayObjectContainer { ...@@ -19,8 +19,9 @@ export class PropNumShow extends egret.DisplayObjectContainer {
get count(): number { get count(): number {
return this._count; return this._count;
} }
set count(value: number) { set count(value: number) {
if (value <= 0) { if(value <= 0) {
value = 0; value = 0;
//变灰 //变灰
this.filters = [this.colorFlilter]; this.filters = [this.colorFlilter];
...@@ -30,6 +31,7 @@ export class PropNumShow extends egret.DisplayObjectContainer { ...@@ -30,6 +31,7 @@ export class PropNumShow extends egret.DisplayObjectContainer {
this._count = value; this._count = value;
this.countNum.num = value; this.countNum.num = value;
} }
constructor() { constructor() {
super(); super();
//滤镜 //滤镜
...@@ -41,12 +43,12 @@ export class PropNumShow extends egret.DisplayObjectContainer { ...@@ -41,12 +43,12 @@ export class PropNumShow extends egret.DisplayObjectContainer {
]; ];
this.colorFlilter = new egret.ColorMatrixFilter(colorMatrix); this.colorFlilter = new egret.ColorMatrixFilter(colorMatrix);
//背景 //背景
var bg = new egret.Bitmap(RES.getRes("propNumBg_png")) var bg = new egret.Bitmap(RES.getRes("propNumBg_png"));
this.addChild(bg) this.addChild(bg);
//数字 //数字
this.countNum = new PropNumber(); this.countNum = new PropNumber();
this.countNum.x = 22.5; this.countNum.x = 23;
this.countNum.y = 7; this.countNum.y = 7.5;
this.addChild(this.countNum); this.addChild(this.countNum);
} }
} }
\ No newline at end of file
...@@ -51,7 +51,7 @@ export class ScoreProgress { ...@@ -51,7 +51,7 @@ export class ScoreProgress {
//是否超过2星 //是否超过2星
else if(value >= this.starScores[1]) { else if(value >= this.starScores[1]) {
scale = (value - this.starScores[1]) / (this.starScores[2] - 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") { if(this.star2.source != "lightedStar_png") {
this.star2.source = "lightedStar_png"; this.star2.source = "lightedStar_png";
this.star1.source = "lightedStar_png"; this.star1.source = "lightedStar_png";
...@@ -110,15 +110,15 @@ export class ScoreProgress { ...@@ -110,15 +110,15 @@ export class ScoreProgress {
//星星1 lightedStar_png //星星1 lightedStar_png
var textureStar = RES.getRes("unlightedStar_png"); var textureStar = RES.getRes("unlightedStar_png");
this.star1 = new eui.Image(textureStar); // width (27 * 2) this.star1 = new eui.Image(textureStar); // width (27 * 2)
this.star1.x = 363; this.star1.x = 363; // 390
this.star1.y = 201; this.star1.y = 201;
p.addChild(this.star1); p.addChild(this.star1);
this.star2 = new eui.Image(textureStar); this.star2 = new eui.Image(textureStar);
this.star2.x = 449; this.star2.x = 449; // 476
this.star2.y = 201; this.star2.y = 201;
p.addChild(this.star2); p.addChild(this.star2);
this.star3 = new eui.Image(textureStar); this.star3 = new eui.Image(textureStar);
this.star3.x = 536; this.star3.x = 536; // 563
this.star3.y = 201; this.star3.y = 201;
p.addChild(this.star3); 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