Commit d0d3b1ac authored by 范雪寒's avatar 范雪寒

feat: 全部功能基本完成

parent a346681e
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, ErrorHandler } from '@angular/core';
import {MyErrorHandler} from './MyError';
import { MyErrorHandler } from './MyError';
import { AppComponent } from './app.component';
import { NgZorroAntdModule, NZ_I18N, zh_CN } from 'ng-zorro-antd';
......@@ -10,20 +10,21 @@ import { HttpClientModule } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { registerLocaleData } from '@angular/common';
import zh from '@angular/common/locales/zh';
import {FormComponent} from './form/form.component';
import {PlayComponent} from './play/play.component';
import {LessonTitleConfigComponent} from './common/lesson-title-config/lesson-title-config.component';
import {BackgroundImagePipe} from './pipes/background-image.pipe';
import {UploadImageWithPreviewComponent} from './common/upload-image-with-preview/upload-image-with-preview.component';
import {PlayerContentWrapperComponent} from './common/player-content-wrapper/player-content-wrapper.component';
import {CustomHotZoneComponent} from './common/custom-hot-zone/custom-hot-zone.component';
import {UploadVideoComponent} from './common/upload-video/upload-video.component';
import {TimePipe} from './pipes/time.pipe';
import {ResourcePipe} from './pipes/resource.pipe';
import {AudioRecorderComponent} from './common/audio-recorder/audio-recorder.component';
import { FormComponent } from './form/form.component';
import { PlayComponent } from './play/play.component';
import { LessonTitleConfigComponent } from './common/lesson-title-config/lesson-title-config.component';
import { BackgroundImagePipe } from './pipes/background-image.pipe';
import { UploadImageWithPreviewComponent } from './common/upload-image-with-preview/upload-image-with-preview.component';
import { PlayerContentWrapperComponent } from './common/player-content-wrapper/player-content-wrapper.component';
import { CustomHotZoneComponent } from './common/custom-hot-zone/custom-hot-zone.component';
import { UploadVideoComponent } from './common/upload-video/upload-video.component';
import { TimePipe } from './pipes/time.pipe';
import { ResourcePipe } from './pipes/resource.pipe';
import { AudioRecorderComponent } from './common/audio-recorder/audio-recorder.component';
import { FontAwesomeModule, FaIconLibrary } from '@fortawesome/angular-fontawesome';
import { fas } from '@fortawesome/free-solid-svg-icons';
import { far } from '@fortawesome/free-regular-svg-icons';
import { UploadDragonBoneComponent } from './common/upload-dragon-bone/upload-dragon-bone.component';
registerLocaleData(zh);
......@@ -40,7 +41,7 @@ registerLocaleData(zh);
TimePipe,
UploadVideoComponent,
CustomHotZoneComponent,
UploadDragonBoneComponent,
PlayerContentWrapperComponent
],
......@@ -53,7 +54,7 @@ registerLocaleData(zh);
FontAwesomeModule
],
providers: [
{provide: ErrorHandler, useClass: MyErrorHandler},
{ provide: ErrorHandler, useClass: MyErrorHandler },
{ provide: NZ_I18N, useValue: zh_CN }
],
bootstrap: [AppComponent]
......
......@@ -329,6 +329,7 @@ export class MySprite extends Sprite {
this.scaleX = this.scaleY = value;
}
getBoundingBox() {
const getParentData = (item) => {
......@@ -1956,6 +1957,8 @@ export class HotZoneItem extends MySprite {
audio_url;
pic_url;
text;
gIdx;
private _itemType;
private shapeRect: ShapeRect;
......@@ -2208,6 +2211,8 @@ export class EditorItem extends MySprite {
arrow: MySprite;
label: Label;
text;
arrowTop;
arrowRight;
showLabel(text = null) {
......@@ -2246,6 +2251,13 @@ export class EditorItem extends MySprite {
this.arrow.load('assets/common/arrow.png', 1, 0);
this.arrow.setScaleXY(0.06);
// this.arrowTop = new MySprite(this.ctx);
// this.arrowTop.load('assets/common/arrow_top.png', 0.5, 0);
// this.arrowTop.setScaleXY(0.06);
//
// this.arrowRight = new MySprite(this.ctx);
// this.arrowRight.load('assets/common/arrow_right.png', 1, 0.5);
// this.arrowRight.setScaleXY(0.06);
}
this.showLabel();
......@@ -2262,16 +2274,25 @@ export class EditorItem extends MySprite {
this.hideLabel();
}
refreshLabelScale() {}
drawArrow() {
if (!this.arrow) { return; }
const rect = this.getBoundingBox();
this.arrow.x = rect.x + rect.width;
this.arrow.y = rect.y;
this.arrow.update();
// this.arrowTop.x = rect.x + rect.width / 2;
// this.arrowTop.y = rect.y;
// this.arrowTop.update();
//
// this.arrowRight.x = rect.x + rect.width;
// this.arrowRight.y = rect.y + rect.height / 2;
// this.arrowRight.update();
}
drawFrame() {
......@@ -2325,784 +2346,3 @@ export class EditorItem extends MySprite {
}
//
//
// import TWEEN from '@tweenjs/tween.js';
//
//
// class Sprite {
// x = 0;
// y = 0;
// color = '';
// radius = 0;
// alive = false;
// margin = 0;
// angle = 0;
// ctx;
//
// constructor(ctx) {
// this.ctx = ctx;
// }
// update($event) {
// this.draw();
// }
// draw() {
//
// }
//
// }
//
//
//
//
//
// export class MySprite extends Sprite {
//
// width = 0;
// height = 0;
// _anchorX = 0;
// _anchorY = 0;
// _offX = 0;
// _offY = 0;
// scaleX = 1;
// scaleY = 1;
// alpha = 1;
// rotation = 0;
// visible = true;
//
// children = [this];
//
// img;
// _z = 0;
//
//
// init(imgObj = null, anchorX:number = 0.5, anchorY:number = 0.5) {
//
// if (imgObj) {
//
// this.img = imgObj;
//
// this.width = this.img.width;
// this.height = this.img.height;
// }
//
// this.anchorX = anchorX;
// this.anchorY = anchorY;
// }
//
//
//
// update($event = null) {
// if (this.visible) {
// this.draw();
// }
// }
// draw() {
//
// this.ctx.save();
//
// this.drawInit();
//
// this.updateChildren();
//
// this.ctx.restore();
// }
//
// drawInit() {
//
// this.ctx.translate(this.x, this.y);
//
// this.ctx.rotate(this.rotation * Math.PI / 180);
//
// this.ctx.scale(this.scaleX, this.scaleY);
//
// this.ctx.globalAlpha = this.alpha;
//
// }
//
// drawSelf() {
// if (this.img) {
// this.ctx.drawImage(this.img, this._offX, this._offY);
// }
// }
//
// updateChildren() {
//
// if (this.children.length <= 0) { return; }
//
// for (let i = 0; i < this.children.length; i++) {
//
// if (this.children[i] === this) {
//
// this.drawSelf();
// } else {
//
// this.children[i].update();
// }
// }
// }
//
//
// load(url, anchorX = 0.5, anchorY = 0.5) {
//
// return new Promise((resolve, reject) => {
// const img = new Image();
// img.onload = () => resolve(img);
// img.onerror = reject;
// img.src = url;
// }).then(img => {
//
// this.init(img, anchorX, anchorY);
// return img;
// });
// }
//
// addChild(child, z = 1) {
// if (this.children.indexOf(child) === -1) {
// this.children.push(child);
// child._z = z;
// child.parent = this;
// }
//
// this.children.sort((a, b) => {
// return a._z - b._z;
// });
//
// }
// removeChild(child) {
// const index = this.children.indexOf(child);
// if (index !== -1) {
// this.children.splice(index, 1);
// }
// }
//
// set anchorX(value) {
// this._anchorX = value;
// this.refreshAnchorOff();
// }
// get anchorX() {
// return this._anchorX;
// }
// set anchorY(value) {
// this._anchorY = value;
// this.refreshAnchorOff();
// }
// get anchorY() {
// return this._anchorY;
// }
// refreshAnchorOff() {
// this._offX = -this.width * this.anchorX;
// this._offY = -this.height * this.anchorY;
// }
//
// setScaleXY(value) {
// this.scaleX = this.scaleY = value;
// }
//
// getBoundingBox() {
//
// const x = this.x + this._offX * this.scaleX;
// const y = this.y + this._offY * this.scaleY;
// const width = this.width * this.scaleX;
// const height = this.height * this.scaleY;
//
// return {x, y, width, height};
// }
//
// }
//
//
//
//
//
// export class Item extends MySprite {
//
// baseX;
//
// move(targetY, callBack) {
//
// const self = this;
//
// const tween = new TWEEN.Tween(this)
// .to({ y: targetY }, 2500)
// .easing(TWEEN.Easing.Quintic.Out)
// .onComplete(function() {
//
// self.hide(callBack);
// // if (callBack) {
// // callBack();
// // }
// })
// .start();
//
// }
//
// show(callBack = null) {
//
// const tween = new TWEEN.Tween(this)
// .to({ alpha: 1 }, 800)
// // .easing(TWEEN.Easing.Quadratic.Out) // Use an easing function to make the animation smooth.
// .onComplete(function() {
// if (callBack) {
// callBack();
// }
// })
// .start(); // Start the tween immediately.
//
// }
//
// hide(callBack = null) {
//
// const tween = new TWEEN.Tween(this)
// .to({ alpha: 0 }, 800)
// // .easing(TWEEN.Easing.Quadratic.Out) // Use an easing function to make the animation smooth.
// .onComplete(function() {
// if (callBack) {
// callBack();
// }
// })
// .start(); // Start the tween immediately.
// }
//
//
// shake(id) {
//
//
// if (!this.baseX) {
// this.baseX = this.x;
// }
//
// const baseX = this.baseX;
// const baseTime = 50;
// const sequence = [
// {target: {x: baseX + 40 * id}, time: baseTime - 25},
// {target: {x: baseX - 20 * id}, time: baseTime},
// {target: {x: baseX + 10 * id}, time: baseTime},
// {target: {x: baseX - 5 * id}, time: baseTime},
// {target: {x: baseX + 2 * id}, time: baseTime},
// {target: {x: baseX - 1 * id}, time: baseTime},
// {target: {x: baseX}, time: baseTime},
//
// ];
//
//
// const self = this;
//
// function runSequence() {
//
// if (self['shakeTween']) {
// self['shakeTween'].stop();
// }
//
// const tween = new TWEEN.Tween(self);
//
// if (sequence.length > 0) {
// // console.log('sequence.length: ', sequence.length);
// const action = sequence.shift();
// tween.to(action['target'], action['time']);
// tween.onComplete( () => {
// runSequence();
// });
// tween.start();
//
// self['shakeTween'] = tween;
// }
// }
//
// runSequence();
//
// }
//
//
//
// drop(targetY, callBack = null) {
//
// const self = this;
//
// const time = Math.abs(targetY - this.y) * 2.4;
//
// this.alpha = 1;
//
// const tween = new TWEEN.Tween(this)
// .to({ y: targetY }, time)
// .easing(TWEEN.Easing.Cubic.In)
// .onComplete(function() {
//
// // self.hideItem(callBack);
// if (callBack) {
// callBack();
// }
// })
// .start();
//
//
// }
//
//
// }
//
//
// export class EndSpr extends MySprite {
//
// show(s) {
//
// this.scaleX = this.scaleY = 0;
// this.alpha = 0;
//
// const tween = new TWEEN.Tween(this)
// .to({ alpha: 1, scaleX: s, scaleY: s }, 800)
// .easing(TWEEN.Easing.Elastic.Out) // Use an easing function to make the animation smooth.
// .onComplete(function() {
//
// })
// .start(); // Start the tween immediately.
//
// }
// }
//
//
//
// export class ShapeRect extends MySprite {
//
// fillColor = '#FF0000';
//
// setSize(w, h) {
// this.width = w;
// this.height = h;
//
// console.log('w:', w);
// console.log('h:', h);
// }
//
// drawShape() {
//
// this.ctx.fillStyle = this.fillColor;
// this.ctx.fillRect(this._offX, this._offY, this.width, this.height);
//
// }
//
//
// drawSelf() {
// super.drawSelf();
// this.drawShape();
// }
// }
//
//
// export class HotZoneItem extends MySprite {
//
//
// lineDashFlag = false;
// arrow: MySprite;
// label: Label;
// title;
//
// arrowTop;
// arrowRight;
//
// audio_url;
// pic_url;
// text;
// private _itemType;
// private shapeRect: ShapeRect;
//
// get itemType() {
// return this._itemType;
// }
// set itemType(value) {
// this._itemType = value;
// }
//
// setSize(w, h) {
// this.width = w;
// this.height = h;
//
//
// const rect = new ShapeRect(this.ctx);
// rect.x = -w / 2;
// rect.y = -h / 2;
// rect.setSize(w, h);
// rect.fillColor = '#ffffff';
// rect.alpha = 0.2;
// this.addChild(rect);
// }
//
// showLabel(text = null) {
//
//
// if (!this.label) {
// this.label = new Label(this.ctx);
// this.label.anchorY = 0;
// this.label.fontSize = '40px';
// this.label.textAlign = 'center';
// this.addChild(this.label);
// // this.label.scaleX = 1 / this.scaleX;
// // this.label.scaleY = 1 / this.scaleY;
//
// this.refreshLabelScale();
//
// }
//
// if (text) {
// this.label.text = text;
// } else if (this.title) {
// this.label.text = this.title;
// }
// this.label.visible = true;
//
// }
//
// hideLabel() {
// if (!this.label) { return; }
//
// this.label.visible = false;
// }
//
// refreshLabelScale() {
// if (this.scaleX == this.scaleY) {
// this.label.setScaleXY(1);
// }
//
// if (this.scaleX > this.scaleY) {
// this.label.scaleX = this.scaleY / this.scaleX;
// } else {
// this.label.scaleY = this.scaleX / this.scaleY;
// }
// }
//
// showLineDash() {
// this.lineDashFlag = true;
//
// if (this.arrow) {
// this.arrow.visible = true;
// } else {
// this.arrow = new MySprite(this.ctx);
// this.arrow.load('assets/common/arrow.png', 1, 0);
// this.arrow.setScaleXY(0.06);
//
// this.arrowTop = new MySprite(this.ctx);
// this.arrowTop.load('assets/common/arrow_top.png', 0.5, 0);
// this.arrowTop.setScaleXY(0.06);
//
// this.arrowRight = new MySprite(this.ctx);
// this.arrowRight.load('assets/common/arrow_right.png', 1, 0.5);
// this.arrowRight.setScaleXY(0.06);
// }
//
// this.showLabel();
// }
//
// hideLineDash() {
//
// this.lineDashFlag = false;
//
// if (this.arrow) {
// this.arrow.visible = false;
// }
//
// this.hideLabel();
// }
//
//
//
// drawArrow() {
// if (!this.arrow) { return; }
//
// const rect = this.getBoundingBox();
// this.arrow.x = rect.x + rect.width;
// this.arrow.y = rect.y;
//
// this.arrow.update();
//
//
// this.arrowTop.x = rect.x + rect.width / 2;
// this.arrowTop.y = rect.y;
// this.arrowTop.update();
//
// this.arrowRight.x = rect.x + rect.width;
// this.arrowRight.y = rect.y + rect.height / 2;
// this.arrowRight.update();
// }
//
// drawFrame() {
//
//
// this.ctx.save();
//
//
// const rect = this.getBoundingBox();
//
// const w = rect.width;
// const h = rect.height;
// const x = rect.x + w / 2;
// const y = rect.y + h / 2;
//
// this.ctx.setLineDash([5, 5]);
// this.ctx.lineWidth = 2;
// this.ctx.strokeStyle = '#1bfff7';
// // this.ctx.fillStyle = '#ffffff';
//
// this.ctx.beginPath();
//
// this.ctx.moveTo( x - w / 2, y - h / 2);
//
// this.ctx.lineTo(x + w / 2, y - h / 2);
//
// this.ctx.lineTo(x + w / 2, y + h / 2);
//
// this.ctx.lineTo(x - w / 2, y + h / 2);
//
// this.ctx.lineTo(x - w / 2, y - h / 2);
//
// // this.ctx.fill();
// this.ctx.stroke();
//
//
//
//
// this.ctx.restore();
//
// }
//
// draw() {
// super.draw();
//
// if (this.lineDashFlag) {
// this.drawFrame();
// this.drawArrow();
// }
// }
// }
//
//
// export class EditorItem extends MySprite {
//
// lineDashFlag = false;
// arrow: MySprite;
// label:Label;
// text;
//
// showLabel(text = null) {
//
//
// if (!this.label) {
// this.label = new Label(this.ctx);
// this.label.anchorY = 0;
// this.label.fontSize = '50px';
// this.label.textAlign = 'center';
// this.addChild(this.label);
// this.label.setScaleXY(1 / this.scaleX);
// }
//
// if (text) {
// this.label.text = text;
// } else if (this.text) {
// this.label.text = this.text;
// }
// this.label.visible = true;
//
// }
//
// hideLabel() {
// if (!this.label) { return; }
//
// this.label.visible = false;
// }
//
// showLineDash() {
// this.lineDashFlag = true;
//
// if (this.arrow) {
// this.arrow.visible = true;
// } else {
// this.arrow = new MySprite(this.ctx);
// this.arrow.load('assets/common/arrow.png', 1, 0);
// this.arrow.setScaleXY(0.06);
//
// }
//
// this.showLabel();
// }
//
// hideLineDash() {
//
// this.lineDashFlag = false;
//
// if (this.arrow) {
// this.arrow.visible = false;
// }
//
// this.hideLabel();
// }
//
//
//
// drawArrow() {
// if (!this.arrow) { return; }
//
// const rect = this.getBoundingBox();
// this.arrow.x = rect.x + rect.width;
// this.arrow.y = rect.y;
//
// this.arrow.update();
// }
//
// drawFrame() {
//
//
// this.ctx.save();
//
//
// const rect = this.getBoundingBox();
//
// const w = rect.width;
// const h = rect.height;
// const x = rect.x + w / 2;
// const y = rect.y + h / 2;
//
// this.ctx.setLineDash([5, 5]);
// this.ctx.lineWidth = 2;
// this.ctx.strokeStyle = '#1bfff7';
// // this.ctx.fillStyle = '#ffffff';
//
// this.ctx.beginPath();
//
// this.ctx.moveTo( x - w / 2, y - h / 2);
//
// this.ctx.lineTo(x + w / 2, y - h / 2);
//
// this.ctx.lineTo(x + w / 2, y + h / 2);
//
// this.ctx.lineTo(x - w / 2, y + h / 2);
//
// this.ctx.lineTo(x - w / 2, y - h / 2);
//
// // this.ctx.fill();
// this.ctx.stroke();
//
//
//
//
// this.ctx.restore();
//
// }
//
// draw() {
// super.draw();
//
// if (this.lineDashFlag) {
// this.drawFrame();
// this.drawArrow();
// }
// }
// }
//
//
//
// export class Label extends MySprite {
//
// text:String;
// fontSize:String = '40px';
// fontName:String = 'Verdana';
// textAlign:String = 'left';
//
//
// constructor(ctx) {
// super(ctx);
// this.init();
// }
//
// drawText() {
//
// // console.log('in drawText', this.text);
//
// if (!this.text) { return; }
//
// this.ctx.font = `${this.fontSize} ${this.fontName}`;
// this.ctx.textAlign = this.textAlign;
// this.ctx.textBaseline = 'middle';
// this.ctx.fontWeight = 900;
//
// this.ctx.lineWidth = 5;
// this.ctx.strokeStyle = '#ffffff';
// this.ctx.strokeText(this.text, 0, 0);
//
// this.ctx.fillStyle = '#000000';
// this.ctx.fillText(this.text, 0, 0);
//
//
// }
//
//
// drawSelf() {
// super.drawSelf();
// this.drawText();
// }
//
// }
//
//
//
// export function getPosByAngle(angle, len) {
//
// const radian = angle * Math.PI / 180;
// const x = Math.sin(radian) * len;
// const y = Math.cos(radian) * len;
//
// return {x, y};
//
// }
//
// export function getAngleByPos(px, py, mx, my) {
//
// // const _x = p2x - p1x;
// // const _y = p2y - p1y;
// // const tan = _y / _x;
// //
// // const radina = Math.atan(tan); // 用反三角函数求弧度
// // const angle = Math.floor(180 / (Math.PI / radina)); //
// //
// // console.log('r: ' , angle);
// // return angle;
// //
//
//
//
// const x = Math.abs(px - mx);
// const y = Math.abs(py - my);
// // const x = Math.abs(mx - px);
// // const y = Math.abs(my - py);
// const z = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
// const cos = y / z;
// const radina = Math.acos(cos); // 用反三角函数求弧度
// let angle = Math.floor(180 / (Math.PI / radina) * 100) / 100; // 将弧度转换成角度
//
// if(mx > px && my > py) {// 鼠标在第四象限
// angle = 180 - angle;
// }
//
// if(mx === px && my > py) {// 鼠标在y轴负方向上
// angle = 180;
// }
//
// if(mx > px && my === py) {// 鼠标在x轴正方向上
// angle = 90;
// }
//
// if(mx < px && my > py) {// 鼠标在第三象限
// angle = 180 + angle;
// }
//
// if(mx < px && my === py) {// 鼠标在x轴负方向
// angle = 270;
// }
//
// if(mx < px && my < py) {// 鼠标在第二象限
// angle = 360 - angle;
// }
//
// // console.log('angle: ', angle);
// return angle;
//
// }
......@@ -32,15 +32,63 @@
<nz-divider style="margin-top: 10px;"></nz-divider>
<div style="margin-top: -20px; margin-bottom: 5px; width: 100%;">
<div *ngIf="customTypeGroupArr">
<nz-radio-group [ngModel]="it.gIdx" (ngModelChange)="customRadioChange($event, it)" style="display: flex; align-items: center; justify-content: center; flex-wrap: wrap;">
<div *ngFor="let group of customTypeGroupArr; let gIdx = index" style="display: flex; ">
<label nz-radio nzValue="{{gIdx}}">{{group.name}}</label>
</div>
</nz-radio-group>
</div>
<!-- <div *ngIf="!customTypeGroupArr">
<nz-radio-group [ngModel]="it.itemType" (ngModelChange)="radioChange($event, it)" style="display: flex; align-items: center; justify-content: center">
<div style="margin-top: -20px; margin-bottom: 5px">
<nz-radio-group [ngModel]="it.itemType" (ngModelChange)="radioChange($event, it)">
<label *ngIf="isHasRect" nz-radio nzValue="rect">矩形</label>
<label *ngIf="isHasPic" nz-radio nzValue="pic">图片</label>
<label *ngIf="isHasText" nz-radio nzValue="text">文本</label>
</nz-radio-group>
</div> -->
</div>
<div *ngIf="customTypeGroupArr && customTypeGroupArr[it.gIdx]">
<div *ngIf="customTypeGroupArr[it.gIdx].pic">
<app-upload-image-with-preview
[picUrl]="it?.pic_url"
(imageUploaded)="onItemImgUploadSuccess($event, it)">
</app-upload-image-with-preview>
</div>
<div *ngIf="customTypeGroupArr[it.gIdx].text" style="margin-top: 5px">
<input type="text" nz-input [(ngModel)]="it.text" (blur)="saveText(it)">
</div>
<div *ngIf="customTypeGroupArr[it.gIdx].anima" align="center" style="margin-top: 5px">
<button nz-button (click)="setAnimaBtnClick(i)" >
<i nz-icon nzType="tool" nzTheme="outline"></i>
配置龙骨动画
</button>
</div>
<div *ngIf="customTypeGroupArr[it.gIdx].audio" style="display: flex;align-items: center; margin-top: 5px">
<app-audio-recorder
style="margin: auto"
[audioUrl]="it.audio_url"
(audioUploaded)="onItemAudioUploadSuccess($event, it)"
></app-audio-recorder>
</div>
</div>
<!-- <div *ngIf="!customTypeGroupArr">
<div *ngIf="it.itemType == 'pic'">
<app-upload-image-with-preview
[picUrl]="it?.pic_url"
......@@ -52,13 +100,26 @@
<input type="text" nz-input [(ngModel)]="it.text" (blur)="saveText(it)">
</div>
<div style="width: 100%; margin-top: 5px;">
<div *ngIf="isHasAudio"
style="width: 100%; margin-top: 5px; display: flex; align-items: center; justify-items: center;">
<app-audio-recorder
style="margin: auto"
[audioUrl]="it.audio_url"
(audioUploaded)="onItemAudioUploadSuccess($event, it)"
></app-audio-recorder>
</div>
<div *ngIf="it.itemType == 'rect' && isHasAnima" align="center" style="margin-bottom: 5px">
<button nz-button (click)="setAnimaBtnClick(i)" >
<i nz-icon nzType="tool" nzTheme="outline"></i>
配置龙骨动画
</button>
</div>
</div> -->
</div>
</div>
......@@ -83,12 +144,29 @@
<div class="save-box">
<button class="save-btn" nz-button nzType="primary" [nzSize]="'large'" nzShape="round"
<button style="margin-left: 200px" class="save-btn" nz-button nzType="primary" [nzSize]="'large'" nzShape="round"
(click)="saveClick()" >
<i nz-icon nzType="save"></i>
Save
</button>
<div *ngIf="isCopyData" style="height: 40px; display: flex; justify-items: center;" >
<label style="margin-left: 40px" nz-checkbox [(ngModel)]="bgItem.isShowDebugLine">显示辅助框</label>
<button style="margin-left: 20px; margin-top: -5px" nz-button (click)="copyHotZoneData()"> 复制基础数据 </button>
<div style="margin-left: 10px; margin-top: -5px" >
<span>粘贴数据: </span>
<input style="width: 100px;" type="text" nz-input [(ngModel)]="pasteData" >
<button style="margin-left: 5px;" nz-button [disabled]="pasteData==''" nzType="primary" (click)="importData()">导入</button>
</div>
</div>
</div>
......@@ -98,3 +176,52 @@
<label style="opacity: 0; position: absolute; top: 0px; font-family: 'BRLNSR_1'">1</label>
<!--龙骨面板-->
<nz-modal [(nzVisible)]="animaPanelVisible" nzTitle="配置资源文件" (nzAfterClose)="closeAfterPanel()" (nzOnCancel)="animaPanelCancel()" (nzOnOk)="animaPanelOk()" nzOkText="保存">
<div class="anima-upload-btn">
<span style="margin-right: 10px">上传 ske_json 文件: </span>
<nz-upload [nzShowUploadList]="false"
nzAccept="application/json"
[nzAction]="uploadUrl"
[nzData]="uploadData"
(nzChange)="skeJsonHandleChange($event)">
<button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
</nz-upload>
<i *ngIf="isSkeJsonLoading" style="margin-left: 10px;" nz-icon [nzType]="'loading'"></i>
<span *ngIf="skeJsonData['name']" style="margin-left: 10px"><u> {{skeJsonData['name']}} </u></span>
</div>
<div class="anima-upload-btn">
<span style="margin-right: 10px">上传 tex_json 文件: </span>
<nz-upload [nzShowUploadList]="false"
nzAccept="application/json"
[nzAction]="uploadUrl"
[nzData]="uploadData"
(nzChange)="texJsonHandleChange($event)">
<button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
</nz-upload>
<i *ngIf="isTexJsonLoading" style="margin-left: 10px;" nz-icon [nzType]="'loading'"></i>
<span *ngIf="texJsonData['name']" style="margin-left: 10px"><u> {{texJsonData['name']}} </u></span>
</div>
<div class="anima-upload-btn">
<span style="margin-right: 10px">上传 tex_png 文件: </span>
<nz-upload [nzShowUploadList]="false"
nzAccept = "image/*"
[nzAction]="uploadUrl"
[nzData]="uploadData"
(nzChange)="texPngHandleChange($event)">
<button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
</nz-upload>
<i *ngIf="isTexPngLoading" style="margin-left: 10px;" nz-icon [nzType]="'loading'"></i>
<span *ngIf="texPngData['name']" style="margin-left: 10px"><u> {{texPngData['name']}} </u></span>
</div>
<div class="anima-upload-btn" *ngIf="customTypeGroupArr && customTypeGroupArr[curDragonBoneGIdx] && customTypeGroupArr[curDragonBoneGIdx].animaNames">
提示:需包含以下动画: {{customTypeGroupArr[curDragonBoneGIdx].animaNames.toString()}}
</div>
</nz-modal>
......@@ -81,19 +81,21 @@
}
}
h5 {
margin-top: 1rem;
.anima-upload-btn {
padding: 10px;
}
@font-face
{
font-family: 'BRLNSR_1';
src: url("/assets/font/BRLNSR_1.TTF") ;
h5 {
margin-top: 1rem;
}
//
//@font-face
//{
// font-family: 'BRLNSR_1';
// src: url("/assets/font/BRLNSR_1.TTF") ;
//}
......@@ -107,104 +109,3 @@ h5 {
//@import '../../../style/common_mixin';
//
//.p-image-uploader {
// position: relative;
// display: block;
// width: 100%;
// height: 0;
// padding-bottom: 56.25%;
// .p-box {
// position: absolute;
// left: 0;
// top: 0;
// right: 0;
// bottom: 0;
// border: 2px dashed #ddd;
// border-radius: 0.5rem;
// background-color: #fafafa;
// text-align: center;
// color: #aaa;
// .p-upload-icon {
// text-align: center;
// margin: auto;
// .anticon-upload {
// color: #888;
// font-size: 5rem;
// }
// .p-progress-bar {
// position: relative;
// width: 20rem;
// height: 1.5rem;
// border: 1px solid #ccc;
// border-radius: 1rem;
// .p-progress-bg {
// background-color: #1890ff;
// border-radius: 1rem;
// height: 100%;
// }
// .p-progress-value {
// position: absolute;
// top: 0;
// left: 0;
// width: 100%;
// height: 100%;
// text-shadow: 0 0 4px #000;
// color: white;
// text-align: center;
// font-size: 0.9rem;
// line-height: 1.5rem;
// }
// }
// }
// .p-preview {
// width: 100%;
// height: 100%;
// //background-image: url("https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png");
// @include k-img-bg();
// }
// }
//}
//
//.p-btn-delete {
// position: absolute;
// right: -0.5rem;
// top: -0.5rem;
// width: 2rem;
// height: 2rem;
// border: 0.2rem solid white;
// border-radius: 50%;
// font-size: 1.2rem;
// background-color: #fb781a;
// color: white;
// text-align: center;
//}
//
//.p-upload-progress-bg {
// position: absolute;
// width: 100%;
// height: 100%;
// display: flex;
// align-items: center;
// justify-content: center;
// & .i-text {
// position: absolute;
// text-align: center;
// color: white;
// text-shadow: 0 0 2px rgba(0, 0, 0, .85);
// }
// & .i-bg {
// position: absolute;
// left: 0;
// top: 0;
// height: 100%;
// background-color: #27b43f;
// border-radius: 0.5rem;
// }
//}
//
//
//:host ::ng-deep .ant-upload {
// display: block;
//}
import {
ApplicationRef,
ChangeDetectorRef,
Component,
ElementRef,
EventEmitter,
......@@ -14,8 +16,9 @@ import {Subject} from 'rxjs';
import {debounceTime} from 'rxjs/operators';
import {EditorItem, HotZoneImg, HotZoneItem, HotZoneLabel, Label, MySprite, removeItemFromArr} from './Unit';
import TWEEN from '@tweenjs/tween.js';
import {getMinScale} from "../../play/Unit";
import {tar} from "compressing";
import {getMinScale} from '../../play/Unit';
import {tar} from 'compressing';
import {NzMessageService} from 'ng-zorro-antd';
@Component({
......@@ -25,18 +28,14 @@ import {tar} from "compressing";
})
export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
@ViewChild('canvas', {static: true}) canvas: ElementRef;
@ViewChild('wrap', {static: true}) wrap: ElementRef;
@Input()
imgItemArr = null;
@Input()
hotZoneItemArr = null;
@Input()
hotZoneArr = null;
@Output()
save = new EventEmitter();
@ViewChild('canvas', {static: true}) canvas: ElementRef;
@ViewChild('wrap', {static: true}) wrap: ElementRef;
@Input()
isHasRect = true;
@Input()
......@@ -44,16 +43,30 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
@Input()
isHasText = true;
@Input()
hotZoneFontObj = {
size: 50,
name: 'BRLNSR_1',
color: '#8f3758'
}
isHasAudio = true;
@Input()
defaultItemType = 'text';
isHasAnima = false;
@Input()
customTypeGroupArr; // [{name:string, rect:boolean, pic:boolean, text:boolean, audio:boolean, anima:boolean, animaNames:['name1', ..]}, ...]
@Input()
hotZoneFontObj;
@Input()
isCopyData = false;
// hotZoneFontObj = {
// size: 50,
// name: 'BRLNSR_1',
// color: '#8f3758'
// }
@Input()
hotZoneImgSize = 190;
defaultItemType = 'text';
@Input()
hotZoneImgSize = 0;
@Output()
save = new EventEmitter();
saveDisabled = true;
......@@ -86,8 +99,33 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
changeSizeFlag = false;
changeTopSizeFlag = false;
changeRightSizeFlag = false;
animaPanelVisible = false;
uploadUrl;
uploadData;
skeJsonData = {};
texJsonData = {};
texPngData = {};
animaName = '';
curDragonBoneIndex;
curDragonBoneGIdx;
pasteData = '';
constructor() {
isSkeJsonLoading = false;
isTexJsonLoading = false;
isTexPngLoading = false;
constructor(private nzMessageService: NzMessageService, private appRef: ApplicationRef, private changeDetectorRef: ChangeDetectorRef) {
this.uploadUrl = (<any> window).courseware.uploadUrl();
this.uploadData = (<any> window).courseware.uploadData();
window['air'].getUploadCallback = (url, data) => {
this.uploadUrl = url;
this.uploadData = data;
};
}
_bgItem = null;
......@@ -110,11 +148,14 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
ngOnInit() {
this.initListener();
// this.init();
this.update();
this.refresh();
}
ngOnDestroy() {
......@@ -136,10 +177,12 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
onItemImgUploadSuccess(e, item) {
item.pic_url = e.url;
this.loadHotZonePic(item.pic, e.url);
this.refresh();
}
onItemAudioUploadSuccess(e, item) {
item.audio_url = e.url;
this.refresh();
}
......@@ -150,8 +193,12 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.renderArr.push(this.bg);
}
if (!this.bgItem.url) {
this.bgItem.url = 'http://teach.cdn.ireadabc.com/8ebb1858564340ea0936b83e3280ad7d.jpg';
}
const bg = this.bg;
if (this.bgItem.url) {
// if (this.bgItem.url) {
bg.load(this.bgItem.url).then(() => {
const rate1 = this.canvasWidth / bg.width;
......@@ -167,8 +214,11 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
if (callBack) {
callBack();
}
this.refresh();
});
}
// }
}
......@@ -199,6 +249,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
onImgUploadSuccessByImg(e, img) {
img.pic_url = e.url;
this.refreshImage(img);
this.refresh();
}
refreshImage(img) {
......@@ -221,6 +272,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
}
}
this.refresh();
}
......@@ -245,10 +297,16 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
item.anchorX = 0.5;
item.anchorY = 0.5;
item.x = this.canvasWidth / 2;
item.y = this.canvasHeight / 2;
item.itemType = this.defaultItemType;
item.itemType = this.getDefaultItemType();
item.gIdx = '0';
item['id'] = new Date().getTime().toString();
console.log('item.x: ', item.x);
if (saveData) {
......@@ -257,31 +315,45 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
item.scaleY = saveRect.height / item.height;
item.x = saveRect.x + saveRect.width / 2;
item.y = saveRect.y + saveRect.height / 2;
item.gIdx = saveData.gIdx;
item['id'] = saveData.id;
item['skeJsonData'] = saveData.skeJsonData;
item['texJsonData'] = saveData.texJsonData;
item['texPngData'] = saveData.texPngData;
}
console.log('item.x:~~ ', item.x);
item.showLineDash();
const pic = new HotZoneImg(this.ctx);
// const pic = new HotZoneImg(this.ctx);
const pic = new EditorItem(this.ctx);
pic.visible = false;
item['pic'] = pic;
if (saveData && saveData.pic_url) {
this.loadHotZonePic(pic, saveData.pic_url);
this.loadHotZonePic(pic, saveData.pic_url, saveData.imgScale);
}
pic.x = item.x;
pic.y = item.y;
this.renderArr.push(pic);
console.log('item.x:~~~~~~ ', item.x);
console.log('item.:~~~~~~ ', item);
const textLabel = new HotZoneLabel(this.ctx);
if (this.hotZoneFontObj) {
textLabel.fontSize = this.hotZoneFontObj.size;
textLabel.fontName = this.hotZoneFontObj.name;
textLabel.fontColor = this.hotZoneFontObj.color;
}
textLabel.textAlign = 'center';
// textLabel.setOutline();
// console.log('saveData:', saveData);
item['textLabel'] = textLabel;
textLabel.setScaleXY(this.mapScale);
if (saveData && saveData.text) {
if (saveData && saveData.text && this.hotZoneFontObj) {
textLabel.text = saveData.text;
textLabel.refreshSize();
}
......@@ -292,6 +364,22 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
return item;
}
getDefaultItemType() {
if (this.customTypeGroupArr) {
const group = this.customTypeGroupArr[0];
if (group.rect) {
return 'rect';
}
if (group.pic) {
return 'pic';
}
if (group.text) {
return 'text';
}
} else {
return this.defaultItemType;
}
}
getPicItem(img, saveData = null) {
......@@ -327,9 +415,11 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
item.y = saveRect.y + saveRect.height / 2;
} else {
item.showLineDash();
// item.showLineDash();
}
item.showLineDash();
console.log('aaa');
});
return item;
}
......@@ -337,6 +427,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
onAudioUploadSuccessByImg(e, img) {
img.audio_url = e.url;
this.refresh();
}
deleteItem(e, i) {
......@@ -345,6 +436,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.hotZoneArr.splice(i, 1);
this.refreshHotZoneId();
this.refresh();
}
......@@ -352,10 +444,53 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
item.itemType = e;
this.refreshItem(item);
this.refresh();
// console.log(' in radioChange e: ', e);
}
customRadioChange(e, item) {
console.log('in customRadioChange', e);
item.gIdx = e;
this.refreshCustomItem(item);
this.refresh();
// const curGroup = this.customTypeGroupArr[e];
}
refreshCustomItem(item) {
this.hideHotZoneItem(item);
const group = this.customTypeGroupArr[item.gIdx];
if (!group) {
return;
}
if (group.text) {
item.textLabel.visible = true;
item.itemType = 'text';
}
if (group.rect) {
item.visible = true;
item.itemType = 'rect';
}
if (group.pic && !group.anima) {
item.pic.visible = true;
item.itemType = 'pic';
}
}
hideHotZoneItem(item) {
item.visible = false;
item.pic.visible = false;
item.textLabel.visible = false;
}
refreshItem(item) {
switch (item.itemType) {
case 'rect':
......@@ -368,13 +503,14 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.setTextState(item);
break;
default:
this.setNoneState(item);
}
}
init() {
console.log('init');
this.initData();
this.initCtx();
......@@ -382,18 +518,15 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
}
initItem() {
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
if (!this.bgItem) {
this.bgItem = {};
} else {
this.refreshBackground(() => {
// if (!this.imgItemArr) {
// this.imgItemArr = [];
// } else {
// this.initImgArr();
// }
// console.log('aaaaa');
if (!this.hotZoneItemArr) {
this.hotZoneItemArr = [];
......@@ -404,6 +537,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
});
}
this.refresh();
}
initHotZoneArr() {
......@@ -427,6 +561,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.hotZoneArr = [];
const arr = this.hotZoneItemArr.concat();
console.log('this.hotZoneItemArr: ', this.hotZoneItemArr);
for (let i = 0; i < arr.length; i++) {
const data = JSON.parse(JSON.stringify(arr[i]));
......@@ -449,7 +584,13 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
item.pic_url = data.pic_url;
item.text = data.text;
item.itemType = data.itemType;
if (this.customTypeGroupArr) {
this.refreshCustomItem(item);
} else {
this.refreshItem(item);
}
console.log('item: ', item);
this.hotZoneArr.push(item);
......@@ -463,48 +604,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
}
initImgArr() {
console.log('this.imgItemArr: ', this.imgItemArr);
let curBgRect;
if (this.bg) {
curBgRect = this.bg.getBoundingBox();
} else {
curBgRect = {x: 0, y: 0, width: this.canvasWidth, height: this.canvasHeight};
}
let oldBgRect = this.bgItem.rect;
if (!oldBgRect) {
oldBgRect = curBgRect;
}
const rate = curBgRect.width / oldBgRect.width;
console.log('rate: ', rate);
this.imgArr = [];
const arr = this.imgItemArr.concat();
for (let i = 0; i < arr.length; i++) {
const data = JSON.parse(JSON.stringify(arr[i]));
const img = {pic_url: data.pic_url};
data.rect.x *= rate;
data.rect.y *= rate;
data.rect.width *= rate;
data.rect.height *= rate;
data.rect.x += curBgRect.x;
data.rect.y += curBgRect.y;
img['picItem'] = this.getPicItem(img, data);
img['audio_url'] = arr[i].audio_url;
this.imgArr.push(img);
}
this.refreshImageId();
}
initData() {
this.canvasWidth = this.wrap.nativeElement.clientWidth;
......@@ -528,9 +627,10 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.oldPos = {x: this.mx, y: this.my};
for (let i = 0; i < this.hotZoneArr.length; i++) {
for (let i = this.hotZoneArr.length - 1; i >= 0; i--) {
const item = this.hotZoneArr[i];
console.log('mapDown item: ', item);
let callback;
let target;
switch (item.itemType) {
......@@ -548,7 +648,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
break;
}
if (this.checkClickTarget(target)) {
if (target && this.checkClickTarget(target)) {
callback(target);
return;
}
......@@ -582,7 +682,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.oldPos = {x: this.mx, y: this.my};
this.saveDisabled = true;
// this.saveDisabled = false;
}
......@@ -723,7 +823,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
// }
this.updateArr(this.hotZoneArr);
this.updatePos()
this.updatePos();
TWEEN.update();
......@@ -852,9 +952,21 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
saveClick() {
const sendData = this.getSendData();
this.save.emit(sendData);
}
getSendData() {
const bgItem = this.bgItem;
if (this.bg) {
bgItem['rect'] = this.bg.getBoundingBox();
const rect = this.bg.getBoundingBox();
bgItem['rect'] = rect;
rect.x = Math.round(rect.x * 100) / 100;
rect.y = Math.round(rect.y * 100) / 100;
rect.width = Math.round(rect.width * 100) / 100;
rect.height = Math.round(rect.height * 100) / 100;
} else {
bgItem['rect'] = {
x: 0,
......@@ -870,19 +982,34 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
for (let i = 0; i < hotZoneArr.length; i++) {
const hotZoneItem = {
id: hotZoneArr[i].id,
index: hotZoneArr[i].index,
pic_url: hotZoneArr[i].pic_url,
text: hotZoneArr[i].text,
audio_url: hotZoneArr[i].audio_url,
itemType: hotZoneArr[i].itemType,
fontSize: this.hotZoneFontObj.size,
fontName: this.hotZoneFontObj.name,
fontColor: this.hotZoneFontObj.color,
fontScale: hotZoneArr[i].textLabel ? hotZoneArr[i].textLabel.scaleX : 1,
imgScale: hotZoneArr[i].pic ? hotZoneArr[i].pic.scaleX : 1,
mapScale: this.mapScale
mapScale: this.mapScale,
skeJsonData: hotZoneArr[i].skeJsonData,
texJsonData: hotZoneArr[i].texJsonData,
texPngData: hotZoneArr[i].texPngData,
gIdx: hotZoneArr[i].gIdx
};
if (this.hotZoneFontObj) {
hotZoneItem['fontSize'] = this.hotZoneFontObj.size;
hotZoneItem['fontName'] = this.hotZoneFontObj.name;
hotZoneItem['ontColor'] = this.hotZoneFontObj.color;
}
if (hotZoneArr[i].itemType == 'pic') {
hotZoneItem['rect'] = hotZoneArr[i].pic.getBoundingBox();
} else {
hotZoneItem['rect'] = hotZoneArr[i].getBoundingBox();
}
// hotZoneItem['rect'] = hotZoneArr[i].getBoundingBox();
hotZoneItem['rect'].x = Math.round((hotZoneItem['rect'].x - bgItem['rect'].x) * 100) / 100;
hotZoneItem['rect'].y = Math.round((hotZoneItem['rect'].y - bgItem['rect'].y) * 100) / 100;
hotZoneItem['rect'].width = Math.round((hotZoneItem['rect'].width) * 100) / 100;
......@@ -894,7 +1021,189 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
console.log('hotZoneItemArr: ', hotZoneItemArr);
this.save.emit({bgItem, hotZoneItemArr});
return {bgItem, hotZoneItemArr};
}
saveText(item) {
if (item.itemType == 'text') {
item.textLabel.text = item.text;
}
}
setAnimaBtnClick(index) {
this.curDragonBoneIndex = index;
this.curDragonBoneGIdx = Number(this.hotZoneArr[index].gIdx);
const {skeJsonData, texJsonData, texPngData} = this.hotZoneArr[index];
this.skeJsonData = skeJsonData || {};
this.texJsonData = texJsonData || {};
this.texPngData = texPngData || {};
this.animaPanelVisible = true;
this.refresh();
}
animaPanelCancel() {
this.animaPanelVisible = false;
this.refresh();
}
animaPanelOk() {
this.setItemDragonBoneData(this.hotZoneArr[this.curDragonBoneIndex]);
console.log('this.hotZoneArr: ', this.hotZoneArr);
this.animaPanelVisible = false;
this.refresh();
}
setItemDragonBoneData(item) {
item['skeJsonData'] = this.skeJsonData;
item['texJsonData'] = this.texJsonData;
item['texPngData'] = this.texPngData;
}
skeJsonHandleChange(e) {
console.log('e: ', e);
switch (e.type) {
case 'start':
this.isSkeJsonLoading = true;
break;
case 'success':
this.skeJsonData['url'] = e.file.response.url;
this.skeJsonData['name'] = e.file.name;
this.nzMessageService.success('上传成功');
this.isSkeJsonLoading = false;
break;
case 'progress':
break;
}
}
texJsonHandleChange(e) {
console.log('e: ', e);
switch (e.type) {
case 'start':
this.isTexJsonLoading = true;
break;
case 'success':
this.texJsonData['url'] = e.file.response.url;
this.texJsonData['name'] = e.file.name;
this.nzMessageService.success('上传成功');
this.isTexJsonLoading = false;
break;
case 'progress':
break;
}
}
texPngHandleChange(e) {
console.log('e: ', e);
switch (e.type) {
case 'start':
this.isTexPngLoading = true;
break;
case 'success':
this.texPngData['url'] = e.file.response.url;
this.texPngData['name'] = e.file.name;
this.nzMessageService.success('上传成功');
this.isTexPngLoading = false;
break;
case 'progress':
break;
}
}
copyHotZoneData() {
const {bgItem, hotZoneItemArr} = this.getSendData();
// const hotZoneItemArrNew = [];
// const tmpArr = JSON.parse(JSON.stringify(hotZoneItemArr));
// tmpArr.forEach((item) => {
// if (item.gIdx === '0') {
// hotZoneItemArr.push(item);
// }
// })
const jsonData = {
bgItem,
hotZoneItemArr,
isHasRect: this.isHasRect,
isHasPic: this.isHasPic,
isHasText: this.isHasText,
isHasAudio: this.isHasAudio,
isHasAnima: this.isHasAnima,
hotZoneFontObj: this.hotZoneFontObj,
defaultItemType: this.defaultItemType,
hotZoneImgSize: this.hotZoneImgSize,
};
const oInput = document.createElement('input');
oInput.value = JSON.stringify(jsonData);
document.body.appendChild(oInput);
oInput.select(); // 选择对象
document.execCommand('Copy'); // 执行浏览器复制命令
document.body.removeChild(oInput);
this.nzMessageService.success('复制成功');
// alert('复制成功');
}
importData() {
if (!this.pasteData) {
return;
}
try {
const data = JSON.parse(this.pasteData);
console.log('data:', data);
const {
bgItem,
hotZoneItemArr,
isHasRect,
isHasPic,
isHasText,
isHasAudio,
isHasAnima,
hotZoneFontObj,
defaultItemType,
hotZoneImgSize,
} = data;
this.hotZoneItemArr = hotZoneItemArr;
this.isHasRect = isHasRect;
this.isHasPic = isHasPic;
this.isHasText = isHasText;
this.isHasAudio = isHasAudio;
this.isHasAnima = isHasAnima;
this.hotZoneFontObj = hotZoneFontObj;
this.defaultItemType = defaultItemType;
this.hotZoneImgSize = hotZoneImgSize;
this.bgItem = bgItem;
this.pasteData = '';
} catch (e) {
console.log('err: ', e);
this.nzMessageService.error('导入失败');
}
}
private updatePos() {
......@@ -917,12 +1226,15 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
break;
}
if (x != undefined && y != undefined) {
item.x = x;
item.y = y;
item.pic.x = x;
item.pic.y = y;
item.textLabel.x = x;
item.textLabel.y = y;
}
});
}
......@@ -944,6 +1256,12 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
item.textLabel.visible = true;
}
private setNoneState(item: any) {
item.visible = false;
item.pic.visible = false;
item.textLabel.visible = false;
}
private clickedHotZoneRect(item: any) {
if (this.checkClickTarget(item)) {
......@@ -962,6 +1280,17 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
private clickedHotZonePic(item: any) {
if (this.checkClickTarget(item)) {
if (item.lineDashFlag && this.checkClickTarget(item.arrow)) {
this.changeItemSize(item);
// } else if (item.lineDashFlag && this.checkClickTarget(item.arrowTop)) {
// this.changeItemTopSize(item);
// } else if (item.lineDashFlag && this.checkClickTarget(item.arrowRight)) {
// this.changeItemRightSize(item);
} else {
this.changeCurItem(item);
}
this.curItem = item;
}
}
......@@ -972,15 +1301,38 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
}
}
saveText(item) {
item.textLabel.text = item.text;
private loadHotZonePic(pic: HotZoneImg, url, scale = null) {
let baseLen;
if (this.hotZoneImgSize) {
baseLen = this.hotZoneImgSize * this.mapScale;
}
private loadHotZonePic(pic: HotZoneImg, url) {
const baseLen = this.hotZoneImgSize * this.mapScale;
pic.load(url).then(() => {
const s = getMinScale(pic, baseLen);
pic.setScaleXY(s);
if (!scale) {
if (baseLen) {
scale = getMinScale(pic, baseLen);
} else {
scale = this.bg.scaleX;
}
}
pic.setScaleXY(scale);
});
}
closeAfterPanel() {
this.refresh();
}
/**
* 刷新 渲染页面
*/
refresh() {
setTimeout(() => {
this.appRef.tick();
}, 1);
}
}
<div class="position-relative">
<button nz-button (click)="setAnimaBtnClick()" style=" border-radius: 0.5rem; border: 1px solid #ddd;">
<i nz-icon nzType="tool" nzTheme="outline"></i>
{{btnName}}
</button>
<!--配置龙骨面板-->
<nz-modal [(nzVisible)]="animaPanelVisible" (nzAfterClose)="closePanel()" nzTitle="配置资源文件"
(nzOnCancel)="animaPanelCancel()" (nzOnOk)="animaPanelOk()" nzOkText="保存">
<div class="anima-upload-btn">
<span style="margin-right: 10px">上传 ske_json 文件: </span>
<nz-upload [nzShowUploadList]="false" nzAccept="application/json" [nzAction]="uploadUrl" [nzData]="uploadData"
(nzChange)="skeJsonHandleChange($event)">
<button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
</nz-upload>
<i *ngIf="isSkeJsonLoading" style="margin-left: 10px;" nz-icon [nzType]="'loading'"></i>
<span *ngIf="skeJsonData && skeJsonData['name']" style="margin-left: 10px"><u> {{skeJsonData['name']}} </u></span>
</div>
<div class="anima-upload-btn">
<span style="margin-right: 10px">上传 tex_json 文件: </span>
<nz-upload [nzShowUploadList]="false" nzAccept="application/json" [nzAction]="uploadUrl" [nzData]="uploadData"
(nzChange)="texJsonHandleChange($event)">
<button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
</nz-upload>
<i *ngIf="isTexJsonLoading" style="margin-left: 10px;" nz-icon [nzType]="'loading'"></i>
<span *ngIf="texJsonData && texJsonData['name']" style="margin-left: 10px"><u> {{texJsonData['name']}} </u></span>
</div>
<div class="anima-upload-btn">
<span style="margin-right: 10px">上传 tex_png 文件: </span>
<nz-upload [nzShowUploadList]="false" nzAccept="image/*" [nzAction]="uploadUrl" [nzData]="uploadData"
(nzChange)="texPngHandleChange($event)">
<button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
</nz-upload>
<i *ngIf="isTexPngLoading" style="margin-left: 10px;" nz-icon [nzType]="'loading'"></i>
<span *ngIf="texPngData && texPngData['name']" style="margin-left: 10px"><u> {{texPngData['name']}} </u></span>
</div>
<div class="anima-upload-btn" *ngIf="animaNames && animaNames.length > 0">
提示:需包含动画: {{animaNames.toString()}}.
</div>
</nz-modal>
</div>
\ No newline at end of file
@import '../../style/common_mixin.css';
.p-image-uploader {
position: relative;
display: block;
width: 100%;
height: 0;
padding-bottom: 56.25%;
.p-box {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
border: 2px dashed #ddd;
border-radius: 0.5rem;
background-color: #fafafa;
text-align: center;
color: #aaa;
.p-upload-icon {
text-align: center;
margin: auto;
.anticon-upload {
color: #888;
font-size: 5rem;
}
.p-progress-bar {
position: relative;
width: 20rem;
height: 1.5rem;
border: 1px solid #ccc;
border-radius: 1rem;
.p-progress-bg {
background-color: #1890ff;
border-radius: 1rem;
height: 100%;
}
.p-progress-value {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
text-shadow: 0 0 4px #000;
color: white;
text-align: center;
font-size: 0.9rem;
line-height: 1.5rem;
}
}
}
.p-preview {
width: 100%;
height: 100%;
background-size: contain;
background-repeat: no-repeat;
background-position: 50% 50%;
//background-image: url("https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png");
}
}
.d-flex{
display: flex;
}
}
.p-btn-delete {
position: absolute;
right: -0.5rem;
top: -0.5rem;
width: 2rem;
height: 2rem;
border: 0.2rem solid white;
border-radius: 50%;
font-size: 1.2rem;
background-color: #fb781a;
color: white;
text-align: center;
}
.p-upload-progress-bg {
position: absolute;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
& .i-text {
position: absolute;
text-align: center;
color: white;
text-shadow: 0 0 2px rgba(0, 0, 0, .85);
}
& .i-bg {
position: absolute;
left: 0;
top: 0;
height: 100%;
background-color: #27b43f;
border-radius: 0.5rem;
}
}
.anima-upload-btn {
padding: 10px;
}
:host ::ng-deep .ant-upload {
display: block;
}
import {ApplicationRef, Component, EventEmitter, Input, OnChanges, OnDestroy, Output} from '@angular/core';
import { NzMessageService, UploadXHRArgs, UploadFile } from 'ng-zorro-antd';
@Component({
selector: 'app-upload-dragon-bone',
templateUrl: './upload-dragon-bone.component.html',
styleUrls: ['./upload-dragon-bone.component.scss']
})
export class UploadDragonBoneComponent implements OnDestroy, OnChanges {
uploading = false;
progress = 0;
@Input()
btnName = '配置龙骨动画';
@Input()
animaNames = [];
@Input()
skeJsonData = {};
@Input()
texJsonData = {};
@Input()
texPngData = {};
@Output()
save = new EventEmitter();
@Output()
refreshEmitter = new EventEmitter();
// @Input()
// picUrl;
// @Input()
// canDelete = false;
// @Output()
// imageUploaded = new EventEmitter();
// @Output()
// imageUploadFailure = new EventEmitter();
// @Output()
// delete = new EventEmitter();
// @Input()
// picItem = null;
// @Input()
// iconSize = 2;
// @Input()
// TIP = 'Click here to upload image';
// @Input()
// disableUpload = false;
uploadUrl;
uploadData;
animaPanelVisible = false;
isSkeJsonLoading = false;
isTexJsonLoading = false;
isTexPngLoading = false;
constructor(private appRef: ApplicationRef, private nzMessageService: NzMessageService) {
this.uploadUrl = (<any> window).courseware.uploadUrl();
this.uploadData = (<any> window).courseware.uploadData();
window['air'].getUploadCallback = (url, data) => {
this.uploadUrl = url;
this.uploadData = data;
};
}
ngOnChanges() {
}
setAnimaBtnClick() {
this.animaPanelVisible = true;
this.refresh();
}
animaPanelCancel() {
this.animaPanelVisible = false;
this.refresh();
}
animaPanelOk() {
this.sendItemDragonBoneData();
this.animaPanelVisible = false;
this.refresh();
}
sendItemDragonBoneData() {
const data = {};
data['skeJsonData'] = this.skeJsonData;
data['texJsonData'] = this.texJsonData;
data['texPngData'] = this.texPngData;
this.save.emit(data);
}
skeJsonHandleChange(e) {
console.log('e: ', e);
switch (e.type) {
case 'start':
this.isSkeJsonLoading = true;
break;
case 'success':
this.skeJsonData['url'] = e.file.response.url;
this.skeJsonData['name'] = e.file.name;
this.nzMessageService.success('上传成功');
this.isSkeJsonLoading = false;
break;
case 'progress':
break;
}
}
texJsonHandleChange(e) {
console.log('e: ', e);
switch (e.type) {
case 'start':
this.isTexJsonLoading = true;
break;
case 'success':
this.texJsonData['url'] = e.file.response.url;
this.texJsonData['name'] = e.file.name;
this.nzMessageService.success('上传成功');
this.isTexJsonLoading = false;
break;
case 'progress':
break;
}
}
texPngHandleChange(e) {
console.log('e: ', e);
switch (e.type) {
case 'start':
this.isTexPngLoading = true;
break;
case 'success':
this.texPngData['url'] = e.file.response.url;
this.texPngData['name'] = e.file.name;
this.nzMessageService.success('上传成功');
this.isTexPngLoading = false;
break;
case 'progress':
break;
}
}
/**
* 刷新 渲染页面
*/
refresh() {
// this.refreshEmitter.emit();
setTimeout(() => {
this.appRef.tick();
}, 1);
}
closePanel() {
console.log(' in closePanel ');
this.refresh();
}
ngOnDestroy() {
}
}
<div class="model-content">
<div style="padding: 10px;">
<div style="width: 300px;" align='center'>
<span>图1: </span>
<app-upload-image-with-preview
[picUrl]="item.pic_url"
(imageUploaded)="onImageUploadSuccess($event, 'pic_url')">
</app-upload-image-with-preview>
<div style="margin-left: 5%; width:90%; margin-top: 100px; margin-bottom: 50px;">
<span style="height: 30px; font-size: 18px;">标题音频:</span>
<app-audio-recorder [audioUrl]="item.tittleAudio" (audioUploaded)="onAudioUploadSuccess($event)">
</app-audio-recorder>
<br>
<span style="height: 30px; font-size: 18px;">标题文本:</span>
<input style="width: 150px; " type="text" maxlength="15" nz-input [(ngModel)]="item.tittleTxt" (blur)="save()">
</div>
<div style="width: 300px; margin-top: 5px;" align='center'>
<span>图2: </span>
<app-upload-image-with-preview
[picUrl]="item.pic_url_2"
(imageUploaded)="onImageUploadSuccess($event, 'pic_url_2')">
</app-upload-image-with-preview>
<div *ngFor="let question of item.questionList; let i = index">
<div style="border-style: dotted; border-width: 1px;">
<div style="margin-left: 5%; margin-bottom: 50px; padding-top: 20px; ">
<span style="height: 30px; font-size: 18px;">问题{{i + 1}}音频:</span>
<app-audio-recorder [audioUrl]="question.questionAudio"
(audioUploaded)="onQuestionAudioUploadSuccess($event, i)">
</app-audio-recorder>
<br>
<span style="height: 30px; font-size: 18px;">问题{{i + 1}}文本:</span>
<br>
<input style="width: 150px; " type="text" maxlength="15" nz-input [(ngModel)]="question.questionTxt"
(blur)="save()">
<br>
<br>
<span style="height: 30px; font-size: 18px;">问题{{i + 1}}选项:</span>
<div *ngFor="let option of question.optionList; let j = index">
<div style="margin-top: 20px; float: left; border-width: 1px; border-style: dotted;
padding: 20px; margin-right: 20px; width: 230px;">
<span style="height: 30px; font-size: 18px;">选项{{j + 1}}音频:</span>
<app-audio-recorder [audioUrl]="option.optionAudio" (audioUploaded)="onOptionUploadSuccess($event, i, j)">
</app-audio-recorder>
<br>
<span style="height: 30px; font-size: 18px;">选项{{j + 1}}骨骼动画:</span>
<app-upload-dragon-bone [btnName]="[['配置骨骼动画']]" [animaNames]="[[['normal']]]"
[skeJsonData]=option.optionDragonBone.skeJsonData [texJsonData]=option.optionDragonBone.texJsonData
[texPngData]=option.optionDragonBone.texPngData (save)="saveAnima($event, option.optionDragonBone)"
(refreshEmitter)="refresh()">
</app-upload-dragon-bone>
<br>
<nz-radio-group [(ngModel)]="question.rightOptionIdx">
<div [nzValue]="j" nz-radio (click)="radioClick(i, j)">
<span style="height: 30px; font-size: 18px;">正确选项</span>
</div>
</nz-radio-group>
<div style="width: 300px; margin-top: 15px;">
<span>文本: </span>
<input type="text" nz-input [(ngModel)]="item.text" (blur)="save()">
<div *ngIf="(question.optionList.length >= 4)">
<button style="margin-top: 20px; width: 100%; height: 32px; color: red;" nz-button nzType="dashed"
class="add-btn" (click)="removeOption(i, j)">
删除选项
</button>
</div>
<div style="margin-top: 5px">
<span>音频: </span>
<app-audio-recorder
[audioUrl]="item.audio_url"
(audioUploaded)="onAudioUploadSuccess($event, 'audio_url')"
></app-audio-recorder>
</div>
</div>
<div *ngIf="(question.optionList.length < 4)">
<button style="margin-top: 20px; float: left; border-width: 1px;
border-style: dotted; padding: 20px; margin-right: 20px;
width: 230px; height: 231px;" nz-button nzType="dashed" class="add-btn" (click)="addOption(i)">
增加选项
</button>
</div>
</div>
<button style="margin-left: 5%; margin-top: 50px; width: 90%; height: 32px; color: red;" nz-button nzType="dashed"
class="add-btn" (click)="removeQuestion(i)">
删除问题{{i+1}}
</button>
<div style=" height: 50px; margin-top: 50px;">
</div>
</div>
</div>
<button style="margin-left: 5%; margin-top: 2px; margin-bottom: 100px; height: 50px; width: 90%;" nz-button
nzType="dashed" class="add-btn" (click)="addQuestion()">
添加问题
</button>
</div>
\ No newline at end of file
......@@ -18,24 +18,65 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
createShell() {
this.item.wordList.push({
word: '',
audio: '',
backWord: '',
backWordAudio: '',
addQuestion() {
this.item.questionList.push({
"questionAudio": "",
"questionTxt": "",
"rightOptionIdx": 0,
"optionList": [{
"optionDragonBone": {
"skeJsonData": { "url": "" },
"texJsonData": { "url": "" },
"texPngData": { "url": "" }
},
"optionAudio": ""
}, {
"optionDragonBone": {
"skeJsonData": { "url": "" },
"texJsonData": { "url": "" },
"texPngData": { "url": "" }
},
"optionAudio": ""
}, {
"optionDragonBone": {
"skeJsonData": { "url": "" },
"texJsonData": { "url": "" },
"texPngData": { "url": "" }
},
"optionAudio": ""
}]
});
this.save();
}
removeShell(idx) {
this.item.wordList.splice(idx, 1);
removeQuestion(idx) {
this.item.questionList.splice(idx, 1);
this.save();
}
ngOnInit() {
addOption(questionIdx) {
this.item.questionList[questionIdx].optionList.push({
"optionDragonBone": {
"skeJsonData": { "url": "" },
"texJsonData": { "url": "" },
"texPngData": { "url": "" }
},
"optionAudio": ""
});
this.save();
}
this.item = {};
removeOption(questionIdx, optionIdx) {
this.item.questionList[questionIdx].optionList.splice(optionIdx, 1);
this.save();
}
ngOnInit() {
this.item = {
tittleAudio: "",
tittleTxt: "",
questionList: []
};
// 获取存储的数据
(<any>window).courseware.getData((data) => {
......@@ -62,33 +103,35 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
/**
* 储存图片数据
* 储存音频数据
* @param e
*/
onImageUploadSuccess(e, key) {
onAudioUploadSuccess(e) {
this.item.tittleAudio = e.url;
this.save();
}
this.item[key] = e.url;
onOptionUploadSuccess(e, questionIdx, optionIdx) {
this.item.questionList[questionIdx].optionList[optionIdx].optionAudio = e.url;
this.save();
}
/**
* 储存音频数据
* @param e
*/
onAudioUploadSuccess(e, key) {
this.item[key] = e.url;
onQuestionAudioUploadSuccess(e, questionIdx) {
this.item.questionList[questionIdx].questionAudio = e.url;
this.save();
// questionTxt
}
onWordAudioUploadSuccess(e, idx) {
this.item.wordList[idx].audio = e.url;
radioClick(questionIdx, optionIdx) {
this.item.questionList[questionIdx].rightOptionIdx = optionIdx;
this.save();
}
onBackWordAudioUploadSuccess(e, idx) {
this.item.wordList[idx].backWordAudio = e.url;
saveAnima(event, group) {
group.skeJsonData = event.skeJsonData;
group.texJsonData = event.texJsonData;
group.texPngData = event.texPngData;
this.save();
}
......
......@@ -17,10 +17,10 @@
"__id__": 2
},
{
"__id__": 69
"__id__": 85
},
{
"__id__": 73
"__id__": 95
}
],
"_active": true,
......@@ -81,28 +81,28 @@
"__id__": 18
},
{
"__id__": 23
"__id__": 24
},
{
"__id__": 34
"__id__": 36
},
{
"__id__": 36
"__id__": 38
},
{
"__id__": 50
"__id__": 52
}
],
"_active": true,
"_components": [
{
"__id__": 66
"__id__": 82
},
{
"__id__": 67
"__id__": 83
},
{
"__id__": 68
"__id__": 84
}
],
"_prefab": null,
......@@ -801,10 +801,10 @@
"_active": true,
"_components": [
{
"__id__": 21
"__id__": 22
},
{
"__id__": 22
"__id__": 23
}
],
"_prefab": null,
......@@ -867,6 +867,9 @@
"_components": [
{
"__id__": 20
},
{
"__id__": 21
}
],
"_prefab": null,
......@@ -953,6 +956,74 @@
"_N$cacheMode": 0,
"_id": "c83eSosytNTbF8xtdrdq8O"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 19
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "d00In5lf1MtIx6hAQdAiW4"
},
{
"__type__": "cc.Sprite",
"_name": "",
......@@ -1021,16 +1092,16 @@
},
"_children": [
{
"__id__": 24
"__id__": 25
},
{
"__id__": 30
"__id__": 32
}
],
"_active": true,
"_components": [
{
"__id__": 33
"__id__": 35
}
],
"_prefab": null,
......@@ -1086,20 +1157,20 @@
"_name": "leef",
"_objFlags": 0,
"_parent": {
"__id__": 23
"__id__": 24
},
"_children": [
{
"__id__": 25
"__id__": 26
}
],
"_active": true,
"_components": [
{
"__id__": 28
"__id__": 30
},
{
"__id__": 29
"__id__": 31
}
],
"_prefab": null,
......@@ -1155,16 +1226,19 @@
"_name": "TittleLabelNode",
"_objFlags": 0,
"_parent": {
"__id__": 24
"__id__": 25
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 26
"__id__": 27
},
{
"__id__": 27
"__id__": 28
},
{
"__id__": 29
}
],
"_prefab": null,
......@@ -1220,7 +1294,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
"__id__": 26
},
"_enabled": true,
"_materials": [
......@@ -1256,7 +1330,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
"__id__": 26
},
"_enabled": true,
"alignMode": 1,
......@@ -1278,12 +1352,80 @@
"_originalHeight": 0,
"_id": "18Hj7uxLdC5q4JgV4ovVM9"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 26
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "abEA2SIcRJKZnMbxOpZ6Cl"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
"__id__": 25
},
"_enabled": true,
"_materials": [
......@@ -1315,7 +1457,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
"__id__": 25
},
"_enabled": true,
"alignMode": 1,
......@@ -1342,16 +1484,16 @@
"_name": "leevies",
"_objFlags": 0,
"_parent": {
"__id__": 23
"__id__": 24
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 31
"__id__": 33
},
{
"__id__": 32
"__id__": 34
}
],
"_prefab": null,
......@@ -1407,7 +1549,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
"__id__": 32
},
"_enabled": true,
"_materials": [
......@@ -1439,7 +1581,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
"__id__": 32
},
"_enabled": true,
"alignMode": 1,
......@@ -1466,7 +1608,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 23
"__id__": 24
},
"_enabled": true,
"alignMode": 1,
......@@ -1499,7 +1641,7 @@
"_active": true,
"_components": [
{
"__id__": 35
"__id__": 37
}
],
"_prefab": null,
......@@ -1527,7 +1669,7 @@
"array": [
0,
0,
709.2660518141165,
710.1408311032397,
0,
0,
0,
......@@ -1555,7 +1697,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 34
"__id__": 36
},
"_enabled": true,
"_cullingMask": 4294967295,
......@@ -1595,19 +1737,19 @@
},
"_children": [
{
"__id__": 37
"__id__": 39
},
{
"__id__": 41
"__id__": 43
},
{
"__id__": 45
"__id__": 47
}
],
"_active": true,
"_components": [
{
"__id__": 49
"__id__": 51
}
],
"_prefab": null,
......@@ -1663,19 +1805,19 @@
"_name": "BtnBefore",
"_objFlags": 0,
"_parent": {
"__id__": 36
"__id__": 38
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 38
"__id__": 40
},
{
"__id__": 39
"__id__": 41
},
{
"__id__": 40
"__id__": 42
}
],
"_prefab": null,
......@@ -1731,7 +1873,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 37
"__id__": 39
},
"_enabled": true,
"_materials": [
......@@ -1763,7 +1905,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 37
"__id__": 39
},
"_enabled": true,
"alignMode": 1,
......@@ -1790,7 +1932,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 37
"__id__": 39
},
"_enabled": true,
"_normalMaterial": null,
......@@ -1858,19 +2000,19 @@
"_name": "BtnRefresh",
"_objFlags": 0,
"_parent": {
"__id__": 36
"__id__": 38
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 42
"__id__": 44
},
{
"__id__": 43
"__id__": 45
},
{
"__id__": 44
"__id__": 46
}
],
"_prefab": null,
......@@ -1926,7 +2068,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 41
"__id__": 43
},
"_enabled": true,
"_materials": [
......@@ -1958,7 +2100,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 41
"__id__": 43
},
"_enabled": true,
"alignMode": 1,
......@@ -1985,7 +2127,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 41
"__id__": 43
},
"_enabled": true,
"_normalMaterial": null,
......@@ -2053,19 +2195,19 @@
"_name": "BtnNext",
"_objFlags": 0,
"_parent": {
"__id__": 36
"__id__": 38
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 46
"__id__": 48
},
{
"__id__": 47
"__id__": 49
},
{
"__id__": 48
"__id__": 50
}
],
"_prefab": null,
......@@ -2121,7 +2263,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 45
"__id__": 47
},
"_enabled": true,
"_materials": [
......@@ -2153,7 +2295,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 45
"__id__": 47
},
"_enabled": true,
"alignMode": 1,
......@@ -2180,7 +2322,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 45
"__id__": 47
},
"_enabled": true,
"_normalMaterial": null,
......@@ -2248,7 +2390,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 36
"__id__": 38
},
"_enabled": true,
"alignMode": 1,
......@@ -2278,9 +2420,6 @@
"__id__": 2
},
"_children": [
{
"__id__": 51
},
{
"__id__": 53
},
......@@ -2298,12 +2437,36 @@
},
{
"__id__": 63
},
{
"__id__": 65
},
{
"__id__": 67
},
{
"__id__": 69
},
{
"__id__": 71
},
{
"__id__": 73
},
{
"__id__": 75
},
{
"__id__": 77
},
{
"__id__": 79
}
],
"_active": false,
"_components": [
{
"__id__": 65
"__id__": 81
}
],
"_prefab": null,
......@@ -2317,8 +2480,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2359,13 +2522,13 @@
"_name": "Option_3_0",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 52
"__id__": 54
}
],
"_prefab": null,
......@@ -2421,7 +2584,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 51
"__id__": 53
},
"_enabled": true,
"_materials": [
......@@ -2453,13 +2616,13 @@
"_name": "Option_3_1",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 54
"__id__": 56
}
],
"_prefab": null,
......@@ -2515,7 +2678,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 53
"__id__": 55
},
"_enabled": true,
"_materials": [
......@@ -2547,13 +2710,13 @@
"_name": "Option_3_2",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 56
"__id__": 58
}
],
"_prefab": null,
......@@ -2609,7 +2772,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 55
"__id__": 57
},
"_enabled": true,
"_materials": [
......@@ -2641,13 +2804,13 @@
"_name": "Option_4_0",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 58
"__id__": 60
}
],
"_prefab": null,
......@@ -2703,7 +2866,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 57
"__id__": 59
},
"_enabled": true,
"_materials": [
......@@ -2735,13 +2898,13 @@
"_name": "Option_4_1",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 60
"__id__": 62
}
],
"_prefab": null,
......@@ -2797,7 +2960,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 59
"__id__": 61
},
"_enabled": true,
"_materials": [
......@@ -2829,13 +2992,13 @@
"_name": "Option_4_2",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 62
"__id__": 64
}
],
"_prefab": null,
......@@ -2891,7 +3054,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 61
"__id__": 63
},
"_enabled": true,
"_materials": [
......@@ -2923,13 +3086,13 @@
"_name": "Option_4_3",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 64
"__id__": 66
}
],
"_prefab": null,
......@@ -2985,7 +3148,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 63
"__id__": 65
},
"_enabled": true,
"_materials": [
......@@ -3012,104 +3175,20 @@
"_atlas": null,
"_id": "14wG0XVWBFsbXutzUOkHb9"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 50
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "10zhMcFZhLa5A3dmjvWI0q"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_fitWidth": false,
"_fitHeight": true,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "e1d8bdYeklMZbNx/+khC3nb",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_id": "28Z9NAhrlJQLvN066DHDpb"
},
{
"__type__": "cc.Node",
"_name": "OptionNodeBase_3",
"_name": "OptionTarget_4_3",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 70
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 72
"__id__": 68
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -3121,8 +3200,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -3133,8 +3212,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-377.214,
-290.02,
75,
-40,
0,
0,
0,
......@@ -3156,20 +3235,52 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "70hkljA7VNAadXgb2mMAsR"
"_id": "61DfBHgGBD+YtSGfiatQsF"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 67
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8cdb44ac-a3f6-449f-b354-7cd48cf84061"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "1bbeCfsfZLvrzqca43h4SJ"
},
{
"__type__": "cc.Node",
"_name": "OptionBg",
"_name": "OptionTarget_4_2",
"_objFlags": 0,
"_parent": {
"__id__": 69
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 71
"__id__": 70
}
],
"_prefab": null,
......@@ -3183,8 +3294,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 430,
"height": 154
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -3195,8 +3306,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
25,
-40,
0,
0,
0,
......@@ -3218,14 +3329,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "3110bUNQRMhb+u1tQH69W8"
"_id": "61ZB2xuTZLI6A8hBmdkmAG"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 70
"__id__": 69
},
"_enabled": true,
"_materials": [
......@@ -3236,7 +3347,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "08a24fc8-782c-40d4-be3e-5123f1695dfb"
"__uuid__": "8cdb44ac-a3f6-449f-b354-7cd48cf84061"
},
"_type": 0,
"_sizeMode": 1,
......@@ -3250,18 +3361,22 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "a23678EqJBIIRyNc0a4aOR"
"_id": "767LBhh6BEoJrZNPKyTYg6"
},
{
"__type__": "cc.Node",
"_name": "OptionDragonBoneBaseNode",
"_name": "OptionTarget_4_1",
"_objFlags": 0,
"_parent": {
"__id__": 69
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [],
"_components": [
{
"__id__": 72
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -3273,8 +3388,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -3285,8 +3400,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
-25,
-40,
0,
0,
0,
......@@ -3308,28 +3423,1217 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "dcBLD7MJNPJaLqidCcbBHK"
"_id": "e3VXxVg3NLNoq8QO7QWo3q"
},
{
"__type__": "cc.Node",
"_name": "OptionNodeBase_4",
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 74
"node": {
"__id__": 71
},
"_enabled": true,
"_materials": [
{
"__id__": 76
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8cdb44ac-a3f6-449f-b354-7cd48cf84061"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "40Cpo9u8tBioUqLxntsbp0"
},
{
"__type__": "cc.Node",
"_name": "OptionTarget_4_0",
"_objFlags": 0,
"_parent": {
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 74
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-75,
-40,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "5dBmfYUk9E2YfDAr0d1QhL"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 73
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8cdb44ac-a3f6-449f-b354-7cd48cf84061"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "39nkcYli9LFo7yjhEoyUi/"
},
{
"__type__": "cc.Node",
"_name": "OptionTarget_3_2",
"_objFlags": 0,
"_parent": {
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 76
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
50,
-40,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "92YZkEXYZGgZ7ToE3DY838"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 75
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8cdb44ac-a3f6-449f-b354-7cd48cf84061"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "1bok+NMhlDiJzDae9HQpdy"
},
{
"__type__": "cc.Node",
"_name": "OptionTarget_3_1",
"_objFlags": 0,
"_parent": {
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 78
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-40,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "6453pM4ARNj6eILo02Oip6"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 77
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8cdb44ac-a3f6-449f-b354-7cd48cf84061"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "1d3jouNu5GQoMTwwpteJsr"
},
{
"__type__": "cc.Node",
"_name": "OptionTarget_3_0",
"_objFlags": 0,
"_parent": {
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 80
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-50,
-40,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "08fHG/ZVpAqqaILfviWk97"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 79
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8cdb44ac-a3f6-449f-b354-7cd48cf84061"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "5ctIMxaJpCPqDnXZ5q9xOm"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 52
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "10zhMcFZhLa5A3dmjvWI0q"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_fitWidth": false,
"_fitHeight": true,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "e1d8bdYeklMZbNx/+khC3nb",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_id": "28Z9NAhrlJQLvN066DHDpb"
},
{
"__type__": "cc.Node",
"_name": "OptionNodeBase_3",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 86
},
{
"__id__": 88
},
{
"__id__": 89
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 430,
"height": 154
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-377.214,
-290.02,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "70hkljA7VNAadXgb2mMAsR"
},
{
"__type__": "cc.Node",
"_name": "OptionBg",
"_objFlags": 0,
"_parent": {
"__id__": 85
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 87
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 430,
"height": 154
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "3110bUNQRMhb+u1tQH69W8"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 86
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "08a24fc8-782c-40d4-be3e-5123f1695dfb"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "a23678EqJBIIRyNc0a4aOR"
},
{
"__type__": "cc.Node",
"_name": "OptionDragonBoneBaseNode",
"_objFlags": 0,
"_parent": {
"__id__": 85
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "dcBLD7MJNPJaLqidCcbBHK"
},
{
"__type__": "cc.Node",
"_name": "OptionSpeakerBtn",
"_objFlags": 0,
"_parent": {
"__id__": 85
},
"_children": [
{
"__id__": 90
},
{
"__id__": 92
}
],
"_active": true,
"_components": [
{
"__id__": 94
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 97,
"height": 76
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-129.311,
-17.605,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "25RypleG1KhaspUX9Y5DJ4"
},
{
"__type__": "cc.Node",
"_name": "BtnFlower",
"_objFlags": 0,
"_parent": {
"__id__": 89
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 91
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 97,
"height": 76
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "95BXx8sodP5JuhWV0ups+F"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 90
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "ecac7b15-4fed-451d-9e71-a49ce5e94ab1"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "d5uNoZpwpOjp7DaTo2vgRV"
},
{
"__type__": "cc.Node",
"_name": "BtnFlower_P",
"_objFlags": 0,
"_parent": {
"__id__": 89
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 93
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 97,
"height": 76
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "36+y4w5UtF76Y7VI6S+E38"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 92
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "3c6dfb3e-4865-4f1a-bea1-dd33d35b56f5"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "46kqTZ5i5MXI9Z91SFIIEL"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 89
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "134S/UhYpDv666CFtudPPd"
},
{
"__type__": "cc.Node",
"_name": "OptionNodeBase_4",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 96
},
{
"__id__": 98
},
{
"__id__": 99
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-754.428,
-580.04,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "cc72NFcpdB37pnE7FSVwbJ"
},
{
"__type__": "cc.Node",
"_name": "OptionBg",
"_objFlags": 0,
"_parent": {
"__id__": 95
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 97
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 322,
"height": 115
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "0b6k2BEAZGBqY03zJMrmdq"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 96
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8471267b-453c-4c90-9bcd-d086725c0376"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "00x5gDHw9EgYibMXPZzYaS"
},
{
"__type__": "cc.Node",
"_name": "OptionDragonBoneBaseNode",
"_objFlags": 0,
"_parent": {
"__id__": 95
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
......@@ -3350,8 +4654,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-754.428,
-580.04,
0,
0,
0,
0,
0,
......@@ -3373,20 +4677,89 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "cc72NFcpdB37pnE7FSVwbJ"
"_id": "25LhJB5BZPg4J1l9gVSyC7"
},
{
"__type__": "cc.Node",
"_name": "OptionBg",
"_name": "OptionSpeakerBtn",
"_objFlags": 0,
"_parent": {
"__id__": 73
"__id__": 95
},
"_children": [
{
"__id__": 100
},
{
"__id__": 102
}
],
"_active": true,
"_components": [
{
"__id__": 104
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 97,
"height": 76
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-100.522,
-10.831,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "0da5AUxmVPXqm/EuGfTfxE"
},
{
"__type__": "cc.Node",
"_name": "BtnFlower",
"_objFlags": 0,
"_parent": {
"__id__": 99
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 75
"__id__": 101
}
],
"_prefab": null,
......@@ -3400,8 +4773,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 322,
"height": 115
"width": 97,
"height": 76
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -3435,14 +4808,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "0b6k2BEAZGBqY03zJMrmdq"
"_id": "f38CwToFlNiqv3SojzGvBB"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 74
"__id__": 100
},
"_enabled": true,
"_materials": [
......@@ -3453,7 +4826,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8471267b-453c-4c90-9bcd-d086725c0376"
"__uuid__": "ecac7b15-4fed-451d-9e71-a49ce5e94ab1"
},
"_type": 0,
"_sizeMode": 1,
......@@ -3467,18 +4840,22 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "00x5gDHw9EgYibMXPZzYaS"
"_id": "b376sz8t5I7pwD1VnH3+YN"
},
{
"__type__": "cc.Node",
"_name": "OptionDragonBoneBaseNode",
"_name": "BtnFlower_P",
"_objFlags": 0,
"_parent": {
"__id__": 73
"__id__": 99
},
"_children": [],
"_active": true,
"_components": [],
"_components": [
{
"__id__": 103
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -3490,8 +4867,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 97,
"height": 76
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -3525,6 +4902,106 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "25LhJB5BZPg4J1l9gVSyC7"
"_id": "6dBMDEVptIl7lTaK9g571m"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 102
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "3c6dfb3e-4865-4f1a-bea1-dd33d35b56f5"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "5czU6LbV5Hoqa/AlG9UVCY"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 99
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "28Opuy3+hAYJuHzagY5gkU"
}
]
\ No newline at end of file
......@@ -10,6 +10,8 @@ import {
playEffect,
stopEffect,
loadImgByUrl,
blinkNode,
stopBlinkNode,
asyncLoadImgByUrl,
asyncPlayEffectByUrl,
asyncLoadDragonBoneAnime,
......@@ -126,6 +128,14 @@ cc.Class({
addButtonListener(cc.find('Canvas/BtnNode/BtnRefresh'), () => {
this.showQuestion();
});
cc.find('Canvas/bgFrount/leef/TittleLabelNode').on('click', () => {
this.playIncomeAudio();
});
cc.find('Canvas/QuestionLabelBg/QuestionLabelNode').on('click', () => {
this.playQuestionAudio();
});
},
updateBgSize() {
......@@ -134,7 +144,18 @@ cc.Class({
async showQuestion() {
this.showOptions();
this.playIncomeAudio();
await this.questionBoardDown();
this.playQuestionAudio();
},
playIncomeAudio() {
asyncPlayEffectByUrl(this.data.tittleAudio);
},
playQuestionAudio() {
const audioUrl = this.data.questionList[this.status.currentQuestionIdx].questionAudio;
asyncPlayEffectByUrl(audioUrl);
},
showOptions() {
......@@ -149,14 +170,65 @@ cc.Class({
const optionNode = cc.instantiate(cc.find(`OptionNodeBase_${optionList.length}`));
optionNode.name = `optionNode_${idx}`;
optionNode.parent = cc.find('Canvas');
optionNode.addComponent(cc.Button);
optionNode.canClick = true;
optionNode.on('click', () => {
this.onOptionClicked(optionNode, idx);
});
const posNode = cc.find(`Canvas/OptionPosListBase/Option_${optionList.length}_${idx}`)
optionNode.x = posNode.x;
optionNode.y = posNode.y;
const animeNode = await asyncLoadDragonBoneAnime(cc.find('OptionDragonBoneBaseNode', optionNode), data.optionDragonBone);
// await asyncPlayDragonBoneAnimation(cc.find('OptionDragonBoneBaseNode', optionNode), 'normal', 1);
animeNode.scale = Math.min(260 / animeNode.width, 360 / animeNode.height, 1);
animeNode.name = 'animeNode';
animeNode.addComponent(cc.Button);
animeNode.on('click', () => {
this.onOptionClicked(optionNode, idx);
});
const btnFlower = cc.find('OptionSpeakerBtn/BtnFlower', optionNode);
const btnFlowerP = cc.find('OptionSpeakerBtn/BtnFlower_P', optionNode);
addButtonListener(cc.find('OptionSpeakerBtn', optionNode), async () => {
blinkNode(optionNode, btnFlowerP, btnFlower);
await asyncPlayEffectByUrl(data.optionAudio);
asyncPlayDragonBoneAnimation(animeNode, 'smoke', 1);
// asyncPlayDragonBoneAnimation(animeNode, 'normal', 1);
stopBlinkNode(optionNode, btnFlowerP, btnFlower);
});
});
},
async onOptionClicked(optionNode, idx) {
if (!optionNode.canClick) {
return;
}
optionNode.canClick = false;
if (this.data.questionList[this.status.currentQuestionIdx].rightOptionIdx == idx) {
this.onOptionRight(optionNode, idx);
return;
}
this.onOptionWrong(optionNode);
},
onOptionWrong(optionNode) {
const animeNode = cc.find('OptionDragonBoneBaseNode/animeNode', optionNode);
animeNode.color = cc.color(150, 150, 150, 255);
},
onOptionRight(optionNode, idx) {
const optionList = this.data.questionList[this.status.currentQuestionIdx].optionList;
const posNode = cc.find(`Canvas/OptionPosListBase/OptionTarget_${optionList.length}_${idx}`)
cc.tween(optionNode)
.to(1, { x: posNode.x }, { easing: 'quadIn' })
.start();
cc.tween(optionNode)
.to(1, { y: posNode.y, scale: 0.3 })
.to(0.5, { opacity: 0 })
.start();
},
async questionBoardDown() {
......
module.exports = {
"tittleAudio": "http://staging-teach.cdn.ireadabc.com/23376490a9ba0f4a3fe0618fc1c935e1.mp3",
"tittleTxt": "I can do everything",
"tittleAudio": "http://staging-teach.cdn.ireadabc.com/6f141b430bf272cafc368256316596db.mp3",
"tittleTxt": "asdf sd fs sdf",
"questionList": [{
"questionAudio": "http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3",
"questionTxt": "I can stand up.",
"questionAudio": "http://staging-teach.cdn.ireadabc.com/90e313405ba454880e75ff6958ea05c0.mp3",
"questionTxt": "12as s df sdf",
"rightOptionIdx": 0,
"optionList": [{
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/a635f41fbf68fc3018ce410b0fcb5aaa.json",
"name": "fire1_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/79b4953474486ab31ac50235f432156b.json",
"name": "fire1_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/107c65ac1df1143b4be3785134315fed.png",
"name": "fire1_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/8ba49890c74b8c68b1da4556ac8c1dda.mp3"
}, {
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/23c8c8e640e580f5e9c61655037646d8.json",
"name": "smoke_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/e06181997beea3c9ba0e55405ae62303.json",
"name": "smoke_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/ea298bb8c6648f605f93d576735ff3cf.png",
"name": "smoke_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/8ba49890c74b8c68b1da4556ac8c1dda.mp3"
}, {
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/91535f61a3406373c661389cff8518bc.json",
"name": "monster_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/62df6f7db6168d608c3ba48e1ae4daf6.json",
"name": "monster_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/81a5997a815e141fc490b4f7ca4db55f.png",
"name": "monster_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/b75df34ef55bd1c6e3a799f1dac87fec.mp3"
}]
}, {
"questionAudio": "http://staging-teach.cdn.ireadabc.com/90e313405ba454880e75ff6958ea05c0.mp3",
"questionTxt": "12as s df sdf",
"rightOptionIdx": 1,
"optionList": [{
"optionDragonBone": {
"skeJsonData": { "url": "" },
"texJsonData": { "url": "" },
"texPngData": { "url": "" }
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/a635f41fbf68fc3018ce410b0fcb5aaa.json",
"name": "fire1_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/79b4953474486ab31ac50235f432156b.json",
"name": "fire1_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/107c65ac1df1143b4be3785134315fed.png",
"name": "fire1_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/8ba49890c74b8c68b1da4556ac8c1dda.mp3"
}, {
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/23c8c8e640e580f5e9c61655037646d8.json",
"name": "smoke_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/e06181997beea3c9ba0e55405ae62303.json",
"name": "smoke_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/ea298bb8c6648f605f93d576735ff3cf.png",
"name": "smoke_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/8ba49890c74b8c68b1da4556ac8c1dda.mp3"
}, {
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/91535f61a3406373c661389cff8518bc.json",
"name": "monster_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/62df6f7db6168d608c3ba48e1ae4daf6.json",
"name": "monster_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/81a5997a815e141fc490b4f7ca4db55f.png",
"name": "monster_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/b75df34ef55bd1c6e3a799f1dac87fec.mp3"
}]
}, {
"questionAudio": "http://staging-teach.cdn.ireadabc.com/90e313405ba454880e75ff6958ea05c0.mp3",
"questionTxt": "12as s df sdf",
"rightOptionIdx": 2,
"optionList": [{
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/a635f41fbf68fc3018ce410b0fcb5aaa.json",
"name": "fire1_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/79b4953474486ab31ac50235f432156b.json",
"name": "fire1_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/107c65ac1df1143b4be3785134315fed.png",
"name": "fire1_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/8ba49890c74b8c68b1da4556ac8c1dda.mp3"
}, {
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/23c8c8e640e580f5e9c61655037646d8.json",
"name": "smoke_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/e06181997beea3c9ba0e55405ae62303.json",
"name": "smoke_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/ea298bb8c6648f605f93d576735ff3cf.png",
"name": "smoke_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/8ba49890c74b8c68b1da4556ac8c1dda.mp3"
}, {
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/91535f61a3406373c661389cff8518bc.json",
"name": "monster_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/62df6f7db6168d608c3ba48e1ae4daf6.json",
"name": "monster_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/81a5997a815e141fc490b4f7ca4db55f.png",
"name": "monster_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/b75df34ef55bd1c6e3a799f1dac87fec.mp3"
}]
}, {
"questionAudio": "http://staging-teach.cdn.ireadabc.com/90e313405ba454880e75ff6958ea05c0.mp3",
"questionTxt": "12as s df sdf",
"rightOptionIdx": 0,
"optionList": [{
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/a635f41fbf68fc3018ce410b0fcb5aaa.json",
"name": "fire1_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/79b4953474486ab31ac50235f432156b.json",
"name": "fire1_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/107c65ac1df1143b4be3785134315fed.png",
"name": "fire1_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/8ba49890c74b8c68b1da4556ac8c1dda.mp3"
}, {
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/23c8c8e640e580f5e9c61655037646d8.json",
"name": "smoke_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/e06181997beea3c9ba0e55405ae62303.json",
"name": "smoke_tex.json"
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3"
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/ea298bb8c6648f605f93d576735ff3cf.png",
"name": "smoke_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/8ba49890c74b8c68b1da4556ac8c1dda.mp3"
}, {
"optionDragonBone": {
"skeJsonData": { "url": "" },
"texJsonData": { "url": "" },
"texPngData": { "url": "" }
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/91535f61a3406373c661389cff8518bc.json",
"name": "monster_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/62df6f7db6168d608c3ba48e1ae4daf6.json",
"name": "monster_tex.json"
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3"
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/81a5997a815e141fc490b4f7ca4db55f.png",
"name": "monster_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/b75df34ef55bd1c6e3a799f1dac87fec.mp3"
}, {
"optionDragonBone": {
"skeJsonData": { "url": "" },
"texJsonData": { "url": "" },
"texPngData": { "url": "" }
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/91535f61a3406373c661389cff8518bc.json",
"name": "monster_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/62df6f7db6168d608c3ba48e1ae4daf6.json",
"name": "monster_tex.json"
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3"
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/81a5997a815e141fc490b4f7ca4db55f.png",
"name": "monster_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/b75df34ef55bd1c6e3a799f1dac87fec.mp3"
}]
}, {
"questionAudio": "http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3",
"questionTxt": "I can stand up.",
"questionAudio": "http://staging-teach.cdn.ireadabc.com/90e313405ba454880e75ff6958ea05c0.mp3",
"questionTxt": "12as s df sdf",
"rightOptionIdx": 1,
"optionList": [{
"optionDragonBone": {
"skeJsonData": { "url": "" },
"texJsonData": { "url": "" },
"texPngData": { "url": "" }
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/a635f41fbf68fc3018ce410b0fcb5aaa.json",
"name": "fire1_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/79b4953474486ab31ac50235f432156b.json",
"name": "fire1_tex.json"
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3"
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/107c65ac1df1143b4be3785134315fed.png",
"name": "fire1_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/8ba49890c74b8c68b1da4556ac8c1dda.mp3"
}, {
"optionDragonBone": {
"skeJsonData": { "url": "" },
"texJsonData": { "url": "" },
"texPngData": { "url": "" }
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/23c8c8e640e580f5e9c61655037646d8.json",
"name": "smoke_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/e06181997beea3c9ba0e55405ae62303.json",
"name": "smoke_tex.json"
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3"
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/ea298bb8c6648f605f93d576735ff3cf.png",
"name": "smoke_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/8ba49890c74b8c68b1da4556ac8c1dda.mp3"
}, {
"optionDragonBone": {
"skeJsonData": { "url": "" },
"texJsonData": { "url": "" },
"texPngData": { "url": "" }
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/91535f61a3406373c661389cff8518bc.json",
"name": "monster_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/62df6f7db6168d608c3ba48e1ae4daf6.json",
"name": "monster_tex.json"
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3"
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/81a5997a815e141fc490b4f7ca4db55f.png",
"name": "monster_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/b75df34ef55bd1c6e3a799f1dac87fec.mp3"
}, {
"optionDragonBone": {
"skeJsonData": { "url": "" },
"texJsonData": { "url": "" },
"texPngData": { "url": "" }
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/91535f61a3406373c661389cff8518bc.json",
"name": "monster_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/62df6f7db6168d608c3ba48e1ae4daf6.json",
"name": "monster_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/81a5997a815e141fc490b4f7ca4db55f.png",
"name": "monster_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/b75df34ef55bd1c6e3a799f1dac87fec.mp3"
}]
}, {
"questionAudio": "http://staging-teach.cdn.ireadabc.com/90e313405ba454880e75ff6958ea05c0.mp3",
"questionTxt": "12as s df sdf",
"rightOptionIdx": 2,
"optionList": [{
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/a635f41fbf68fc3018ce410b0fcb5aaa.json",
"name": "fire1_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/79b4953474486ab31ac50235f432156b.json",
"name": "fire1_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/107c65ac1df1143b4be3785134315fed.png",
"name": "fire1_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/8ba49890c74b8c68b1da4556ac8c1dda.mp3"
}, {
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/23c8c8e640e580f5e9c61655037646d8.json",
"name": "smoke_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/e06181997beea3c9ba0e55405ae62303.json",
"name": "smoke_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/ea298bb8c6648f605f93d576735ff3cf.png",
"name": "smoke_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/8ba49890c74b8c68b1da4556ac8c1dda.mp3"
}, {
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/91535f61a3406373c661389cff8518bc.json",
"name": "monster_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/62df6f7db6168d608c3ba48e1ae4daf6.json",
"name": "monster_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/81a5997a815e141fc490b4f7ca4db55f.png",
"name": "monster_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/b75df34ef55bd1c6e3a799f1dac87fec.mp3"
}, {
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/91535f61a3406373c661389cff8518bc.json",
"name": "monster_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/62df6f7db6168d608c3ba48e1ae4daf6.json",
"name": "monster_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/81a5997a815e141fc490b4f7ca4db55f.png",
"name": "monster_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/b75df34ef55bd1c6e3a799f1dac87fec.mp3"
}]
}, {
"questionAudio": "http://staging-teach.cdn.ireadabc.com/90e313405ba454880e75ff6958ea05c0.mp3",
"questionTxt": "12as s df sdf",
"rightOptionIdx": 3,
"optionList": [{
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/a635f41fbf68fc3018ce410b0fcb5aaa.json",
"name": "fire1_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/79b4953474486ab31ac50235f432156b.json",
"name": "fire1_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/107c65ac1df1143b4be3785134315fed.png",
"name": "fire1_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/8ba49890c74b8c68b1da4556ac8c1dda.mp3"
}, {
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/23c8c8e640e580f5e9c61655037646d8.json",
"name": "smoke_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/e06181997beea3c9ba0e55405ae62303.json",
"name": "smoke_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/ea298bb8c6648f605f93d576735ff3cf.png",
"name": "smoke_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/8ba49890c74b8c68b1da4556ac8c1dda.mp3"
}, {
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/91535f61a3406373c661389cff8518bc.json",
"name": "monster_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/62df6f7db6168d608c3ba48e1ae4daf6.json",
"name": "monster_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/81a5997a815e141fc490b4f7ca4db55f.png",
"name": "monster_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/b75df34ef55bd1c6e3a799f1dac87fec.mp3"
}, {
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/91535f61a3406373c661389cff8518bc.json",
"name": "monster_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/62df6f7db6168d608c3ba48e1ae4daf6.json",
"name": "monster_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/81a5997a815e141fc490b4f7ca4db55f.png",
"name": "monster_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3"
"optionAudio": "http://staging-teach.cdn.ireadabc.com/b75df34ef55bd1c6e3a799f1dac87fec.mp3"
}]
}]
}
\ No newline at end of file
......@@ -239,8 +239,8 @@ export function addButtonListener(btnNode, func) {
}
btnNode.canNotClick = true;
playEffect('按钮');
await jelly(btnNode);
await func(btn);
await jelly(btnNode);
btnNode.canNotClick = false;
});
}
......@@ -333,3 +333,34 @@ export async function asyncLoadDragonBoneAnime(node, { skeJsonData: { url: skeJs
});
});
}
export function blinkNode(baseNode, activeNode, notActiveNode, delayTime = 0.2) {
cc.tween(baseNode)
.call(() => {
if (activeNode) {
activeNode.active = false;
}
if (notActiveNode) {
notActiveNode.active = true;
}
})
.delay(delayTime)
.call(() => {
if (activeNode) {
activeNode.active = true;
}
if (notActiveNode) {
notActiveNode.active = false;
}
})
.delay(delayTime)
.union()
.repeatForever()
.start();
}
export function stopBlinkNode(baseNode, activeNode, notActiveNode) {
baseNode.stopAllActions();
activeNode.active = true;
notActiveNode.active = false;
}
\ No newline at end of file
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