Commit 5579fc40 authored by jeff's avatar jeff

1.提交

parent 0952dbf6
<div class="p-image-children-editor">
<h5 style="margin-left: 2.5%;"> 预览: </h5>
<h5 style="margin-left: 2.5%;margin-top: 10px; "> 预览: </h5>
<div class="preview-box" #wrap>
<canvas id="canvas" #canvas></canvas>
......@@ -12,18 +12,15 @@
<h5> 添加背景: </h5>
<div class="bg-box">
<app-upload-image-with-preview
[picUrl]="bgItem?.url"
(imageUploaded)="onBackgroundUploadSuccess($event)">
<app-upload-image-with-preview [picUrl]="bgItem?.url" (imageUploaded)="onBackgroundUploadSuccess($event)">
</app-upload-image-with-preview>
</div>
</div>
<div nz-col nzSpan="5" nzOffset="1" class="img-box"
*ngFor="let it of hotZoneArr; let i = index">
<div nz-col nzSpan="5" nzOffset="1" class="img-box" *ngFor="let it of hotZoneArr; let i = index">
<div
style="margin: auto; padding: 5px; margin-top: 30px; width:90%; border: 2px dashed #ddd; border-radius: 10px">
style="margin: auto; padding: 5px;min-width: 220px; margin-top: 30px; width:90%; border: 2px dashed #ddd; border-radius: 10px">
<span style="margin-left: 40%;"> 区域{{i + 1}}
</span>
<button style="float: right;" nz-button nzType="danger" nzSize="small" (click)="deleteBtnClick(i)">
......@@ -34,14 +31,15 @@
<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 *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>
<!-- <div *ngIf="!customTypeGroupArr">
<nz-radio-group [ngModel]="it.itemType" (ngModelChange)="radioChange($event, it)" style="display: flex; align-items: center; justify-content: center">
......@@ -58,48 +56,49 @@
<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 [picUrl]="it?.pic_url" (imageUploaded)="onItemImgUploadSuccess($event, it)">
</app-upload-image-with-preview>
</div>
<div
style="margin-top: 5px; margin-bottom: 5px; display: inline-flex;justify-content: space-between;justify-items: center;">
<div>
手提示 <nz-switch [ngModel]="it.useHand" (ngModelChange)="onChangeSwitch(it,'useHand')" nzCheckedChildren="开" nzUnCheckedChildren="关"></nz-switch>
</div>
<div *ngIf="it.gIdx==0" style="margin-left: 10px;">
显示边框 <nz-switch [ngModel]='it.useBorder' (ngModelChange)="onChangeSwitch(it,'useBorder')" nzCheckedChildren="开" nzUnCheckedChildren="关"></nz-switch>
</div>
</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)" >
<button nz-button (click)="setAnimaBtnClick(i)">
<i nz-icon nzType="tool" nzTheme="outline"></i>
配置龙骨动画
</button>
</div>
<div *ngIf="customTypeGroupArr[it.gIdx].animaSmall" align="center" style="margin-top: 5px">
<button nz-button (click)="setAnimaSmallBtnClick(i)" >
<button nz-button (click)="setAnimaSmallBtnClick(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>
<app-audio-recorder style="margin: auto" [audioUrl]="it.audio_url"
(audioUploaded)="onItemAudioUploadSuccess($event, it)"></app-audio-recorder>
</div>
<div *ngIf="customTypeGroupArr[it.gIdx]?.action" style="display: flex;align-items: center; margin-top: 5px">
<app-custom-action
style="margin: auto"
[item]="it ? it['actionData_' + it.gIdx] : {}"
[type]="customTypeGroupArr[it.gIdx].action.type"
[option]="customTypeGroupArr[it.gIdx].action.option"
<app-custom-action style="margin: auto" [item]="it ? it['actionData_' + it.gIdx] : {}"
[type]="customTypeGroupArr[it.gIdx].action.type" [option]="customTypeGroupArr[it.gIdx].action.option"
(save)="onSaveCustomAction($event, it)">
></app-custom-action>
></app-custom-action>
</div>
</div>
......@@ -145,8 +144,7 @@
<div nz-col nzSpan="5" nzOffset="1">
<div class="bg-box">
<button nz-button nzType="dashed" (click)="addBtnClick()"
class="add-btn">
<button nz-button nzType="dashed" (click)="addBtnClick()" class="add-btn">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
<!--Add Image-->
添加点击区域
......@@ -161,22 +159,26 @@
<div class="save-box">
<button style="margin-left: 200px" class="save-btn" nz-button nzType="primary" [nzSize]="'large'" nzShape="round"
(click)="saveClick()" >
<button class="save-btn" nz-button nzType="primary" [nzSize]="'large'" nzShape="round" (click)="saveClick()">
<i nz-icon nzType="save"></i>
Save
保存
</button>
<button class="save-btn" nz-button nzType="danger" [nzSize]="'large'" nzShape="round" (click)="deleteClick()">
<i nz-icon nzType="save"></i>
删除
</button>
<div *ngIf="isCopyData" style="height: 40px; display: flex; justify-items: center;" >
<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" >
<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>
<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>
......@@ -189,20 +191,17 @@
</div>
<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="保存">
<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)">
<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>
......@@ -211,11 +210,8 @@
<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)">
<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>
......@@ -224,21 +220,17 @@
<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)">
<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">
<div class="anima-upload-btn"
*ngIf="customTypeGroupArr && customTypeGroupArr[curDragonBoneGIdx] && customTypeGroupArr[curDragonBoneGIdx].animaNames">
提示:需包含以下动画: {{customTypeGroupArr[curDragonBoneGIdx].animaNames.toString()}}
</div>
</nz-modal>
</nz-modal>
\ No newline at end of file
......@@ -67,6 +67,7 @@
display: flex;
align-items: center;
justify-content: center;
justify-items: center;
.save-btn {
width: 160px;
......@@ -78,6 +79,8 @@
display: flex;
align-items: center;
justify-content: center;
margin-left: 50px;
margin-right: 50px;
}
}
......
......@@ -66,6 +66,8 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
@Output()
save = new EventEmitter();
@Output()
del = new EventEmitter();
saveDisabled = true;
......@@ -268,7 +270,7 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
this.hotZoneArr[i].index = i;
if (this.hotZoneArr[i]) {
this.hotZoneArr[i].title = 'item-' + (i + 1);
this.hotZoneArr[i].title = '区域' + (i + 1);
}
}
......@@ -302,11 +304,12 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
item.y = this.canvasHeight / 2;
item.itemType = this.getDefaultItemType();
item.gIdx = this._dafaultIndex + ''
item.gIdx = 0
item['id'] = new Date().getTime().toString();
item['data'] = saveData;
item['useHand'] = true
item['useBorder'] =true
console.log('item.x: ', item.x);
if (saveData) {
......@@ -320,6 +323,7 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
item['id'] = saveData.id;
item['pic'] = saveData.pic_url
// item['skeJsonData'] = saveData.skeJsonData;
// item['texJsonData'] = saveData.texJsonData;
// item['texPngData'] = saveData.texPngData;
......@@ -438,10 +442,9 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
}
}
private _dafaultIndex: number = 1
getDefaultItemType() {
if (this.customTypeGroupArr) {
const group = this.customTypeGroupArr[this._dafaultIndex];
const group = this.customTypeGroupArr[0];
if (group.rect) {
return 'rect';
}
......@@ -1074,13 +1077,20 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
return false;
}
saveClick() {
const sendData = this.getSendData();
this.save.emit(sendData);
}
deleteClick() {
this.del.emit()
}
/** 改变内容 */
onChangeSwitch(data,name:string){
data[name] =!data[name]
}
getSendData() {
const bgItem = this.bgItem;
......@@ -1115,10 +1125,12 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
fontScale: hotZoneArr[i].textLabel ? hotZoneArr[i].textLabel.scaleX : 1,
imgScale: hotZoneArr[i].pic ? hotZoneArr[i].pic.scaleX : 1,
mapScale: this.mapScale,
skeJsonData: hotZoneArr[i].skeJsonData,
texJsonData: hotZoneArr[i].texJsonData,
texPngData: hotZoneArr[i].texPngData,
gIdx: hotZoneArr[i].gIdx
// skeJsonData: hotZoneArr[i].skeJsonData,
// texJsonData: hotZoneArr[i].texJsonData,
// texPngData: hotZoneArr[i].texPngData,
gIdx: hotZoneArr[i].gIdx,
useHand: hotZoneArr[i].useHand,
useBorder: hotZoneArr[i].useBorder
};
hotZoneItem['actionData_' + hotZoneItem.gIdx] = hotZoneArr[i]['actionData_' + hotZoneArr[i].gIdx]
......
<div class="model-content">
<div style="padding: 10px;">
<!--
<!--
<div style="width: 100%; margin-top: 15px; margin-bottom: 50px;" align="center">
......@@ -17,14 +17,19 @@
</div>
-->
<app-custom-hot-zone-mini
[bgItem]="item.bgItem"
[hotZoneItemArr]="item.hotZoneItemArr"
[customTypeGroupArr]="customTypeGroupArr"
(save)="saveHotZone(item, $event)"
>
<div *ngFor='let data of item ;index as i'>
<span> 卡片{{i+1}}</span>
<app-custom-hot-zone-mini [bgItem]="data.bgItem" [hotZoneItemArr]="data.hotZoneItemArr"
[customTypeGroupArr]="customTypeGroupArr" (save)="saveHotZone(data, $event)" (del)="delHotZone(i)">
</app-custom-hot-zone-mini>
</div>
<div style="margin-top: 20px; width: 100%; display: inline-flex; align-items: center;justify-content: center;">
<button class="save-btn" nz-button nzType="primary" [nzSize]="'large'" nzShape="round" (click)="addClick()">
<i nz-icon nzType="save"></i>
添加新卡片
</button>
</div>
</app-custom-hot-zone-mini>
<!-- <div style="width: 300px;" align='center'>
<span>图1: </span>
<app-upload-image-with-preview
......@@ -56,4 +61,4 @@
</div>
</div>
</div>
\ No newline at end of file
......@@ -15,13 +15,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
item;
customTypeGroupArr = [
{
name: '发音动画',
rect: true,
animaSmall: true,
audio: true,
},
{
name: '发音图片',
pic: true,
......@@ -32,38 +25,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
rect: true,
audio: true,
},
{
name: '变化文本',
action: {
type: 'text',
option: [
['fontColor', '#000000'],
['fontSize', '100'],
['opacity', '0', '100']
]
},
},
{
name: '变化图片',
action: {
type: 'pic',
option: [
// ['scale', '1'],
['opacity', '0', '100']
]
},
},
{
name: '变化动画',
action: {
type: 'anima',
option: [
// ['scale', '1'],
['opacity', '0', '100']
]
},
},
]
constructor(private appRef: ApplicationRef, private changeDetectorRef: ChangeDetectorRef) {
......@@ -87,12 +49,12 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
ngOnInit() {
this.item = {};
this.item = [];
// 获取存储的数据
(<any>window).courseware.getData((data) => {
if (data) {
if (data && data.length) {
this.item = data;
}
......@@ -115,51 +77,25 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
onSaveCustomAction(e) {
console.log('e:', e);
this.item.customAction = e;
this.save();
}
/** 保存按钮 */
saveHotZone(group, e) {
console.log('e: ', e);
const {bgItem, hotZoneItemArr} = e;
const { bgItem, hotZoneItemArr } = e;
group.bgItem = bgItem;
group.hotZoneItemArr = hotZoneItemArr;
this.save();
}
/**
* 储存图片数据
* @param e
*/
onImageUploadSuccess(e, key) {
this.item[key] = e.url;
this.save();
/** 删除按钮 */
delHotZone(index: number) {
this.item.splice(index, 1)
}
/**
* 储存音频数据
* @param e
*/
onAudioUploadSuccess(e, key) {
this.item[key] = e.url;
this.save();
}
onWordAudioUploadSuccess(e, idx) {
this.item.wordList[idx].audio = e.url;
this.save();
}
onBackWordAudioUploadSuccess(e, idx) {
this.item.wordList[idx].backWordAudio = e.url;
this.save();
/** 添加按钮 */
addClick() {
this.item.push({})
}
/**
......
......@@ -13,12 +13,12 @@
{
"frame": 0,
"value": 255,
"curve": "constant"
"curve": "cubicIn"
},
{
"frame": 0.25,
"value": 0,
"curve": "constant"
"curve": "cubicIn"
},
{
"frame": 0.5,
......
......@@ -21,7 +21,10 @@
"__id__": 2
},
{
"__id__": 5
"__id__": 7
},
{
"__id__": 11
},
{
"__id__": 14
......@@ -30,11 +33,11 @@
"_active": true,
"_components": [
{
"__id__": 18
"__id__": 24
}
],
"_prefab": {
"__id__": 19
"__id__": 25
},
"_opacity": 255,
"_color": {
......@@ -46,8 +49,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 351,
"height": 93
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -58,8 +61,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-472.957,
-125.868,
0,
0,
0,
0,
0,
......@@ -85,7 +88,7 @@
},
{
"__type__": "cc.Node",
"_name": "sprite",
"_name": "icon_tips",
"_objFlags": 0,
"_parent": {
"__id__": 1
......@@ -95,10 +98,16 @@
"_components": [
{
"__id__": 3
},
{
"__id__": 4
},
{
"__id__": 5
}
],
"_prefab": {
"__id__": 4
"__id__": 6
},
"_opacity": 255,
"_color": {
......@@ -110,8 +119,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 351,
"height": 93
"width": 46,
"height": 67
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -122,8 +131,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
206.355,
64.726,
0,
0,
0,
......@@ -163,7 +172,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "c260e7d3-9aa7-46ca-99f5-7ca5f31f7fef"
"__uuid__": "b41667f5-0e09-49f6-b7e8-19b88dc8ea8b"
},
"_type": 0,
"_sizeMode": 1,
......@@ -179,6 +188,52 @@
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_defaultClip": {
"__uuid__": "a13d6552-0ece-42e3-813a-2029ad0cab0c"
},
"_clips": [
{
"__uuid__": "a13d6552-0ece-42e3-813a-2029ad0cab0c"
}
],
"playOnLoad": false,
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 33,
"_left": 0,
"_right": -53.85499999999999,
"_top": -51.726,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
......@@ -187,32 +242,28 @@
"asset": {
"__uuid__": "2ce7d58d-b6fe-4ef7-a128-de76f672a803"
},
"fileId": "b9fWLpmVVF2qpZu9r009Ps",
"fileId": "3ffMrh7m1CyZDq4KfPs7IU",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "hand",
"_name": "bg_quan",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
"__id__": 8
},
{
"__id__": 9
}
],
"_active": true,
"_components": [
{
"__id__": 12
}
],
"_prefab": {
"__id__": 13
"__id__": 10
},
"_opacity": 255,
"_color": {
......@@ -224,8 +275,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 78,
"height": 78
"width": 391,
"height": 133
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -236,8 +287,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
154.958,
-68.338,
0,
0,
0,
0,
0,
......@@ -261,22 +312,92 @@
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "9b336882-962e-447b-9d2c-89aca2bf95b4"
},
"_type": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": -20,
"_right": -20,
"_top": -20,
"_bottom": -20,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 170,
"_originalHeight": 100,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "2ce7d58d-b6fe-4ef7-a128-de76f672a803"
},
"fileId": "5bDJee3rVFeaYgoeDYafmQ",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "icon_dian",
"_name": "sprite",
"_objFlags": 0,
"_parent": {
"__id__": 5
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 7
"__id__": 12
}
],
"_prefab": {
"__id__": 8
"__id__": 13
},
"_opacity": 255,
"_color": {
......@@ -288,8 +409,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 49,
"height": 49
"width": 351,
"height": 93
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -300,8 +421,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-22.199,
34,
0,
0,
0,
0,
0,
......@@ -330,7 +451,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
"__id__": 11
},
"_enabled": true,
"_materials": [
......@@ -341,7 +462,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "5daba96f-eff5-4bee-9ba9-d67c0134212a"
"__uuid__": "c260e7d3-9aa7-46ca-99f5-7ca5f31f7fef"
},
"_type": 0,
"_sizeMode": 1,
......@@ -365,25 +486,35 @@
"asset": {
"__uuid__": "2ce7d58d-b6fe-4ef7-a128-de76f672a803"
},
"fileId": "85Cu0e6IdO7rehoMCnMUPa",
"fileId": "b9fWLpmVVF2qpZu9r009Ps",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "icon_hand",
"_name": "hand",
"_objFlags": 0,
"_parent": {
"__id__": 5
"__id__": 1
},
"_children": [],
"_children": [
{
"__id__": 15
},
{
"__id__": 18
}
],
"_active": true,
"_components": [
{
"__id__": 10
"__id__": 21
},
{
"__id__": 22
}
],
"_prefab": {
"__id__": 11
"__id__": 23
},
"_opacity": 255,
"_color": {
......@@ -395,7 +526,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 69,
"width": 78,
"height": 78
},
"_anchorPoint": {
......@@ -407,8 +538,72 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
35.1,
-35,
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": ""
},
{
"__type__": "cc.Node",
"_name": "icon_dian",
"_objFlags": 0,
"_parent": {
"__id__": 14
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 16
}
],
"_prefab": {
"__id__": 17
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 49,
"height": 49
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-22.199,
34,
0,
0,
0,
......@@ -437,7 +632,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
"__id__": 15
},
"_enabled": true,
"_materials": [
......@@ -448,7 +643,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "562deefd-c9fd-42f0-97d7-d6f5893ef3f3"
"__uuid__": "5daba96f-eff5-4bee-9ba9-d67c0134212a"
},
"_type": 0,
"_sizeMode": 1,
......@@ -472,58 +667,25 @@
"asset": {
"__uuid__": "2ce7d58d-b6fe-4ef7-a128-de76f672a803"
},
"fileId": "b6EBayLo9DCrkpa2CYD+lG",
"sync": false
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"_defaultClip": {
"__uuid__": "110d5a6d-4d4e-4a04-bed2-4bb56c56d03d"
},
"_clips": [
{
"__uuid__": "110d5a6d-4d4e-4a04-bed2-4bb56c56d03d"
}
],
"playOnLoad": false,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "2ce7d58d-b6fe-4ef7-a128-de76f672a803"
},
"fileId": "9aI5le42RBv5GR0xkx1QW1",
"fileId": "85Cu0e6IdO7rehoMCnMUPa",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "icon_tips",
"_name": "icon_hand",
"_objFlags": 0,
"_parent": {
"__id__": 1
"__id__": 14
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 15
},
{
"__id__": 16
"__id__": 19
}
],
"_prefab": {
"__id__": 17
"__id__": 20
},
"_opacity": 255,
"_color": {
......@@ -535,8 +697,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 46,
"height": 67
"width": 69,
"height": 78
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -547,8 +709,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
197.886,
50.905,
0,
0,
0,
0,
0,
......@@ -577,7 +739,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
"__id__": 18
},
"_enabled": true,
"_materials": [
......@@ -588,7 +750,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "b41667f5-0e09-49f6-b7e8-19b88dc8ea8b"
"__uuid__": "562deefd-c9fd-42f0-97d7-d6f5893ef3f3"
},
"_type": 0,
"_sizeMode": 1,
......@@ -604,6 +766,17 @@
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "2ce7d58d-b6fe-4ef7-a128-de76f672a803"
},
"fileId": "b6EBayLo9DCrkpa2CYD+lG",
"sync": false
},
{
"__type__": "cc.Animation",
"_name": "",
......@@ -613,16 +786,43 @@
},
"_enabled": true,
"_defaultClip": {
"__uuid__": "a13d6552-0ece-42e3-813a-2029ad0cab0c"
"__uuid__": "110d5a6d-4d4e-4a04-bed2-4bb56c56d03d"
},
"_clips": [
{
"__uuid__": "a13d6552-0ece-42e3-813a-2029ad0cab0c"
"__uuid__": "110d5a6d-4d4e-4a04-bed2-4bb56c56d03d"
}
],
"playOnLoad": false,
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 18,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": -35,
"_horizontalCenter": 0.1,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": false,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
......@@ -631,7 +831,7 @@
"asset": {
"__uuid__": "2ce7d58d-b6fe-4ef7-a128-de76f672a803"
},
"fileId": "b5M1Vy7ipFF48OYApT5qKk",
"fileId": "9aI5le42RBv5GR0xkx1QW1",
"sync": false
},
{
......@@ -642,10 +842,16 @@
"__id__": 1
},
"_enabled": true,
"quan": {
"__id__": 7
},
"tipsAnim": {
"__id__": 16
"__id__": 4
},
"handAnim": {
"__id__": 21
},
"sprite": {
"__id__": 12
},
"_id": ""
......
const tools = require("../script/tools");
cc.Class({
extends: cc.Component,
properties: {
quan: cc.Node,
tipsAnim: cc.Animation,
handAnim: cc.Animation,
sprite: cc.Sprite
},
data: null,
onLoad() {
this.quan.active = false
this.tipsAnim.node.active = false
this.handAnim.node.active = false
},
onEnable() {
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this)
},
onDisable() {
this.node.off(cc.Node.EventType.TOUCH_START, this.onTouchStart, this)
},
initWithData(data, scale) {
console.log(scale)
this.data = data
let rect = this.data.rect
this.node.x = (rect.x + rect.width / 2) / scale
this.node.y = (-rect.y - rect.height / 2) / scale
this.node.width = rect.width / scale
this.node.height = rect.height / scale
console.log(this.node)
this.sprite.node.active = false
if (data.useHand) {
this.handAnim.node.active = true
this.handAnim.play()
}
let comps = this.getComponentsInChildren(cc.Widget)
for (let one of comps) {
one.updateAlignment()
}
this.audioId = null
},
onTouchStart() {
if (this.audioId) return
if (this.data) {
let url = this.data.audio_url
if (url && url != '') {
this.playAudio(url)
this.tipsAnim.node.active = true
this.tipsAnim.play()
}
if (this.data.pic_url) {
tools.getSpriteFrimeByUrl(this.data.pic_url, (sp) => {
this.sprite.spriteFrame = sp
this.sprite.node.width = this.node.width
this.sprite.node.height = this.node.height
this.sprite.node.active = true
})
}
if (this.data.useBorder) {
this.quan.active = true
}
this.handAnim.stop()
this.handAnim.node.active = false
}
},
/** 播放音乐 */
playAudio(url) {
cc.assetManager.loadRemote(url, (err, audioClip) => {
if (err) return
cc.systemEvent.once('stopMusic', this.stopAudio, this)
this.audioId = cc.audioEngine.play(audioClip, false, 0.8);
cc.audioEngine.setFinishCallback(this.audioId, this.stopAudio.bind(this));
});
},
stopAudio() {
if (this.audioId != null) {
cc.audioEngine.stop(this.audioId)
this.audioId = null
this.quan.active = false
this.tipsAnim.stop()
this.tipsAnim.node.active = false
this.sprite.node.active = false
if (this.data.useHand) {
this.handAnim.node.active = true
this.handAnim.play()
}
cc.systemEvent.off('stopMusic', this.stopAudio, this)
}
},
/** 音频id */
audioId: null,
});
{
"ver": "1.0.8",
"uuid": "57f79280-6f4b-4d53-b1e3-1cca543a4d9e",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
const tools = require("../script/tools");
cc.Class({
extends: cc.Component,
properties: {
tipsAnim: cc.Animation,
handAnim: cc.Animation,
hitPre: cc.Prefab,
borders: [cc.Node]
},
data: null,
onLoad() {
this.tipsAnim.node.active = false
this.handAnim.node.active = false
},
onEnable() {
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this)
},
onDisable() {
this.node.off(cc.Node.EventType.TOUCH_START, this.onTouchStart, this)
this._hitItem = []
this._items = this.node.getChildByName('items')
this._sprite = this.getComponentInChildren(cc.Sprite)
},
initWithData(data) {
this.data = data
let rect = this.data.rect
this.node.x = rect.x
this.node.y = rect.y
this.node.width = rect.width
this.node.height = rect.height
if (this.data.useHand) {
this.handAnim.node.active = false
this.handAnim.play()
}
},
this.clearItems()
tools.getSpriteFrimeByUrl(data.bgItem.url, (sp) => {
let rect = sp.getRect()
let scale = rect.width / rect.height
let originRect = cc.size(1280, 720)
let originScale = originRect.width / originRect.height
if (scale < originScale) {
scale = rect.height / originRect.height
let width = rect.width / scale
this.node.width = width
this.node.height = originRect.height
onTouchStart() {
if (this.data) {
let url = this.data.audio_url
if (url && url != '') {
this.playAudio(url)
} else if (scale > originScale) {
scale = rect.width / originRect.width
this.node.height = rect.height / scale
this.node.width = originRect.width
} else {
scale = rect.width / originRect.width
this.node.width = originRect.width
this.node.height = originRect.height
}
}
},
/** 播放音乐 */
playAudio(url) {
cc.assetManager.loadRemote(url, (err, audioClip) => {
if (err) return
this.audioId = cc.audioEngine.play(audioClip, false, 0.8);
cc.audioEngine.setFinishCallback(this.audioId, () => {
this.audioId = null
});
});
this.borders[0].x = -this.node.width / 2
this.borders[1].x = this.node.width / 2
this._sprite.spriteFrame = sp
this._sprite.node.width = this.node.width
this._sprite.node.height = this.node.height
this._items.width = this.node.width
this._items.height = this.node.height
this._items.x = -this.node.width / 2
this._items.y = this.node.height / 2
scale = data.bgItem.rect.width / this.node.width
//初始化点击区域
let node, comp
for (let data of data.hotZoneItemArr) {
node = cc.instantiate(this.hitPre)
this._items.addChild(node)
comp = node.getComponent('hitItem')
comp.initWithData(data, scale)
this._hitItem.push(node)
}
})
},
stopAudio() {
if (this.audioId != null) {
cc.audioEngine.stop(this.audioId)
this.audioId = null
}
},
/** 音频id */
audioId: null,
/** 清除item */
clearItems() {
this._items.removeAllChildren(true)
this._hitItem.length = 0
}
});
{
"ver": "1.0.8",
"uuid": "57f79280-6f4b-4d53-b1e3-1cca543a4d9e",
"uuid": "fccd4db5-30ec-4b66-aea2-c29fd0c0301f",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
......@@ -78,22 +78,22 @@
"__id__": 8
},
{
"__id__": 21
"__id__": 18
},
{
"__id__": 37
"__id__": 28
}
],
"_active": true,
"_components": [
{
"__id__": 41
"__id__": 40
},
{
"__id__": 42
"__id__": 41
},
{
"__id__": 43
"__id__": 42
}
],
"_prefab": null,
......@@ -368,7 +368,7 @@
},
{
"__type__": "cc.Node",
"_name": "bottomPart",
"_name": "pic",
"_objFlags": 0,
"_parent": {
"__id__": 2
......@@ -378,7 +378,10 @@
"__id__": 9
},
{
"__id__": 11
"__id__": 12
},
{
"__id__": 13
},
{
"__id__": 15
......@@ -387,10 +390,7 @@
"_active": true,
"_components": [
{
"__id__": 19
},
{
"__id__": 20
"__id__": 17
}
],
"_prefab": null,
......@@ -404,8 +404,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 351,
"height": 91
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -416,8 +416,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
464.5,
-314.5,
0,
0,
0,
0,
0,
......@@ -425,7 +425,7 @@
1,
1,
1,
1
0
]
},
"_eulerAngles": {
......@@ -439,11 +439,11 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "8c7k8ep/ZFNpO263+1QHz9"
"_id": "acFf5706VEr43k/0GoDH2k"
},
{
"__type__": "cc.Node",
"_name": "bg_bottom",
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 8
......@@ -453,6 +453,9 @@
"_components": [
{
"__id__": 10
},
{
"__id__": 11
}
],
"_prefab": null,
......@@ -466,8 +469,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 351,
"height": 93
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -501,7 +504,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "70X2WruCtItoUrT7FmCz3I"
"_id": "e5gAWSYXpPDJKuNiEvXpPT"
},
{
"__type__": "cc.Sprite",
......@@ -516,13 +519,11 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "c260e7d3-9aa7-46ca-99f5-7ca5f31f7fef"
},
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
......@@ -533,25 +534,45 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "c7OVcCQjtDmrknFQVhXiA3"
"_id": "0eTbXG/oZHmaY6kD6zm9pf"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
},
"_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": 636,
"_originalHeight": 396,
"_id": "4dr1MJnPlIVJruDphUKxu4"
},
{
"__type__": "cc.Node",
"_name": "btn_left",
"_name": "items",
"_objFlags": 0,
"_parent": {
"__id__": 8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 12
},
{
"__id__": 14
}
],
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -563,20 +584,20 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 64,
"height": 68
"width": 720,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
"x": 0,
"y": 1
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-16.572,
3.038,
-360,
360,
0,
0,
0,
......@@ -584,7 +605,7 @@
1,
1,
1,
0
1
]
},
"_eulerAngles": {
......@@ -598,96 +619,76 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "5ad2wLQLxIN5Eg7OHecSH6"
"_id": "3a4oi+4+9Ka6PX0pprclAn"
},
{
"__type__": "cc.Button",
"_name": "",
"__type__": "cc.Node",
"_name": "bg_move",
"_objFlags": 0,
"node": {
"__id__": 11
"_parent": {
"__id__": 8
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.1,
"clickEvents": [
"_children": [],
"_active": true,
"_components": [
{
"__id__": 13
"__id__": 14
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 3,
"transition": 3,
"_N$normalColor": {
"_prefab": null,
"_opacity": 255,
"_color": {
"__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
"_contentSize": {
"__type__": "cc.Size",
"width": 14,
"height": 720
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 1,
"y": 0.5
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-626,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "bcYN/4EKBJhbIAfovo9Ah1"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"component": "",
"_componentId": "f4edeRi+NdAabqAkVYRwFjK",
"handler": "onClickLeft",
"customEventData": ""
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "b1AJm2yKhN/acMtHJgQehF"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
"__id__": 13
},
"_enabled": true,
"_materials": [
......@@ -698,7 +699,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "481337f5-a635-4237-8a67-7a37fd59f119"
"__uuid__": "65989243-03ad-4572-894a-c1d4712ce82c"
},
"_type": 0,
"_sizeMode": 1,
......@@ -712,11 +713,11 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "93zcHsRZhA7783yB/mBlqo"
"_id": "5fTjKmnRVNWbSuQoPv3XkW"
},
{
"__type__": "cc.Node",
"_name": "btn_right",
"_name": "bg_move",
"_objFlags": 0,
"_parent": {
"__id__": 8
......@@ -726,9 +727,6 @@
"_components": [
{
"__id__": 16
},
{
"__id__": 18
}
],
"_prefab": null,
......@@ -742,20 +740,20 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 64,
"height": 68
"width": 14,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"x": 0,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
97.71,
3.038,
626,
0,
0,
0,
0,
......@@ -763,7 +761,7 @@
1,
1,
1,
0
1
]
},
"_eulerAngles": {
......@@ -777,107 +775,25 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "46i3stdzpHX6zQHTGnRsNE"
"_id": "b7MYFimtJFk7j7n2He4McM"
},
{
"__type__": "cc.Button",
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.1,
"clickEvents": [
"_materials": [
{
"__id__": 17
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 3,
"transition": 3,
"_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": "1aj32fYY1IxLesa77E70Qu"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "f4edeRi+NdAabqAkVYRwFjK",
"handler": "onClickRight",
"customEventData": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "7546a333-1d8b-4c3a-a699-b24633d987d3"
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "65989243-03ad-4572-894a-c1d4712ce82c"
},
"_type": 0,
"_sizeMode": 1,
......@@ -891,76 +807,56 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "d4dDRX1SZIy517c6gzyxSO"
"_id": "f3HU4Zr+JKrYkZypEh60Di"
},
{
"__type__": "cc.Widget",
"__type__": "fccd421MOxLZq6iwp/QwDAf",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 36,
"_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": "14yYhIw95BeZx56bjhZzfB"
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
"hitPre": {
"__uuid__": "2ce7d58d-b6fe-4ef7-a128-de76f672a803"
},
"_enabled": true,
"_defaultClip": null,
"_clips": [
null
"borders": [
{
"__id__": 13
},
{
"__id__": 15
}
],
"playOnLoad": false,
"_id": "35I3F/iNRHf7w06yWJoxEu"
"_id": "25htXxEOZC+47ROkvoLV/U"
},
{
"__type__": "cc.Node",
"_name": "pic",
"_name": "pic_temp",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 22
},
{
"__id__": 25
"__id__": 19
},
{
"__id__": 28
"__id__": 22
},
{
"__id__": 31
"__id__": 23
},
{
"__id__": 34
"__id__": 25
}
],
"_active": true,
"_components": [],
"_components": [
{
"__id__": 27
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -984,7 +880,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-1280,
0,
0,
0,
......@@ -1007,23 +903,23 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "acFf5706VEr43k/0GoDH2k"
"_id": "f5uVe6L1lNmYEspgnFI0dX"
},
{
"__type__": "cc.Node",
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 21
"__id__": 18
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
"__id__": 20
},
{
"__id__": 24
"__id__": 21
}
],
"_prefab": null,
......@@ -1037,8 +933,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
"width": 1266,
"height": 706
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1058,7 +954,7 @@
1,
1,
1,
1
0
]
},
"_eulerAngles": {
......@@ -1072,14 +968,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e5gAWSYXpPDJKuNiEvXpPT"
"_id": "e759xQxcRBDZCN5l4fsqO0"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
"__id__": 19
},
"_enabled": true,
"_materials": [
......@@ -1102,23 +998,23 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "0eTbXG/oZHmaY6kD6zm9pf"
"_id": "0eSa63fVNKKLV/1Jn+eg8n"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
"__id__": 19
},
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_left": 7,
"_right": 7,
"_top": 7,
"_bottom": 7,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
......@@ -1127,25 +1023,80 @@
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 636,
"_originalHeight": 396,
"_id": "4dr1MJnPlIVJruDphUKxu4"
"_originalWidth": 650,
"_originalHeight": 410,
"_id": "fbCrzYGGRFTKesyrZuyvHE"
},
{
"__type__": "cc.Node",
"_name": "items",
"_objFlags": 0,
"_parent": {
"__id__": 18
},
"_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": [
1274,
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": "60JG0g75NIdb8hWvDUsLMj"
},
{
"__type__": "cc.Node",
"_name": "bg_move",
"_objFlags": 0,
"_parent": {
"__id__": 21
"__id__": 18
},
"_children": [],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 26
},
{
"__id__": 27
"__id__": 24
}
],
"_prefab": null,
......@@ -1164,14 +1115,14 @@
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"x": 1,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-633,
-626,
0,
0,
0,
......@@ -1194,14 +1145,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "b1AJm2yKhN/acMtHJgQehF"
"_id": "19E+V10BFOSZf5OhlQKDMs"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
"__id__": 23
},
"_enabled": true,
"_materials": [
......@@ -1226,50 +1177,20 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "5fTjKmnRVNWbSuQoPv3XkW"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 8,
"_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": "a8Ih7yZaRBdZUYRQo7VeiV"
"_id": "f3RicpoHxHIqhCyvoq5hrx"
},
{
"__type__": "cc.Node",
"_name": "bg_move",
"_objFlags": 0,
"_parent": {
"__id__": 21
"__id__": 18
},
"_children": [],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 29
},
{
"__id__": 30
"__id__": 26
}
],
"_prefab": null,
......@@ -1288,14 +1209,14 @@
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"x": 0,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
633,
626,
0,
0,
0,
......@@ -1318,14 +1239,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "b7MYFimtJFk7j7n2He4McM"
"_id": "04/r+P/w9Ebakr7iCQgWBs"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 28
"__id__": 25
},
"_enabled": true,
"_materials": [
......@@ -1350,50 +1271,51 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "f3HU4Zr+JKrYkZypEh60Di"
"_id": "65yTQDAFRIS7EPA699rdi4"
},
{
"__type__": "cc.Widget",
"__type__": "fccd421MOxLZq6iwp/QwDAf",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 28
"__id__": 18
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 32,
"_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": "64EsoeEF5BsYPgaBKs5n9+"
"hitPre": {
"__uuid__": "2ce7d58d-b6fe-4ef7-a128-de76f672a803"
},
"borders": [
{
"__id__": 23
},
{
"__id__": 25
}
],
"_id": "89aCQ7yHtOn4s8onn5MbAu"
},
{
"__type__": "cc.Node",
"_name": "bg_move",
"_name": "bottomPart",
"_objFlags": 0,
"_parent": {
"__id__": 21
"__id__": 2
},
"_children": [],
"_active": false,
"_components": [
"_children": [
{
"__id__": 32
"__id__": 29
},
{
"__id__": 33
"__id__": 31
},
{
"__id__": 35
}
],
"_active": true,
"_components": [
{
"__id__": 39
}
],
"_prefab": null,
......@@ -1407,8 +1329,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 14,
"height": 1280
"width": 351,
"height": 91
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1419,13 +1341,13 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
464.5,
-314.5,
0,
368.418,
0,
0,
0,
0.7071067811865475,
0.7071067811865476,
1,
1,
1,
1
......@@ -1435,48 +1357,83 @@
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 90
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "dc73Fb5SlD7J/vFGJ1/xcP"
"_id": "8c7k8ep/ZFNpO263+1QHz9"
},
{
"__type__": "cc.Widget",
"_name": "",
"__type__": "cc.Node",
"_name": "bg_bottom",
"_objFlags": 0,
"node": {
"__id__": 31
"_parent": {
"__id__": 28
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 41,
"_left": 633,
"_right": 633,
"_top": -648.418,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 14,
"_originalHeight": 0,
"_id": "60dJ16FZlGEYegzpqEv8gI"
"_children": [],
"_active": true,
"_components": [
{
"__id__": 30
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 351,
"height": 93
},
"_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": "70X2WruCtItoUrT7FmCz3I"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 31
"__id__": 29
},
"_enabled": true,
"_materials": [
......@@ -1487,10 +1444,10 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "65989243-03ad-4572-894a-c1d4712ce82c"
"__uuid__": "c260e7d3-9aa7-46ca-99f5-7ca5f31f7fef"
},
"_type": 2,
"_sizeMode": 0,
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
......@@ -1501,23 +1458,23 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "fdbhfWO25KXaUT3pi6g/DW"
"_id": "c7OVcCQjtDmrknFQVhXiA3"
},
{
"__type__": "cc.Node",
"_name": "bg_move",
"_name": "btn_left",
"_objFlags": 0,
"_parent": {
"__id__": 21
"__id__": 28
},
"_children": [],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 35
"__id__": 32
},
{
"__id__": 36
"__id__": 34
}
],
"_prefab": null,
......@@ -1531,8 +1488,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 14,
"height": 1280
"width": 64,
"height": 68
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1543,64 +1500,119 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-16.572,
3.038,
0,
-369.556,
0,
0,
0,
0.7071067811865475,
0.7071067811865476,
1,
1,
1
1,
0
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 90
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "90trfmqXlIi62ExYNzN4I5"
"_id": "5ad2wLQLxIN5Eg7OHecSH6"
},
{
"__type__": "cc.Widget",
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 34
"__id__": 31
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 41,
"_left": 633,
"_right": 633,
"_top": 89.55599999999998,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 14,
"_originalHeight": 0,
"_id": "5cVY3BafxL3pwuCJufNQJg"
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.1,
"clickEvents": [
{
"__id__": 33
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 3,
"transition": 3,
"_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": "bcYN/4EKBJhbIAfovo9Ah1"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "c238bwNxXtAHqIXQECY4nQz",
"handler": "onClickLeft",
"customEventData": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 34
"__id__": 31
},
"_enabled": true,
"_materials": [
......@@ -1611,10 +1623,10 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "65989243-03ad-4572-894a-c1d4712ce82c"
"__uuid__": "481337f5-a635-4237-8a67-7a37fd59f119"
},
"_type": 2,
"_sizeMode": 0,
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
......@@ -1625,22 +1637,25 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "4c/3rfzz1AkLG+k9qBfc0h"
"_id": "93zcHsRZhA7783yB/mBlqo"
},
{
"__type__": "cc.Node",
"_name": "pic_temp",
"_name": "btn_right",
"_objFlags": 0,
"_parent": {
"__id__": 2
"__id__": 28
},
"_children": [
"_children": [],
"_active": true,
"_components": [
{
"__id__": 36
},
{
"__id__": 38
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -1652,8 +1667,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 650,
"height": 410
"width": 64,
"height": 68
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1664,8 +1679,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-1274,
0,
97.71,
3.038,
0,
0,
0,
......@@ -1687,79 +1702,96 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "f5uVe6L1lNmYEspgnFI0dX"
"_id": "46i3stdzpHX6zQHTGnRsNE"
},
{
"__type__": "cc.Node",
"_name": "icon",
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"_parent": {
"__id__": 37
"node": {
"__id__": 35
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 39
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.1,
"clickEvents": [
{
"__id__": 40
"__id__": 37
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 3,
"transition": 3,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 636,
"height": 396
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
0
]
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e759xQxcRBDZCN5l4fsqO0"
"_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": "1aj32fYY1IxLesa77E70Qu"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "c238bwNxXtAHqIXQECY4nQz",
"handler": "onClickRight",
"customEventData": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 38
"__id__": 35
},
"_enabled": true,
"_materials": [
......@@ -1767,11 +1799,13 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 1,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_spriteFrame": {
"__uuid__": "7546a333-1d8b-4c3a-a699-b24633d987d3"
},
"_type": 0,
"_sizeMode": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
......@@ -1782,23 +1816,23 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "0eSa63fVNKKLV/1Jn+eg8n"
"_id": "d4dDRX1SZIy517c6gzyxSO"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 38
"__id__": 28
},
"_enabled": true,
"alignMode": 2,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 7,
"_right": 7,
"_top": 7,
"_bottom": 7,
"_alignFlags": 36,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
......@@ -1807,9 +1841,9 @@
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 650,
"_originalHeight": 410,
"_id": "fbCrzYGGRFTKesyrZuyvHE"
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "14yYhIw95BeZx56bjhZzfB"
},
{
"__type__": "cc.Canvas",
......@@ -1864,16 +1898,16 @@
},
"_enabled": true,
"picNode": {
"__id__": 21
"__id__": 8
},
"picTempNode": {
"__id__": 37
"__id__": 18
},
"leftNode": {
"__id__": 11
"__id__": 31
},
"rightNode": {
"__id__": 15
"__id__": 35
},
"btnClip": {
"__uuid__": "39ef1939-3bf9-4d21-a67a-bc1dede521a9"
......
import { tools } from "./tools";
const tools = require("./tools");
cc.Class({
extends: cc.Component,
......@@ -64,7 +65,6 @@ cc.Class({
sy = frameSize.height / this._designSize.height;
this._mapScaleMin = Math.min(sx, sy) * this._cocosScale;
this._mapScaleMax = Math.max(sx, sy) * this._cocosScale;
this.originRect = cc.size(1280, 720)
},
......@@ -88,36 +88,20 @@ cc.Class({
},
onEnable() {
this.rightNode.on(cc.Node.EventType.MOUSE_DOWN, this.changeIcon.bind(this, this.rightNode, true))
this.rightNode.on(cc.Node.EventType.MOUSE_UP, this.changeIcon.bind(this, this.rightNode, false))
this.rightNode.on(cc.Node.EventType.MOUSE_LEAVE, this.changeIcon.bind(this, this.rightNode, false))
this.leftNode.on(cc.Node.EventType.MOUSE_DOWN, this.changeIcon.bind(this, this.leftNode, true))
this.leftNode.on(cc.Node.EventType.MOUSE_UP, this.changeIcon.bind(this, this.leftNode, false))
this.leftNode.on(cc.Node.EventType.MOUSE_UP, this.changeIcon.bind(this, this.leftNode, false))
cc.systemEvent.on('playAudio', this.onPlayAudio, this)
},
onDisable() {
this.rightNode.off(cc.Node.EventType.MOUSE_DOWN)
this.rightNode.off(cc.Node.EventType.MOUSE_UP)
this.rightNode.off(cc.Node.EventType.MOUSE_LEAVE)
this.leftNode.off(cc.Node.EventType.MOUSE_DOWN)
this.leftNode.off(cc.Node.EventType.MOUSE_UP)
this.leftNode.off(cc.Node.EventType.MOUSE_LEAVE)
cc.systemEvent.off('playAudio', this.onPlayAudio, this)
},
changeIcon(node, bl) {
node.children[0].active = !bl
node.children[1].active = bl
},
getData(cb) {
cb(this.getDefaultData());
},
getDefaultData() {
const dataJson = '[{"bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/807e9f0c160545ec14d5094f258e0c75.png","rect":{"x":249,"y":0,"width":299,"height":299}},"hotZoneItemArr":[{"id":"1620701172440","index":0,"pic_url":"http://staging-teach.cdn.ireadabc.com/d8edc8d8113269b4c97b75a55a5c926c.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/bd0502e664d0d279ccbec4e22b60f051.mp3","itemType":"pic","fontScale":0.62265625,"imgScale":0.4671875,"mapScale":0.62265625,"gIdx":"1","rect":{"x":29.9,"y":29.9,"width":239.2,"height":239.2}}]},{"bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/807e9f0c160545ec14d5094f258e0c75.png","rect":{"x":249,"y":0,"width":299,"height":299}},"hotZoneItemArr":[{"id":"1620701172440","index":0,"pic_url":"http://staging-teach.cdn.ireadabc.com/d8edc8d8113269b4c97b75a55a5c926c.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/bd0502e664d0d279ccbec4e22b60f051.mp3","itemType":"pic","fontScale":0.62265625,"imgScale":0.4671875,"mapScale":0.62265625,"gIdx":"1","rect":{"x":29.9,"y":29.9,"width":239.2,"height":239.2}}]}]'
const dataJson = '[{"bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/1a7513da33595f343fa73efa3be153d6.png","rect":{"x":231,"y":0,"width":287,"height":287}},"hotZoneItemArr":[{"id":"1620741734006","index":0,"pic_url":"http://staging-teach.cdn.ireadabc.com/e74a1c89473132b6ce53633fc53a6aee.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/c8a7dd49a778b0b6dd509aac0ef437ff.mp3","itemType":"pic","fontScale":0.58515625,"imgScale":0.12725,"mapScale":0.58515625,"gIdx":"1","rect":{"x":113.87,"y":112.33,"width":64.9,"height":86.02}}]},{"bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/1a7513da33595f343fa73efa3be153d6.png","rect":{"x":231,"y":0,"width":287,"height":287}},"hotZoneItemArr":[{"id":"1620741734006","index":0,"pic_url":"http://staging-teach.cdn.ireadabc.com/e74a1c89473132b6ce53633fc53a6aee.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/c8a7dd49a778b0b6dd509aac0ef437ff.mp3","itemType":"pic","fontScale":0.58515625,"imgScale":0.12725,"mapScale":0.58515625,"gIdx":"1","rect":{"x":113.87,"y":112.33,"width":64.9,"height":86.02}}]}]'
const data = JSON.parse(dataJson);
return data;
},
......@@ -199,8 +183,6 @@ cc.Class({
if (this.curPage == 1) {
this.leftNode.active = true
this.leftNode.children[0].active = true
this.leftNode.children[1].active = false
this.leftNode.scale = 1
}
......@@ -224,8 +206,6 @@ cc.Class({
if (this.curPage == this.data.length - 2) {
this.rightNode.active = true
this.rightNode.children[0].active = true
this.rightNode.children[1].active = false
this.rightNode.scale = 1
}
this.rightMove()
......@@ -280,38 +260,18 @@ cc.Class({
})
.start();
},
// update (dt) {},
stopAudio(){
cc.systemEvent.emit('stopMusic')
},
// ------------------------------------------------
/**普通大小 */
originRect: null,
/**设置显示区域内容 */
setContent(picNode, data) {
if (!data) {
console.log('数据错误')
return
}
picNode
let sprite = picNode.getComponentInChildren(cc.Sprite)
tools.getSpriteFrimeByUrl(data.bgItem.url, (sp) => {
sprite.spriteFrame = sp
let rect = sp.getRect()
let scale = rect.width / rect.height
let originScale = this.originRect.width / this.originRect.height
if (scale < originScale) {
let width = rect.width / (rect.height / this.originRect.height)
picNode.width = width
picNode.height = this.originRect.height
} else if (scale > originScale) {
picNode.height = rect.height / (rect.width / this.originRect.width)
picNode.width = this.originRect.width
} else {
picNode.width = this.originRect.width
picNode.height = this.originRect.height
}
console.log(picNode)
})
picNode.getComponent('picNode').initWithData(data)
}
// ------------------------------------------
......
......@@ -23,19 +23,18 @@ export default class NewClass extends cc.Component {
start() {
cc.color()
this.node.off(cc.Node.EventType.MOUSE_DOWN)
cc.systemEvent.emit('stopMusic')
}
// update (dt) {}
onEnable() {
let one = new cc.Animation()
one.currentClip.speed
one.play().wrapMode
one.defaultClip.wrapMode = cc.WrapMode.Reverse
cc.Node.EventType.MOUSE_LEAVE
cc.tween(this.node).to(1,{opacity:1}).to
cc.assetManager.loadRemote
this.node.
this.node.removeAllChildren()
// let one = new cc.Node()
// one.removeFromParent()
// this.node
// cc.audioEngine.setFinishCallback()
}
......
export const tools = {
const tools = {
getSpriteFrimeByUrl(url, cb) {
cc.loader.load({ url }, (err, img) => {
const spriteFrame = new cc.SpriteFrame(img)
......@@ -7,4 +7,6 @@ export const tools = {
}
})
}
}
\ No newline at end of file
}
module.exports = tools
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "82ae3bc3-8bdf-463b-97d1-60ebd190bad2",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 170,
"height": 100,
"platformSettings": {},
"subMetas": {
"bg_quan": {
"ver": "1.0.4",
"uuid": "9b336882-962e-447b-9d2c-89aca2bf95b4",
"rawTextureUuid": "82ae3bc3-8bdf-463b-97d1-60ebd190bad2",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 170,
"height": 100,
"rawWidth": 170,
"rawHeight": 100,
"borderTop": 31,
"borderBottom": 31,
"borderLeft": 31,
"borderRight": 31,
"subMetas": {}
}
}
}
\ 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