Commit a0f14d76 authored by 李维's avatar 李维

Dev commit

parent fa703d42
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
"rxjs": "~6.5.4", "rxjs": "~6.5.4",
"spark-md5": "^3.0.0", "spark-md5": "^3.0.0",
"tslib": "^1.10.0", "tslib": "^1.10.0",
"zone.js": "~0.10.2" "zone.js": "~0.10.2",
"node-sass": "^4.0.0"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~0.900.3", "@angular-devkit/build-angular": "~0.900.3",
......
@import '../style/common_mixin.css';
.model-content {
width: 100%;
height: 100%;
}
.radioPaire {
float: left;
margin: 3px;
border-style: dashed;
border-color: #000;
border-width: 1px;
}
.border {
border-radius: 20px;
border-style: dashed;
padding: 20px;
margin: 20px;
/*width: 500px; */
/*//border-radius: 20px;*/
/*//border-width: 2px;*/
/*//border-color: #000000;*/
}
.border-lite {
border: 2px dashed #ddd;
border-radius: 0.5rem;
padding: 10px;
margin: 10px;
}
<div class="model-content"> <div class="model-content">
<div class="card-config">
<div style="padding: 10px;"> <div class="card-item clearfix" style="padding: 0.5vw; width: 100%;" >
<div class="card-item-content border" >
<div style="width: 300px;" align='center'> <div class="card-item-content">
<span>图1: </span> <div class="title" >
<app-upload-image-with-preview 题目素材
[picUrl]="item.pic_url" </div>
(imageUploaded)="onImageUploadSuccess($event, 'pic_url')"> <div class="section" >
</app-upload-image-with-preview> <div class="section-content">
</div> <div style="margin-bottom: 10px;">
<nz-form-item >
<div style="width: 300px; margin-top: 5px;" align='center'> <nz-form-label [nzSpan]="2" nzFor="email">背景音乐</nz-form-label>
<span>图2: </span> <nz-form-control [nzSpan]="4">
<app-upload-image-with-preview <app-audio-recorder [audioUrl]="contentObj.bgMusic" (audioUploaded)="onAudioUploadSuccessByItem($event, contentObj, 'bgMusic')" ></app-audio-recorder>
[picUrl]="item.pic_url_2" </nz-form-control>
(imageUploaded)="onImageUploadSuccess($event, 'pic_url_2')"> <nz-form-label [nzSpan]="2" nzFor="email">题意音频</nz-form-label>
</app-upload-image-with-preview> <nz-form-control [nzSpan]="4">
<app-audio-recorder [audioUrl]="contentObj.questionAudio_url" (audioUploaded)="onAudioUploadSuccessByItem($event, contentObj, 'questionAudio_url')" ></app-audio-recorder>
</nz-form-control>
<nz-form-label [nzSpan]="2" nzFor="email">标题</nz-form-label>
<nz-form-control [nzSpan]="4">
<input type="text" nz-input placeholder="请输入标题" [(ngModel)]="contentObj.titleText" (blur)="saveItem()" style="width: 250px;" />
</nz-form-control>
</nz-form-item >
</div>
</div>
</div>
</div>
</div>
</div> </div>
<div style="width: 300px; margin-top: 15px;">
<span>文本: </span>
<input type="text" nz-input [(ngModel)]="item.text" (blur)="save()">
</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 *ngFor="let item of contentObj.dataArray; let i = index" class="card-item" style="padding: 0.5vw; " >
<div class="card-item-content border">
<div class="card-item-content">
<div class="title" >
第-<strong>{{ i + 1 }}</strong>-题
</div>
<div class="section" >
<div class="section-content">
<div style="display: flex; margin-bottom: 10px;">
<div style="flex:1">
图片
</div>
<div style="flex:5">
<app-upload-image-with-preview style="width: 100%;" [picUrl]="item.image_url" (imageUploaded)="onImageUploadSuccessByItem($event, item, 'image_url')"></app-upload-image-with-preview>
</div>
</div>
<div style="display: flex; ">
<div style="flex:1">
音频
</div>
<div style="flex:5">
<app-audio-recorder [audioUrl]="item.audio_url" (audioUploaded)="onAudioUploadSuccessByItem($event, item, 'audio_url')" ></app-audio-recorder>
</div>
</div>
</div>
</div>
<div class="section" >
<div style="text-align: right; padding-right: 20px;">
<button style="margin-bottom: 10px;" nz-button nzType="danger" (click)="deleteItem(contentObj.dataArray, i)" >
<span>删除本题</span>
</button>
</div>
</div>
</div>
</div>
</div>
<div class="card-item" style="padding: 0.5vw;" >
<button nz-button nzType="primary" class="add-btn" (click)="addItem(contentObj.dataArray)">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
新建卡片组
</button>
</div>
</div>
</div> </div>
@import "../style/common_mixin";
.model-content {
margin: 10px;
.card-config {
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
.card-item{
width: 500px;
margin-bottom: 40px;
.border {
border-radius: 20px;
border-style: dashed;
padding:20px;
width: 100%;
}
.card-item-content{
.title {
font-size: 24px;
width: 100%;
text-align: center;
}
.section{
border-top: 1px dashed ;
padding: 10px 0;
.section-title{
font-size: 24px;
width: 100%;
}
.section-content{
display: flex;
flex-direction: column;
margin: 5px 0 10px 0;
}
}
.pic-sound-box {
width: 50%;
display: flex;
flex-direction: column;
}
.add-btn-box {
display: flex;
align-items: center;
justify-content: center;
height: 20vw;
padding: 10px;
padding-top: 5vw;
}
}
}
}
}
.clearfix:before,.clearfix:after {
content: "";
display: block;
clear: both;
}
\ No newline at end of file
import { Component, EventEmitter, Input, OnDestroy, OnChanges, OnInit, Output, ApplicationRef, ChangeDetectorRef } from '@angular/core'; import {Component, EventEmitter, Input, OnDestroy, OnChanges, OnInit, Output, ApplicationRef, ChangeDetectorRef} from '@angular/core';
import { JsonPipe } from '@angular/common'; // import { defauleFormData } from '../../assets/default/formData/defaultData_LST01'
const defauleFormData = {
"version": "1.0",
key: "DataKey_Sbox_FT_08",
bgMusic: "",
titleText: "",
dataArray: []
}
@Component({ @Component({
selector: 'app-form', selector: 'app-form',
templateUrl: './form.component.html', templateUrl: './form.component.html',
styleUrls: ['./form.component.css'] styleUrls: ['./form.component.scss']
}) })
export class FormComponent implements OnInit, OnChanges, OnDestroy { export class FormComponent implements OnInit, OnChanges, OnDestroy {
// 储存数据用 _item: any;
saveKey = "test_001"; KEY = 'DataKey_Sbox_FT_08';
// 储存对象 checkOptionsOne = []
item; Text = "Text"
Image = "Image"
set item(item) {
this._item = item;
}
get item() {
return this._item;
}
contentObj = {
"version": "1.0",
key: "DataKey_Sbox_FT_08",
bgMusic: "",
titleText: "",
questionAudio_url: "",
dataArray: []
}
@Output()
update = new EventEmitter();
constructor(private appRef: ApplicationRef, private changeDetectorRef: ChangeDetectorRef) { constructor(private appRef: ApplicationRef, private changeDetectorRef: ChangeDetectorRef) {
} }
createShell() {
this.item.wordList.push({
word: '',
audio: '',
backWord: '',
backWordAudio: '',
});
this.save(); handleQuestionTypeChange(){
// if(this.contentObj.question.type != 'LongAudio'){
// this.contentObj.answerType='Text'
// }
this.saveItem()
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
} }
removeShell(idx) { handleAnswerTypeChange(){
this.item.wordList.splice(idx, 1); // console.log("Change")
this.save(); // let len = this.contentObj.dataArray.length
// this.contentObj.dataArray = Array(len).fill("")
this.saveItem()
}
handleTextChange(e, index){
// console.log(e.target.value, index)
this.contentObj.dataArray[index].text = e.target.value
this.saveItem()
this.refresh();
} }
ngOnInit() {
this.item = {};
// 获取存储的数据
(<any>window).courseware.getData((data) => {
ngOnInit() {
this.item = {};
this.item.contentObj = {};
const getData = (<any> window).courseware.getData;
getData((data) => {
console.log("读取数据", data)
if (data) { if (data) {
this.item = data; this.item = data;
} else {
this.item = {};
}
if ( !this.item.contentObj ) {
this.item.contentObj = {};
} }
this.init(); this.init();
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
this.refresh(); this.refresh();
setTimeout(() => {
}, this.saveKey); this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
}, 100);
// this.save()
}, this.KEY);
} }
ngOnChanges() { ngOnChanges() {
} }
ngOnDestroy() { ngOnDestroy() {
} }
init() { init() {
if (Object.keys(this.item.contentObj).length != 0 && this.item.contentObj.version && this.item.contentObj.version==this.contentObj.version) {
console.log("读取数据", this.item.contentObj)
this.contentObj = this.item.contentObj;
} else {
console.log("使用演示数据", this.contentObj)
this.item.contentObj = this.contentObj;
}
}
cardItemData(){
return {audio_url:"", image_url:""}
} }
cardChoiceData(){
return { isText: true, text: "", image_url: "" }
}
/**
* 储存图片数据
* @param e
*/
onImageUploadSuccess(e, key) {
this.item[key] = e.url; initData() {
this.save();
} }
/** handleMoveItemUp(items, index){
* 储存音频数据 if(index!=0){
* @param e items[index] = items.splice(index-1, 1, items[index])[0];
*/ }else{
onAudioUploadSuccess(e, key) { items.push(items.shift());
this.item[key] = e.url; }
this.save(); this.save()
}
handleMoveItemDown(items, index){
if(index!=items.length-1){
items[index] = items.splice(index+1, 1, items[index])[0];
}else{
items.unshift( items.splice(index,1)[0]);
}
this.save()
}
deleteItem(item, index){
item.splice(index,1)
this.save()
}
addItem(item?, type?) {
item.push({text: "", image_url: ""})
this.saveItem();
} }
onWordAudioUploadSuccess(e, idx) { onImageUploadSuccessByItem(e, item, key) {
this.item.wordList[idx].audio = e.url; item[key] = e.url
this,this.refresh()
this.save();
}
onAudioUploadSuccessByItem(e, item, key) {
item[key] = e.url
this.save(); this.save();
} }
onBackWordAudioUploadSuccess(e, idx) {
this.item.wordList[idx].backWordAudio = e.url; saveItem() {
this.save(); this.save();
} }
/**
* 储存数据
*/
save() { save() {
(<any>window).courseware.setData(this.item, null, this.saveKey); (<any> window).courseware.setData(this.item, null, this.KEY);
this.refresh(); this.refresh();
console.log('this.item = ' + JSON.stringify(this.item)); console.log(JSON.stringify(this.item))
console.log("保存", this.item)
} }
/**
* 刷新 渲染页面
*/
refresh() { refresh() {
setTimeout(() => { setTimeout(() => {
this.appRef.tick(); this.appRef.tick();
}, 1); }, 1);
} }
} updateCheckbox(){
\ No newline at end of file let check = []
this.item.contentObj.textDown.forEach((item, index) => {
check.push({label:index+1, value:index, checked:false})
});
let length = check.length
this.item.contentObj.textUp.forEach((item, index) => {
let _check = JSON.parse(JSON.stringify(check))
item.lineTo.forEach(option=> {
if(option<length){
_check[Number(option)].checked = true
}
});
item.checkOptions = _check
});
}
}
/* You can add global styles to this file, and also import other style files */ /* You can add global styles to this file, and also import other style files */
@import "~ng-zorro-antd/src/ng-zorro-antd.css";
\ No newline at end of file
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
] ]
}, },
"angularCompilerOptions": { "angularCompilerOptions": {
"enableIvy": false,
"fullTemplateTypeCheck": true, "fullTemplateTypeCheck": true,
"strictInjectionParameters": true "strictInjectionParameters": true
} }
......
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "f0680ae0-c079-45ef-abd7-9e63d90b982b", "uuid": "f9f63fef-f158-4c0f-9a35-c913ae020fc8",
"downloadMode": 0, "downloadMode": 0,
"duration": 0.130612, "duration": 5.09175,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{ {
"ver": "1.1.0", "ver": "1.1.0",
"uuid": "c551970e-b095-45f3-9f1d-25cde8b8deb1", "uuid": "4278e1b0-1b0e-4c36-a439-b8e331576335",
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
export default class Cartoon {
elements = {
}
touchEventCallback = {
}
audioCallback = {
}
constructor() {
}
audios = {}
initCartoonElement(key, node) {
if(!node) {
console.error("Can not find node for key:[" + key + "]")
}
this.elements[key] = {}
this.elements[key].key = key
this.elements[key].node = node
this.elements[key].initX = node.x
this.elements[key].initY = node.y
this.elements[key].initScaleX = node.scaleX
this.elements[key].initScaleY = node.scaleY
this.elements[key].dragonBones = new DragonBones(node)
this.elements[key]["setLocation"] = (x, y) => {
if(x) {
this.elements[key].initX = x
this.elements[key].node.x = x
}
if(y) {
this.elements[key].initY = y
this.elements[key].node.y = y
}
}
return this.elements[key]
}
getCartoonElement(key) {
let node = this.elements[key]
if(!node) {
console.error("Can't find '" + key + "' node.")
}
return node
}
getSpritNode(nodeName, nameSpace = "") {
let node = cc.find(`${nameSpace}${nodeName}`)
return node?node:null
}
getNodeByName(nodeName, parentNodeName) {
let node = null
if(parentNodeName) {
node = this.getSpritNode(parentNodeName).getChildByName(nodeName)
} else {
node = this.getSpritNode(nodeName)
}
return node?node:null
}
getNodeByPath(path) {
let node = cc.find(path)
if(!node) {
console.warn("Can not fount node.(PATH:" + path + ")")
}
return node?node:null
}
getColor(hex) {
let color = new cc.color()
color.fromHEX(hex);
return color
}
getFontFamily(fontName) {
let font = cc.find(`Canvas/res/font/${fontName}`).getComponent('cc.Label').font;
return font
}
newLabelNode(text, fontFamily, fontSize, color) {
const labelNode = new cc.Node();
labelNode.color = this.getColor(color);
const label = labelNode.addComponent(cc.Label);
label.string = text;
label.fontSize = fontSize;
label.lineHeight = fontSize;
label.font = this.getFontFamily(fontFamily);
return labelNode
}
cloneNode(targetNode) {
var node = cc.instantiate(targetNode);
return node
}
subscribeTouchEvent(key, callBack) {
if(!this.touchEventCallback[key]) {
this.touchEventCallback[key] = callBack
this.elements[key].node.on(cc.Node.EventType.TOUCH_START, ()=>{
if(this.touchEventCallback[key]) {
this.touchEventCallback[key]()
}
})
} else {
this.touchEventCallback[key] = callBack
}
}
initLocalAudios(audioNames = []) {
const audioNode = cc.find('Canvas/res/audio');
const getAudioByResName = (resName) => {
return audioNode.getChildByName(resName).getComponent(cc.AudioSource);
}
audioNames.forEach(audioName=>{
this.audios[audioName] = getAudioByResName(audioName);
})
}
playLocalAudio(audioName, cb) {
let audio = cc.audioEngine.play(this.audios[audioName].clip, false, 0.2)
if (cb) {
this.audioCallback[audio_url] = cb
cc.audioEngine.setFinishCallback(audio, () => {
delete this.audioCallback[audio_url]
cb();
});
}
}
// Audio
playAudio(audio_url, cb = null) {
if (audio_url) {
var urlreg=/^(?=^.{3,255}$)(http(s)?:\/\/)?(www\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/\w+\.\w+)*([\?&]\w+=\w*)*$/
if(urlreg.test(audio_url)) {
cc.assetManager.loadRemote(audio_url, (err, audioClip) => {
if(cb) {
this.audioCallback[audio_url] = cb
}
const audioId = cc.audioEngine.play(audioClip, false, 1);
if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => {
delete this.audioCallback[audio_url]
cb();
});
}
});
} else {
const audioNode = cc.find('Canvas/res/audio').getChildByName(audio_url).getComponent(cc.AudioSource);
let audio = cc.audioEngine.play(audioNode.clip, false, 1)
if (cb) {
this.audioCallback[audio_url] = cb
cc.audioEngine.setFinishCallback(audio, () => {
delete this.audioCallback[audio_url]
cb();
});
}
}
}
}
stopAllAudio(exceptUrls = []) {
for(let key in this.audioCallback) {
if(exceptUrls.indexOf(key) == -1) {
this.audioCallback[key]()
}
}
this.audioCallback = {}
cc.audioEngine.stopAll()
}
// Tweenchange
tweenChange(item, obj, time = 0.8, callBack = null, easing = null, update = null) {
const tween = cc.tween(item).to(time, obj).call(()=>{
if(callBack) {
callBack()
}
});
easing && tween.easing(easing);
update && tween.onUpdate((a, b) => { update(a, b); });
tween.start();
return tween;
}
// Common Ani
creatSpeaker(parentNode, nodeName1, nodeName2) {
console.log(`Canvas/res/img/${nodeName1}`, `Canvas/res/img/${nodeName2}`)
const sprNode = this.cloneNode(this.getNodeByPath(`Canvas/res/img/${nodeName1}`));
sprNode.parent = parentNode;
sprNode.x = 0;
sprNode.y = 0;
sprNode.zIndex = 2;
parentNode.icon = sprNode;
const sprNode2 = this.cloneNode(this.getNodeByPath(`Canvas/res/img/${nodeName2}`));
sprNode2.parent = sprNode.parent;
sprNode2.x = sprNode.x;
sprNode2.y = sprNode.y;
sprNode2.opacity = 0;
sprNode.spr2 = sprNode2;
// sprNode.addComponent(cc.Button)
// sprNode.on('click', () => {
// this.showSoundAnima(sprNode);
// if(clickCB) {
// clickCB(this)
// }
// playAudioByUrl( item.data.audio_url , () => {
// this.stopSoundAnima(sprNode);
// });
// });
return sprNode
}
showSoundAnima(iconNode, time = 0.4) {
iconNode.isRunAnima = true;
iconNode.spr2.opacity = 255;
iconNode.opacity = 0;
cc.tween(iconNode)
.delay(time / 2)
.call(() => {
iconNode.spr2.opacity = 0;
iconNode.opacity = 255;
})
.delay(time / 2)
.call(() => {
if (iconNode.isRunAnima) {
this.showSoundAnima(iconNode);
}
})
.start()
}
stopSoundAnima(iconNode) {
iconNode.isRunAnima = false;
}
}
class DragonBones {
parentNode = null
_animationLoaded = null
constructor(parentNode) {
this.parentNode = parentNode
}
resetDragonBones() {
const picNode = this.parentNode
if (picNode.animaNode) {
picNode.animaNode.removeFromParent();
this._animationLoaded = null
}
}
setDragonBones(dragonBonesConfig, callback, onClickCB) {
const parentNode = this.parentNode
if (parentNode.animaNode) {
parentNode.animaNode.removeFromParent();
}
const animaNode = new cc.Node();
animaNode.parent = parentNode;
parentNode.animaNode = animaNode;
const dragonDisplay = animaNode.addComponent(dragonBones.ArmatureDisplay);
this._animationLoaded = dragonDisplay;
// const image = "http://staging-teach.cdn.ireadabc.com/5a0c5af3e952acd0ac83a6e5c6f03ff1.png";
// const ske = "http://staging-teach.cdn.ireadabc.com/bd825dcceea298d1146be8067ae3d17f.json";
// const atlas = "http://staging-teach.cdn.ireadabc.com/246f8991b729fa3e5a7f4802de828efa.json";
const image = dragonBonesConfig.texPngData.url
const ske = dragonBonesConfig.skeJsonData.url
const atlas = dragonBonesConfig.texJsonData.url
cc.loader.load(image, (error, texture) => {
cc.loader.load({url: atlas, type: 'txt'}, (error, atlasJson) => {
cc.loader.load({url: ske, type: 'txt'}, (error, dragonBonesJson) => {
const atlas = new dragonBones.DragonBonesAtlasAsset();
atlas.atlasJson = atlasJson;
atlas.texture = texture;
const asset = new dragonBones.DragonBonesAsset();
asset.dragonBonesJson = dragonBonesJson;
dragonDisplay.dragonAtlasAsset = atlas;
dragonDisplay.dragonAsset = asset;
let json = JSON.parse(asset.dragonBonesJson);
let armatures = json["armature"];
let armatureNames = [];
for (let i = 0; i < armatures.length; i++) {
armatureNames.push(armatures[i].name);
}
if (armatureNames.length > 0) {
let defaultArmatureName = armatureNames[0];
dragonDisplay.armatureName = defaultArmatureName;
let defaultArmature = armatures[0];
let animations = defaultArmature.animation;
let animationNames = [];
for (let i = 0; i < animations.length; i++) {
animationNames.push(animations[i].name);
}
dragonDisplay.animaNames = animationNames;
animaNode.addComponent(cc.Button)
animaNode.on('click', ()=>{
if(onClickCB) {
onClickCB(this)
}
})
}
if(callback) {
callback(this)
}
let sx = parentNode.width / animaNode.width;
let sy = parentNode.height / animaNode.height;
animaNode.setScale(Math.min(sx, sy));
});
});
});
}
showDragonBones(times = 1) {
if (this._animationLoaded && this._animationLoaded.animaNames.length > 0) {
this._animationLoaded.playAnimation(this._animationLoaded.animaNames[0], times);
}
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "799c0c91-0e23-4cf4-8fbf-68bbcf9e1616",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import Cartoon from "./Cartoon"
import defaultData from "./defaultData"
import { jelly } from "./utils"
export default class GameLogic {
g_cartoon = null;
g_formData = null
g_enableClick = true;
g_canvas = null;
g_systemOption = null;
g_useDefaultData = false;
g_curDragonDisplay = null;
m_questionAudioPlayed = false;
m_currentQuestion = -1;
m_questionDone = false;
constructor(formData, systemOption) {
this.g_systemOption = systemOption;
this.g_canvas = cc.find('Canvas');
this.g_cartoon = new Cartoon(cc);
if(!formData.contentObj.dataArray || formData.contentObj.dataArray.length == 0) {
this.g_useDefaultData = true;
this.g_formData = defaultData
console.warn("User default data =>", this.g_formData)
} else {
this.g_formData = formData.contentObj;
console.log("User saved data =>", this.g_formData)
}
this.m_currentQuestion = 0;
this.g_cartoon.initLocalAudios([
"test_audio"
])
this.initNodes();
this.initImageCards();
this.initTitle();
// this.initQuestionPannel();
// this.initButtons();
// this.initMaskLayer();
// this.initDragonBonesContainer();
// this.checkButtonStatus()
// // Load quesiton
// this.initSelectedCards();
// this.initText();
// this.initCenterImage();
// this.g_enableClick = false;
// this.resetAllSelectedCards();
// this.playQuestion(()=>{
// this.g_enableClick = true;
// })
}
initNodes() {
this.g_cartoon.initCartoonElement("title_text", this.g_cartoon.getNodeByPath(`Canvas/title/text`))
for(let index=0; index<10; index++) {
this.g_cartoon.initCartoonElement(`card_${index+1}`, this.g_cartoon.getNodeByPath(`Canvas/card_${index+1}`))
this.g_cartoon.initCartoonElement(`card_${index+1}_normal`, this.g_cartoon.getNodeByPath(`Canvas/card_${index+1}/normal`));
this.g_cartoon.initCartoonElement(`card_${index+1}_selected`, this.g_cartoon.getNodeByPath(`Canvas/card_${index+1}/selected`));
this.g_cartoon.initCartoonElement(`card_${index+1}_bell`, this.g_cartoon.getNodeByPath(`Canvas/card_${index+1}/bell`))
this.g_cartoon.initCartoonElement(`card_${index+1}_bell_text`, this.g_cartoon.getNodeByPath(`Canvas/card_${index+1}/bell/index`))
this.g_cartoon.initCartoonElement(`card_${index+1}_bell_outline`, this.g_cartoon.getNodeByPath(`Canvas/card_${index+1}/bell/bell_outline`));
this.g_cartoon.initCartoonElement(`card_${index+1}_image_container`, this.g_cartoon.getNodeByPath(`Canvas/card_${index+1}/container/image`));
}
// this.resetPosition()
}
resetPosition() {
console.log(this.g_cartoon.getCartoonElement("question_title_pannel"))
// this.g_cartoon.getCartoonElement("bottomPart_pannel").setLocation(this.g_systemOption.frameSize.width * this.g_systemOption.cocosScale, 4)
// this.g_cartoon.getCartoonElement("question_title_pannel").setLocation(this.g_systemOption.frameSize.width * this.g_systemOption.cocosScale / 2)
// this.g_cartoon.getCartoonElement(`selected_1`).setLocation(0)
// this.g_cartoon.getCartoonElement(`selected_2`).setLocation(0)
// this.g_cartoon.getCartoonElement(`selected_3`).setLocation(0)
// this.g_cartoon.getCartoonElement(`selected_4`).setLocation(0)
// this.g_cartoon.getCartoonElement(`selected_5`).setLocation(cc.winSize.width - 150)
// this.g_cartoon.getCartoonElement(`selected_6`).setLocation(cc.winSize.width - 100)
// this.g_cartoon.getCartoonElement(`selected_7`).setLocation(cc.winSize.width - 80)
// this.g_cartoon.getCartoonElement(`selected_8`).setLocation(cc.winSize.width - 160)
// this.g_cartoon.getNodeByPath(`Canvas/center_image`).x = cc.winSize.width / 2 + 20
// this.g_cartoon.getNodeByPath(`Canvas/center_image`).y = cc.winSize.height / 2
}
initImageCards() {
for (let index = 0; index < 10; index++) {
let dataItem = this.g_formData.dataArray[index];
let card = this.g_cartoon.getCartoonElement(`card_${index+1}`)
let cardNormal = this.g_cartoon.getCartoonElement(`card_${index+1}_normal`)
let cardSelected = this.g_cartoon.getCartoonElement(`card_${index+1}_selected`)
let imageContainer = this.g_cartoon.getCartoonElement(`card_${index+1}_image_container`)
let bellOutline = this.g_cartoon.getCartoonElement(`card_${index+1}_bell_outline`)
let bellText = this.g_cartoon.getCartoonElement(`card_${index+1}_bell_text`)
bellText.node.getComponent(cc.Label).font = this.g_cartoon.getFontFamily("Comic Sans MS")
bellText.node.getComponent(cc.Label).fontSize = 20
if(this.g_useDefaultData || !dataItem) {
let fr = this.getSpriteFrimeByResName("card_demo")
imageContainer.node.setScale(1)
imageContainer.node.getComponent(cc.Sprite).spriteFrame = fr
} else {
this.getSpriteFrimeByUrl(dataItem.image_url, (fr)=>{
let sx = 220 / fr.getRect().width;
let sy = 110 / fr.getRect().height;
let s = Math.min(sx, sy)
imageContainer.node.width = s * fr.getRect().width;
imageContainer.node.height = s * fr.getRect().height;
imageContainer.node.getComponent(cc.Sprite).spriteFrame = fr
})
}
bellOutline.node.setScale(0);
this.g_cartoon.subscribeTouchEvent(`card_${index+1}_image_container`, ()=>{
for(let i=0; i<10; i++) {
if(i!=index) {
this.g_cartoon.getCartoonElement(`card_${i+1}_normal`).node.opacity = 255;
this.g_cartoon.getCartoonElement(`card_${i+1}_selected`).node.opacity = 0;
} else {
this.g_cartoon.getCartoonElement(`card_${i+1}_normal`).node.opacity = 0;
this.g_cartoon.getCartoonElement(`card_${i+1}_selected`).node.opacity = 255;
}
}
})
card.tweenHandle = null;
const runBell = () => {
bellOutline.node.setScale(1, 1)
bellOutline.node.opacity = 255;
card.tweenHandle = this.g_cartoon.tweenChange(bellOutline.node, {scaleX: 2, scaleY: 2, opacity: 0}, 0.4, ()=>{
runBell()
})
}
const stopBell = () => {
if(card.tweenHandle) {
card.tweenHandle.stop();
card.tweenHandle = null
}
bellOutline.node.setScale(0, 0)
bellOutline.node.opacity = 0;
}
this.g_cartoon.subscribeTouchEvent(`card_${index+1}_bell`, ()=>{
this.g_cartoon.stopAllAudio()
this.g_cartoon.playAudio("test_audio", ()=>{
stopBell()
})
runBell()
})
}
}
initCenterImage() {
let imageContainer = this.g_cartoon.getCartoonElement("center_image_container")
if(!this.g_formData.dataArray[this.m_currentQuestion].question.centerImage_url) {
let fr = this.getSpriteFrimeByResName("default_stage")
imageContainer.node.setScale(1)
imageContainer.node.getComponent(cc.Sprite).spriteFrame = fr
} else {
let parentWidth = imageContainer.node.parent.width
let parentHeight = imageContainer.node.parent.height
this.getSpriteFrimeByUrl(this.g_formData.dataArray[this.m_currentQuestion].question.centerImage_url, (fr)=>{
imageContainer.node.getComponent(cc.Sprite).spriteFrame = fr
imageContainer.node.scaleX = parentWidth / imageContainer.node.width
imageContainer.node.scaleY = parentHeight / imageContainer.node.height
})
}
}
initTitle() {
this.g_cartoon.getCartoonElement("title_text").node.getComponent(cc.Label).string = "It's My Day"
this.g_cartoon.getCartoonElement("title_text").node.getComponent(cc.Label).font = this.g_cartoon.getFontFamily("Comic Sans MS")
this.g_cartoon.getCartoonElement("title_text").node.getComponent(cc.Label).fontSize = 32
}
initQuestionPannel() {
let title = this.g_cartoon.getCartoonElement("question_title_pannel")
let body = this.g_cartoon.getCartoonElement("question_body_pannel")
let bodyText = this.g_cartoon.getCartoonElement("question_body_pannel_text")
// title.node.y = cc.winSize.height - this.g_cartoon.getCartoonElement("question_title_pannel_background").node.height / 2
this.g_cartoon.subscribeTouchEvent(title.key, ()=>{
if(!this.g_enableClick) {
console.warn("g_enableClick disabeld!")
return;
}
if(this.g_formData.dataArray[this.m_currentQuestion].question.question_audio_url) {
this.g_cartoon.stopAllAudio()
this.g_cartoon.playAudio(this.g_formData.dataArray[this.m_currentQuestion].question.question_audio_url, ()=>{
})
}
})
body.in = (callback) => {
body.node.y = -cc.winSize.height / 2 - this.g_cartoon.getCartoonElement("question_body_pannel_background").node.height / 2
this.g_cartoon.tweenChange(body.node, {y: -270}, 0.5, ()=>{
this.g_cartoon.tweenChange(bodyText.node, {opacity: 255}, 0.5, ()=>{
if(callback) {
callback()
}
})
})
}
body.out = () => {
bodyText.node.opacity = 0;
body.node.y = -cc.winSize.height / 2 - this.g_cartoon.getCartoonElement("question_body_pannel_background").node.height / 2
}
this.g_cartoon.subscribeTouchEvent(body.key, ()=>{
if(!this.g_enableClick) {
console.warn("g_enableClick disabeld!")
return;
}
if(this.g_formData.dataArray[this.m_currentQuestion].question.body_audio_url) {
this.g_cartoon.stopAllAudio()
this.g_cartoon.getCartoonElement("Text_DragonBones").dragonBones.showDragonBones(1)
this.g_cartoon.playAudio(this.g_formData.dataArray[this.m_currentQuestion].question.body_audio_url, ()=>{
})
}
})
}
initDragonBonesContainer () {
let container = this.g_cartoon.getCartoonElement("DragonBones-Container")
container.hide = () => {
// container.node.scaleX = 0
// container.node.scaleY = 0
container.node.opacity = 0;
}
container.show = (callback) => {
// container.node.y = container.node.y + 220;
container.node.opacity = 0;
this.g_cartoon.tweenChange(container.node, {opacity: 255}, 0.7, ()=>{
if(callback) {
callback()
}
})
}
}
initSelectedCards() {
let order = [2,6,3,7,1,5,4,8]
let dragonBones = this.g_formData.dataArray[this.m_currentQuestion].dragonBones;
for (let index = 0; index < 8; index++) {
let dataItem = this.g_formData.dataArray[this.m_currentQuestion].selectCards[index];
let el = this.g_cartoon.getCartoonElement(`selected_${order[index]}`)
if(!dataItem) {
el.node.active = false;
continue;
} else {
el.node.active = true;
}
this.g_cartoon.getCartoonElement(`selected_${order[index]}_highlight`).node.active = false;
this.g_cartoon.getCartoonElement(`selected_${order[index]}_play`).node.active = false;
let audioEl = this.g_cartoon.getCartoonElement(`selected_${order[index]}_speaker`);
let audioAni = this.g_cartoon.creatSpeaker(audioEl.node, "icon_sound", "icon_sound_2")
let imageContainer = this.g_cartoon.getCartoonElement(`selected_${order[index]}_image_container`)
let errorIcon = this.g_cartoon.getCartoonElement(`selected_${order[index]}_error_x`)
errorIcon.node.scale = 0;
let errorMask = this.g_cartoon.getCartoonElement(`selected_${order[index]}_error_mask`)
errorMask.node.active = false;
if(this.g_useDefaultData) {
let fr = this.getSpriteFrimeByResName(dataItem.image_url)
imageContainer.node.getComponent(cc.Sprite).spriteFrame = fr
} else {
this.getSpriteFrimeByUrl(dataItem.image_url, (fr)=>{
imageContainer.node.getComponent(cc.Sprite).spriteFrame = fr
})
}
this.g_cartoon.subscribeTouchEvent(el.key, ()=>{
if(!this.g_enableClick) {
console.warn("g_enableClick disabeld!")
return;
}
if(this.m_questionDone) {
return;
}
this.g_enableClick = false;
if(dataItem.isAnswer) {
this.maskOthers(order[index]-1)
this.g_cartoon.getCartoonElement(`selected_${order[index]}_highlight`).node.active = true;
this.g_cartoon.playAudio("right_goodjob")
this.showRightCircle(imageContainer, ()=>{
this.m_questionDone = true;
this.g_enableClick = true;
if(this.g_formData.dataArray[this.m_currentQuestion].question.body_audio_url) {
this.g_cartoon.playAudio(this.g_formData.dataArray[this.m_currentQuestion].question.body_audio_url, ()=>{
this.g_cartoon.playAudio("good_job")
})
} else {
this.g_cartoon.playAudio("good_job")
}
if(dragonBones && dragonBones.texPngData.url && dragonBones.skeJsonData.url && dragonBones.texJsonData.url) {
this.g_cartoon.getCartoonElement("Center_DragonBones").dragonBones.setDragonBones(dragonBones, (handle)=>{
this.g_cartoon.getCartoonElement("DragonBones-Container").show(()=>{
handle.showDragonBones(0);
}, ()=>{
// handle.showDragonBones();
})
})
}
})
} else {
this.showWrongCircle(errorIcon.node, errorMask.node)
this.g_enableClick = true;
}
})
el.in = (callback) => {
this.g_cartoon.tweenChange(el.node, {x: el.initX}, 0.5, ()=>{
callback && callback()
})
}
el.out = (callback) => {
this.g_cartoon.tweenChange(el.node, {x: el.initX - this.g_canvas.width}, 0.5, ()=>{
callback && callback()
})
}
el.setContent = (image_url) => {
this.g_cartoon.tweenChange(imageContainer.node, {scaleX: 0, scaleY: 0}, 0.1, ()=>{
this.getSpriteFrimeByUrl(image_url, (fr)=>{
imageContainer.node.getComponent(cc.Sprite).spriteFrame = fr
this.g_cartoon.tweenChange(imageContainer.node, {scaleX: imageContainer.initScaleX, scaleY: imageContainer.initScaleY}, 0.1)
})
})
}
if(!dataItem.audio_url) {
audioEl.node.active = false;
} else {
audioEl.node.active = true;
}
this.g_cartoon.getCartoonElement(`selected_${order[index]}_speaker`).node.off("click")
this.g_cartoon.getCartoonElement(`selected_${order[index]}_speaker`).node.on("click", ()=>{
this.g_cartoon.stopAllAudio()
this.g_cartoon.stopSoundAnima(audioAni)
this.g_cartoon.showSoundAnima(audioAni)
if(!this.m_questionDone) {
this.g_cartoon.getCartoonElement(`selected_${order[index]}_play`).node.active = true;
}
this.g_cartoon.playAudio(dataItem.audio_url, ()=>{
this.g_cartoon.stopSoundAnima(audioAni)
this.g_cartoon.getCartoonElement(`selected_${order[index]}_play`).node.active = false;
})
})
}
}
playQuestion(callback) {
if(this.m_currentQuestion==0 && this.g_formData.dataArray[this.m_currentQuestion].question.question_audio_url) {
this.g_cartoon.playAudio(this.g_formData.dataArray[this.m_currentQuestion].question.question_audio_url, ()=>{
this.m_questionAudioPlayed = true;
this.g_cartoon.getCartoonElement("question_body_pannel").in(()=>this.playQuestionBody(()=>{
if(callback) {
callback()
}
}));
})
} else {
this.g_cartoon.getCartoonElement("question_body_pannel").in(()=>this.playQuestionBody(()=>{
if(callback) {
callback()
}
}));
}
}
playQuestionBody(callback) {
console.log("TEST", this.g_formData.dataArray[this.m_currentQuestion].question.body_audio_url)
if(this.g_formData.dataArray[this.m_currentQuestion].question.body_audio_url) {
this.g_cartoon.playAudio(this.g_formData.dataArray[this.m_currentQuestion].question.body_audio_url, ()=>{
if(callback) {
callback()
}
})
} else {
if(callback) {
callback()
}
}
}
initButtons() {
let left = this.g_cartoon.getCartoonElement(`buttombutton_left`)
let right = this.g_cartoon.getCartoonElement(`buttombutton_right`)
let reload = this.g_cartoon.getCartoonElement(`buttombutton_restart`)
let close = this.g_cartoon.getCartoonElement(`buttombutton_close`)
left.disabled = true;
left.node.opacity = 128;
right.disabled = false;
this.g_cartoon.subscribeTouchEvent(left.key, ()=>{
if(!this.g_enableClick) {
console.warn("g_enableClick disabeld!")
return;
}
if(left.disabled) {
return
}
this.g_enableClick = false;
jelly(left.node)
if(this.m_currentQuestion >0) {
this.m_currentQuestion--
this.refreshQuestion(()=>{
this.g_enableClick = true;
})
} else {
this.g_enableClick = true;
}
})
this.g_cartoon.subscribeTouchEvent(right.key, ()=>{
if(!this.g_enableClick) {
console.warn("g_enableClick disabeld!")
return;
}
if(right.disabled) {
return
}
jelly(right.node)
this.g_enableClick = false;
if(this.m_currentQuestion<this.g_formData.dataArray.length-1) {
this.m_currentQuestion++
this.refreshQuestion(()=>{
this.g_enableClick = true;
})
} else {
this.g_enableClick = true;
}
})
this.g_cartoon.subscribeTouchEvent(reload.key, ()=>{
if(!this.g_enableClick) {
console.warn("g_enableClick disabeld!")
return;
}
jelly(reload.node)
this.g_enableClick = false;
this.refreshQuestion(()=>{
this.g_enableClick = true;
})
})
}
maskOthers(index) {
for(let i=0; i<8; i++) {
this.g_cartoon.getCartoonElement(`selected_${i+1}_error_mask`).node.active = (index==i)?false:true;
}
}
resetAllSelectedCards() {
this.m_questionDone = false;
this.m_questionAudioPlayed = false;
for(let i=1; i<=8; i++) {
this.g_cartoon.getCartoonElement(`selected_${i}_highlight`).node.active = false
this.g_cartoon.getCartoonElement(`selected_${i}_play`).node.active = false
this.g_cartoon.getCartoonElement(`selected_${i}_image_container`).node.active = true
}
this.g_cartoon.getCartoonElement("DragonBones-Container").hide();
this.g_cartoon.getCartoonElement("question_body_pannel").out();
// this.g_cartoon.getCartoonElement("question_title_pannel").out()
this.g_cartoon.getCartoonElement("Center_DragonBones").dragonBones.resetDragonBones()
}
initText() {
this.g_cartoon.getCartoonElement("question_title_pannel_text").node.color = this.g_cartoon.getColor("FFFFFF")
this.g_cartoon.getCartoonElement("question_title_pannel_text").node.getComponent(cc.Label).string = this.g_formData.dataArray[this.m_currentQuestion].question.question_text
this.g_cartoon.getCartoonElement("question_title_pannel_text").node.getComponent(cc.Label).font = this.g_cartoon.getFontFamily("FatMarker")
this.g_cartoon.getCartoonElement("question_title_pannel_text").node.getComponent(cc.Label).fontSize = 32
this.g_cartoon.getCartoonElement("question_body_pannel_text").node.color = this.g_cartoon.getColor("ffd75f")
this.g_cartoon.getCartoonElement("question_body_pannel_text").node.getComponent(cc.Label).string = this.g_formData.dataArray[this.m_currentQuestion].question.body_text
this.g_cartoon.getCartoonElement("question_body_pannel_text").node.getComponent(cc.Label).font = this.g_cartoon.getFontFamily("BRLNSR_1")
this.g_cartoon.getCartoonElement("question_body_pannel_text").node.getComponent(cc.Label).fontSize = 42;
// if( this.g_formData.dataArray[this.m_currentQuestion].textDragonBones &&
// this.g_formData.dataArray[this.m_currentQuestion].textDragonBones.skeJsonData.url &&
// this.g_formData.dataArray[this.m_currentQuestion].textDragonBones.texJsonData.url &&
// this.g_formData.dataArray[this.m_currentQuestion].textDragonBones.texPngData.url) {
// this.g_cartoon.getCartoonElement("Text_DragonBones").dragonBones.setDragonBones(this.g_formData.dataArray[this.m_currentQuestion].textDragonBones, (handle)=>{
// this.g_cartoon.getCartoonElement("question_body_pannel_text").node.active = false;
// handle.showDragonBones(1);
// })
// } else {
// this.g_cartoon.getCartoonElement("question_body_pannel_text").node.active = true;
// }
this.g_cartoon.getCartoonElement("question_body_pannel_text").node.active = true;
}
checkButtonStatus() {
if(this.m_currentQuestion == 0) {
this.g_cartoon.getCartoonElement("buttombutton_left").node.opacity = 128;
this.g_cartoon.getCartoonElement("buttombutton_left").disabled = true;
} else {
this.g_cartoon.getCartoonElement("buttombutton_left").node.opacity = 255;
this.g_cartoon.getCartoonElement("buttombutton_left").disabled = false;
}
if(this.m_currentQuestion == this.g_formData.dataArray.length-1) {
this.g_cartoon.getCartoonElement("buttombutton_right").node.opacity = 128;
this.g_cartoon.getCartoonElement("buttombutton_right").disabled = true;
} else {
this.g_cartoon.getCartoonElement("buttombutton_right").node.opacity = 255;
this.g_cartoon.getCartoonElement("buttombutton_right").disabled = false;
}
}
refreshQuestion(callback) {
this.g_cartoon.stopAllAudio()
this.showMaskLayer(()=>{
this.checkButtonStatus()
this.resetAllSelectedCards()
this.initSelectedCards();
this.initText()
this.initCenterImage();
this.hideMaskLayer(()=>{
this.playQuestion(()=>{
if(callback) {
callback()
}
})
})
})
}
showRightCircle(targetNode, callback) {
const centerPic = this.g_cartoon.getNodeByPath(`Canvas/center_image`)
const oldParent = targetNode.node.parent
const worldPos = oldParent.convertToWorldSpaceAR(cc.v2(targetNode.node.x, targetNode.node.y));
const localPos = centerPic.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y));
const picNode = this.g_cartoon.cloneNode(targetNode.node)
targetNode.node.active = false;
picNode.parent = centerPic;
picNode.x = localPos.x;
picNode.y = localPos.y;
const sx = centerPic.width / picNode.width
const sy = centerPic.height / picNode.height;
const s = Math.min(sx, sy);
cc.tween(picNode)
.to(0.7, {x: 0, y: 0, angle: 360}, {easing: 'sineOut'})
.delay(0.2)
.to(1.5, {scale: s, opacity: 0}, {easing: 'cubicOut'})
.call(() => {
if(callback) {
callback()
}
})
.start();
}
showWrongCircle(icon, mask) {
if (mask.active) {
return;
}
// cc.audioEngine.play(this.audioWrong.clip, false, 0.2)
this.g_cartoon.playAudio("error")
const showIcon = () => {
cc.tween(icon)
.to(0.3, {scale: 0.9}, {easing: 'bounceOut'})
.delay(0.2)
.to(0.7, {scale: 0}, {easing: 'cubicIn'})
.call(()=>{
this.g_cartoon.playAudio("tryagain")
})
.start();
}
const hide = () => {
mask.opacity = 0;
cc.tween(mask)
.to(0.1, {opacity: 255})
.call(() => {
showIcon();
})
.start()
}
hide();
mask.active = true;
}
// Common function
maskLayer = null;
initMaskLayer() {
const parentNode = this.g_cartoon.getNodeByPath("Canvas/MaskLayer")
parentNode.x = cc.winSize.width / 2
parentNode.y = cc.winSize.height / 2
const bNode = this.getSprNode('black');
bNode.scaleX = cc.winSize.width / bNode.width;
bNode.scaleY = cc.winSize.height / bNode.height;
bNode.x = 0
bNode.y = 0
bNode.parent = cc.find('Canvas');
bNode.active = false;
this.maskLayer = bNode;
}
showMaskLayer(cb) {
this.maskLayer.opacity = 0;
this.maskLayer.active = true;
cc.tween(this.maskLayer)
.to(0.5, {opacity: 255}, {easing: 'sineOut'})
.call(() => {
cb()
})
.start()
}
hideMaskLayer(cb = null) {
this.maskLayer.opacity = 255;
cc.tween(this.maskLayer)
.to(0.5, {opacity: 0}, {easing: 'sineIn'})
.call(() => {
this.maskLayer.active = false;
if (cb) {
cb()
}
})
.start()
}
// Common API
getSpriteFrimeByUrl(url, cb) {
cc.loader.load({ url }, (err, img) => {
const spriteFrame = new cc.SpriteFrame(img)
if (cb) {
cb(spriteFrame);
}
})
}
getSpriteFrimeByResName(name) {
const sf = cc.find('Canvas/res/img/' + name).getComponent(cc.Sprite).spriteFrame;
// const node = new cc.Node();
// node.addComponent(cc.Sprite).spriteFrame = sf;
return sf;
}
getSprNode(resName) {
const sf = cc.find('Canvas/res/img/' + resName).getComponent(cc.Sprite).spriteFrame;
const node = new cc.Node();
node.addComponent(cc.Sprite).spriteFrame = sf;
return node;
}
}
{
"ver": "1.0.8",
"uuid": "356c544f-5ce9-4cbb-a2c1-c0737e0a02e2",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks: // Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import GameLogic from "./GameLogic"
cc.Class({ cc.Class({
extends: cc.Component, extends: cc.Component,
gameLogic: null,
properties: { properties: {
}, },
// 生命周期 onLoad // 生命周期 onLoad
...@@ -67,10 +67,18 @@ cc.Class({ ...@@ -67,10 +67,18 @@ cc.Class({
} }
getData((data) => { getData((data) => {
console.log('data:', data);
this.data = data || this.getDefaultData(); this.data = data || this.getDefaultData();
this.data = JSON.parse(JSON.stringify(this.data)) this.data = JSON.parse(JSON.stringify(this.data))
this.preloadItem() this.preloadItem()
// 添加游戏逻辑
this.gameLogic = new GameLogic(this.data, {
designSize: this._designSize,
frameSize: this._frameSize,
mapScaleMin: this._mapScaleMin,
mapScaleMax: this._mapScaleMax,
cocosScale: this._cocosScale,
});
}) })
}, },
...@@ -79,8 +87,7 @@ cc.Class({ ...@@ -79,8 +87,7 @@ cc.Class({
}, },
getDefaultData() { getDefaultData() {
const dataJson = '{"contentObj":{"version":"1.0","key":"DataKey_Sbox_FT_08","bgMusic":"","titleText":"TEstd","questionAudio_url":"","dataArray":[{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/51795b0a7c66d61ad85a388c4299f614.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/3b5540cc95a006dff8c41dba7537075a.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/c9d60af536380445e48c637acb753d51.gif"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/d3cdc8921c6ae9b4f29b25fbb3a0f2f9.jpg"}]}}'
const dataJson = '{"pic_url":"http://staging-teach.cdn.ireadabc.com/ed94332a503c31e0908bd4c6923a2665.png","pic_url_2":"http://staging-teach.cdn.ireadabc.com/5fb60317ade0195d35ad8034d5370a7f.png","text":"This is a test label.","audio_url":"http://staging-teach.cdn.ireadabc.com/f47f1d7b5c160fe1c59500d180346240.mp3"}'
const data = JSON.parse(dataJson); const data = JSON.parse(dataJson);
return data; return data;
}, },
...@@ -95,8 +102,15 @@ cc.Class({ ...@@ -95,8 +102,15 @@ cc.Class({
addPreloadImage() { addPreloadImage() {
this._imageResList.push({ url: this.data.pic_url }); if (!this.data.dataArray) {
this._imageResList.push({ url: this.data.pic_url_2 }); return;
}
this.data.dataArray.forEach(item=>{
this._imageResList.push({ url: item.question.centerImage_url});
})
}, },
addPreloadAudio() { addPreloadAudio() {
...@@ -105,7 +119,16 @@ cc.Class({ ...@@ -105,7 +119,16 @@ cc.Class({
}, },
addPreloadAnima() { addPreloadAnima() {
if (!this.data.dataArray) {
return;
}
this.data.dataArray.forEach((item) => {
if (item.dragonBones) {
this._animaResList.push({url: item.dragonBones.skeJsonData.url});
this._animaResList.push({url: item.dragonBones.texJsonData.url});
this._animaResList.push({url: item.dragonBones.texPngData.url});
}
})
}, },
preload() { preload() {
...@@ -125,7 +148,6 @@ cc.Class({ ...@@ -125,7 +148,6 @@ cc.Class({
loadEnd() { loadEnd() {
this.initData(); this.initData();
this.initAudio();
this.initView(); this.initView();
// this.initListener(); // this.initListener();
}, },
...@@ -136,29 +158,15 @@ cc.Class({ ...@@ -136,29 +158,15 @@ cc.Class({
this._cantouch = true; this._cantouch = true;
}, },
audioBtn: null,
initAudio() {
const audioNode = cc.find('Canvas/res/audio');
const getAudioByResName = (resName) => {
return audioNode.getChildByName(resName).getComponent(cc.AudioSource);
}
this.audioBtn = getAudioByResName('btn');
},
initView() { initView() {
this.initBg(); this.initBg();
this.initPic(); // this.initPic();
this.initBtn(); // this.initBtn();
this.initIcon(); // this.initIcon();
}, },
initBg() { initBg() {
const bgNode = cc.find('Canvas/bg'); const bgNode = cc.find('Canvas/bgMain');
bgNode.scale = this._mapScaleMax; bgNode.scale = this._mapScaleMax;
}, },
...@@ -232,6 +240,7 @@ cc.Class({ ...@@ -232,6 +240,7 @@ cc.Class({
//节点中添加了button组件 则可以添加click事件监听 //节点中添加了button组件 则可以添加click事件监听
leftBtnNode.on('click', () => { leftBtnNode.on('click', () => {
if (!this._cantouch) { if (!this._cantouch) {
console.warn("_cantouch disabeld!")
return; return;
} }
if (this.curPage == 0) { if (this.curPage == 0) {
...@@ -247,6 +256,7 @@ cc.Class({ ...@@ -247,6 +256,7 @@ cc.Class({
//节点中添加了button组件 则可以添加click事件监听 //节点中添加了button组件 则可以添加click事件监听
rightBtnNode.on('click', () => { rightBtnNode.on('click', () => {
if (!this._cantouch) { if (!this._cantouch) {
console.warn("_cantouch disabeld!")
return; return;
} }
if (this.curPage == 1) { if (this.curPage == 1) {
...@@ -322,6 +332,13 @@ cc.Class({ ...@@ -322,6 +332,13 @@ cc.Class({
return node; return node;
}, },
getSprNode(resName) {
const sf = cc.find(resName).getComponent(cc.Sprite).spriteFrame;
const node = new cc.Node();
node.addComponent(cc.Sprite).spriteFrame = sf;
return node;
},
getSpriteFrimeByUrl(url, cb) { getSpriteFrimeByUrl(url, cb) {
cc.loader.load({ url }, (err, img) => { cc.loader.load({ url }, (err, img) => {
......
export default {
default: true,
dataArray: [
{
question: {
question_text: "What Am I Doing?",
body_text: "I am walking.",
question_audio_url: "whatamidoing",
body_audio_url: "imwalking"
},
selectCards: [
{ image_url: "eat", audio_url: "imeatting", stage_image_url: "", isAnswer: false },
{ image_url: "fly", audio_url: "iamflying", stage_image_url: "", isAnswer: false },
{ image_url: "drive", audio_url: "imdrivingmycar", stage_image_url: "", isAnswer: false },
{ image_url: "dance", audio_url: "imdancing", stage_image_url: "", isAnswer: false },
{ image_url: "jump", audio_url: "iamjumping", stage_image_url: "", isAnswer: false },
{ image_url: "roll", audio_url: "iamrolling", stage_image_url: "", isAnswer: false },
{ image_url: "sleep", audio_url: "imsleeping", stage_image_url: "", isAnswer: false },
{ image_url: "walk", audio_url: "imwalking", stage_image_url: "", isAnswer: true }
]
},
{
question: {
question_text: "What Am I Doing?",
body_text: "I am dancing.",
question_audio_url: "",
body_audio_url: "imdancing"
},
selectCards: [
{ image_url: "dance", audio_url: "imdancing", stage_image_url: "", isAnswer: true },
{ image_url: "jump", audio_url: "iamjumping", stage_image_url: "", isAnswer: false },
{ image_url: "sleep", audio_url: "imsleeping", stage_image_url: "", isAnswer: false },
{ image_url: "drive", audio_url: "imdrivingmycar", stage_image_url: "", isAnswer: false },
{ image_url: "walk", audio_url: "imwalking", stage_image_url: "", isAnswer: false }
]
},
{
question: {
question_text: "What Am I Doing?",
body_text: "I am sleeping.",
question_audio_url: "",
body_audio_url: "imsleeping"
},
selectCards: [
{ image_url: "dance", audio_url: "imdancing", stage_image_url: "", isAnswer: false },
{ image_url: "eat", audio_url: "imeatting", stage_image_url: "", isAnswer: false },
{ image_url: "fly", audio_url: "iamflying", stage_image_url: "", isAnswer: false },
{ image_url: "sleep", audio_url: "imsleeping", stage_image_url: "", isAnswer: true },
{ image_url: "drive", audio_url: "imdrivingmycar", stage_image_url: "", isAnswer: false },
{ image_url: "walk", audio_url: "imwalking", stage_image_url: "", isAnswer: false }
]
},
{
question: {
question_text: "What Am I Doing?",
body_text: "I am eatting.",
question_audio_url: "",
body_audio_url: "imeatting"
},
selectCards: [
{ image_url: "drive", audio_url: "imdrivingmycar", stage_image_url: "", isAnswer: false },
{ image_url: "fly", audio_url: "imsleeping", stage_image_url: "", isAnswer: false },
{ image_url: "dance", audio_url: "imdancing", stage_image_url: "", isAnswer: false },
{ image_url: "eat", audio_url: "imeatting", stage_image_url: "", isAnswer: true },
{ image_url: "roll", audio_url: "iamrolling", stage_image_url: "", isAnswer: false },
{ image_url: "jump", audio_url: "iamjumping", stage_image_url: "", isAnswer: false },
{ image_url: "sleep", audio_url: "imsleeping", stage_image_url: "", isAnswer: false },
]
}
]
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "045d28a3-8121-42c8-9c5b-d8a5e06fcebf",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -118,7 +118,8 @@ export async function asyncPlayEffectByUrl(url, loop = false) { ...@@ -118,7 +118,8 @@ export async function asyncPlayEffectByUrl(url, loop = false) {
}); });
} }
export async function jelly(node) { export function jelly(node) {
console.log("Jelly")
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
cc.tween(node) cc.tween(node)
.to(0.1, { scaleX: 0.9, scaleY: 1.1 }) .to(0.1, { scaleX: 0.9, scaleY: 1.1 })
......
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f", "uuid": "14cea5d9-0c87-4950-a269-a35b2fd51b19",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 366, "width": 49,
"height": 336, "height": 48,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"1orange": { "bell": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "43d1e79d-6de8-4dcb-b8ce-d767df7913aa", "uuid": "84e15acd-4209-49b1-b361-1d08c0dd0022",
"rawTextureUuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f", "rawTextureUuid": "14cea5d9-0c87-4950-a269-a35b2fd51b19",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 0, "offsetX": 0,
"offsetY": -0.5, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 1, "trimY": 0,
"width": 366, "width": 49,
"height": 335, "height": 48,
"rawWidth": 366, "rawWidth": 49,
"rawHeight": 336, "rawHeight": 48,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "d582359e-924e-4ee9-9964-1fc4bb417e71", "uuid": "f6dc66a6-9e60-4771-8a57-1ea5f495d261",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 61, "width": 57,
"height": 67, "height": 53,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_right": { "bell_outline": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59", "uuid": "4114e7e7-3fd9-46a0-9087-0a9c2b2b2f04",
"rawTextureUuid": "d582359e-924e-4ee9-9964-1fc4bb417e71", "rawTextureUuid": "f6dc66a6-9e60-4771-8a57-1ea5f495d261",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": -0.5, "offsetX": 0,
"offsetY": 0.5, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 60, "width": 57,
"height": 66, "height": 53,
"rawWidth": 61, "rawWidth": 57,
"rawHeight": 67, "rawHeight": 53,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "14283191-0c41-4880-988d-296cf6e2fa66",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 244,
"height": 157,
"platformSettings": {},
"subMetas": {
"bg_card": {
"ver": "1.0.4",
"uuid": "21e451e5-006e-47a2-858d-137bd5c93e05",
"rawTextureUuid": "14283191-0c41-4880-988d-296cf6e2fa66",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 244,
"height": 157,
"rawWidth": 244,
"rawHeight": 157,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "705b9dbb-f334-4b06-a184-6cc5bba89e01",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 244,
"height": 157,
"platformSettings": {},
"subMetas": {
"bg_card_selected": {
"ver": "1.0.4",
"uuid": "c58e76ff-7a00-422e-a7ac-85598ae856ef",
"rawTextureUuid": "705b9dbb-f334-4b06-a184-6cc5bba89e01",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 244,
"height": 157,
"rawWidth": 244,
"rawHeight": 157,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "e1b4d971-9876-4832-803a-5a321964a78b", "uuid": "97599a18-5d6e-42b7-8b13-4c8016505ea0",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
"height": 720, "height": 720,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg": { "bg_main": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "8288e3d4-4c75-4b27-8f01-f7014417f4dd", "uuid": "12f025e1-948d-4457-ab20-7e40c754e9df",
"rawTextureUuid": "e1b4d971-9876-4832-803a-5a321964a78b", "rawTextureUuid": "97599a18-5d6e-42b7-8b13-4c8016505ea0",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
......
{
"ver": "2.3.5",
"uuid": "d1ce54c5-6cf2-4e3a-9453-853ff1820663",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1248,
"height": 136,
"platformSettings": {},
"subMetas": {
"bg_shuicao": {
"ver": "1.0.4",
"uuid": "a11a2983-2743-4300-9768-582c5a968e81",
"rawTextureUuid": "d1ce54c5-6cf2-4e3a-9453-853ff1820663",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1248,
"height": 136,
"rawWidth": 1248,
"rawHeight": 136,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "9ca4e628-dff4-47b4-ac8e-097dac9b04fd",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1280,
"height": 392,
"platformSettings": {},
"subMetas": {
"bg_snow": {
"ver": "1.0.4",
"uuid": "019c8b37-02d9-4ec3-a51e-78384eab2ca9",
"rawTextureUuid": "9ca4e628-dff4-47b4-ac8e-097dac9b04fd",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1280,
"height": 392,
"rawWidth": 1280,
"rawHeight": 392,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f3ed1875-e025-4e91-b97d-f859167136cb",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 424,
"height": 50,
"platformSettings": {},
"subMetas": {
"bg_title": {
"ver": "1.0.4",
"uuid": "9ec690bb-81d4-4453-96ca-1e54786c20bc",
"rawTextureUuid": "f3ed1875-e025-4e91-b97d-f859167136cb",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 211.5,
"offsetY": -24.5,
"trimX": 423,
"trimY": 49,
"width": 1,
"height": 1,
"rawWidth": 424,
"rawHeight": 50,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "5ef6135d-2395-4377-b3d5-549b3d458bee",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 100,
"height": 100,
"platformSettings": {},
"subMetas": {
"black": {
"ver": "1.0.4",
"uuid": "7a2d99d6-2009-4341-83f8-f18980e6405d",
"rawTextureUuid": "5ef6135d-2395-4377-b3d5-549b3d458bee",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 100,
"height": 100,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "ede447b3-6e36-4d05-906a-252bfc7c67f9",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 220,
"height": 110,
"platformSettings": {},
"subMetas": {
"card_demo": {
"ver": "1.0.4",
"uuid": "8141731d-96d5-420e-a2f2-694409faf1c5",
"rawTextureUuid": "ede447b3-6e36-4d05-906a-252bfc7c67f9",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 220,
"height": 110,
"rawWidth": 220,
"rawHeight": 110,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 144,
"height": 144,
"platformSettings": {},
"subMetas": {
"icon": {
"ver": "1.0.4",
"uuid": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a",
"rawTextureUuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 3,
"trimY": 2,
"width": 138,
"height": 141,
"rawWidth": 144,
"rawHeight": 144,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "bec60727-95aa-416b-be9e-b83d70117ccc",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 220,
"height": 110,
"platformSettings": {},
"subMetas": {
"image_content": {
"ver": "1.0.4",
"uuid": "0d1e523a-103f-4948-bc46-4b7c3b267fad",
"rawTextureUuid": "bec60727-95aa-416b-be9e-b83d70117ccc",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 109.5,
"offsetY": -54.5,
"trimX": 219,
"trimY": 109,
"width": 1,
"height": 1,
"rawWidth": 220,
"rawHeight": 110,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "fff9e44a-70e2-405a-9bd7-cb652324535a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1277,
"height": 12,
"platformSettings": {},
"subMetas": {
"shengzi": {
"ver": "1.0.4",
"uuid": "635fed24-4028-46b9-90b7-4f9e1361d4c2",
"rawTextureUuid": "fff9e44a-70e2-405a-9bd7-cb652324535a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1277,
"height": 12,
"rawWidth": 1277,
"rawHeight": 12,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f6eb13db-a0bf-4f1e-99a0-a006850c5ace",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 770,
"height": 720,
"platformSettings": {},
"subMetas": {
"tree_1": {
"ver": "1.0.4",
"uuid": "e781dc23-f1ea-4209-ac32-64c4a865ad57",
"rawTextureUuid": "f6eb13db-a0bf-4f1e-99a0-a006850c5ace",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 770,
"height": 720,
"rawWidth": 770,
"rawHeight": 720,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "6b028ca4-62ce-4c24-9819-b28668671479",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 52,
"height": 658,
"platformSettings": {},
"subMetas": {
"tree_2": {
"ver": "1.0.4",
"uuid": "97485371-52fc-4433-818d-1e9f518feabd",
"rawTextureUuid": "6b028ca4-62ce-4c24-9819-b28668671479",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 52,
"height": 658,
"rawWidth": 52,
"rawHeight": 658,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "9a79969a-0506-48d4-bc98-3c05d109b027", "uuid": "423c4318-e496-4936-b0d8-754933ce8da3",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 61, "width": 61,
"height": 67, "height": 645,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_left": { "tree_3": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5", "uuid": "a6e9ccc0-bf1b-4584-ac37-93ef9cb07890",
"rawTextureUuid": "9a79969a-0506-48d4-bc98-3c05d109b027", "rawTextureUuid": "423c4318-e496-4936-b0d8-754933ce8da3",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 61, "width": 61,
"height": 67, "height": 645,
"rawWidth": 61, "rawWidth": 61,
"rawHeight": 67, "rawHeight": 645,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
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