Commit f3a88573 authored by limingzhe's avatar limingzhe

fix: debug

parent a3f5ba9f
No preview for this file type
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
cocos creator技术框架下的H5互动模板框架脚手架,基于cocos creator实现快速开发基于绘玩云的H5互动课件。 cocos creator技术框架下的H5互动模板框架脚手架,基于cocos creator实现快速开发基于绘玩云的H5互动课件。
[视频教程传送门](https://www.bilibili.com/video/BV1Dq4y1t7n5/)
# 使用简介 # 使用简介
## 前期准备 ## 前期准备
...@@ -51,30 +49,29 @@ npm start ...@@ -51,30 +49,29 @@ npm start
``` ```
* 打开浏览器:http://staging-teach.ireadabc.com/template_ci/debug * 打开浏览器:http://staging-teach.ireadabc.com/template_ci/debug
* [点击查看调试视频教程](https://www.bilibili.com/video/BV1Dq4y1t7n5?p=8) * 点击右上角齿轮,选择技术选型、调试模式选择“普通”
### 真机调试
* 下载模板调试专用app
安卓下载: ### 互动模板
http://download-iplayabc.oss-cn-beijing.aliyuncs.com/iDebugABC.apk
![avatar](http://staging-teach.cdn.ireadabc.com/084f2f95-8213-4c5a-8c46-b194819d7677.png)
* 找到项目根路径下 index.html 文件
* 在引入JS的位置将air.js改为air_online_open.js
* 启动本地服务
iOS下载: ```
npm start
```
由于调试APP没有上架App Store 所以需要先获取手机的UDID 发送给我们的技术支持,加入后才可以扫码下载安装 * 打开浏览器:http://staging-teach.ireadabc.com/template_ci/debug
获取UDID:https://www.pgyer.com/tools/udid * 点击右上角齿轮,选择技术选型、调试模式选择“互动”
下载iOS: https://www.pgyer.com/gS0X * 左侧老师、右侧学生
### 真机调试
有时可能需要反复调试一些功能性的问题,与原生APP相关或者手上临时没有设备,我们提供了一个网页版的调试方式 * 下载模板调试专用app
http://staging-openapi.iteachabc.com/api/courseware/v1/middle/debug http://download-iplayabc.oss-cn-beijing.aliyuncs.com/iDebugABC.apk
![avatar](http://staging-teach.cdn.ireadabc.com/084f2f95-8213-4c5a-8c46-b194819d7677.png)
* 启动本地服务 * 启动本地服务
...@@ -84,12 +81,4 @@ npm start ...@@ -84,12 +81,4 @@ npm start
* 手机和电脑连接同一个Wifi * 手机和电脑连接同一个Wifi
* 打开调试app,根据提示输入IP地址,点击开始就可以在手机上预览模板了 * 打开调试app,根据提示输入IP地址,点击开始就可以在手机上预览模板了
* 使用 console.log("==调试信息=="); 可以打印日志进行必要的调试 * 使用 this.log("==调试信息=="); 可以打印日志进行必要的调试
* 点击左上角 “logcat” 可以查看运行日志,(logcat是可以按住拖动的, 所以不用考虑UI遮挡问题) \ No newline at end of file
### 注意事项及常见问题
* 项目里所有文件及文件夹的命名方式要注意不能包含空格、汉字、减号
* 开发者新建的脚本文件(.js/.ts)的文件名必须包含项目名称,例如在 test_01 项目中添加一个脚本文件(如想命名为 hello.ts );则需要命名为 hello_test_01.ts
* 项目里尽量不要使用setTimeout、setInterval等定时器,如果使用了记得在onDestroy中释放掉(onDestroy 是指CocosCreator的生命周期钩子)
* 理论上禁止使用全局变量,因为模板到线上会进行组装,常见问题是一个模板使用多次造成全局变量被读脏
This diff is collapsed.
import { asyncDelay, onHomeworkFinish } from "../script/util";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
const { ccclass, property } = cc._decorator;
@ccclass
export default class SceneComponent extends MyCocosSceneComponent {
addPreloadImage() {
// TODO 根据自己的配置预加载图片资源
this._imageResList.push({ url: this.data.pic_url });
this._imageResList.push({ url: this.data.pic_url_2 });
}
addPreloadAudio() {
// TODO 根据自己的配置预加载音频资源
this._audioResList.push({ url: this.data.audio_url });
}
addPreloadAnima() {
}
async onLoadEnd() {
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this.initData();
this.initView();
this.initListener();
}
_cantouch = null;
initData() {
// 所有全局变量 默认都是null
this._cantouch = true;
}
initView() {
this.initBg();
this.initPic();
this.initBtn();
this.initIcon();
}
initBg() {
const bgNode = cc.find('Canvas/bg');
bgNode.scale = this._mapScaleMax;
}
pic1 = null;
pic2 = null;
initPic() {
const canvas = cc.find('Canvas');
const maxW = canvas.width * 0.7;
this.getSprNodeByUrl(this.data.pic_url, (sprNode) => {
const picNode1 = sprNode;
picNode1.scale = maxW / picNode1.width;
picNode1.baseX = picNode1.x;
canvas.addChild(picNode1);
this.pic1 = picNode1;
const labelNode = new cc.Node();
labelNode.color = cc.Color.YELLOW;
const label = labelNode.addComponent(cc.Label);
label.string = this.data.text;
label.fontSize = 60;
label.lineHeight = 60;
label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent('cc.Label').font;
picNode1.addChild(labelNode);
});
this.getSprNodeByUrl(this.data.pic_url_2, (sprNode) => {
const picNode2 = sprNode;
picNode2.scale = maxW / picNode2.width;
canvas.addChild(picNode2);
picNode2.x = canvas.width;
picNode2.baseX = picNode2.x;
this.pic2 = picNode2;
const labelNode = new cc.Node();
const label = labelNode.addComponent(cc.RichText);
const size = 60
label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent(cc.Label).font;
label.string = `<outline color=#751e00 width=4><size=${size}><color=#ffffff>${this.data.text}</color></size></outline>`
label.lineHeight = size;
picNode2.addChild(labelNode);
});
}
initIcon() {
const iconNode = this.getSprNode('icon');
iconNode.zIndex = 5;
iconNode.anchorX = 1;
iconNode.anchorY = 1;
iconNode.parent = cc.find('Canvas');
iconNode.x = iconNode.parent.width / 2 - 10;
iconNode.y = iconNode.parent.height / 2 - 10;
iconNode.on(cc.Node.EventType.TOUCH_START, () => {
this.playAudioByUrl(this.data.audio_url);
})
}
curPage = null;
initBtn() {
this.curPage = 0;
const bottomPart = cc.find('Canvas/bottomPart');
bottomPart.zIndex = 5; // 提高层级
bottomPart.x = bottomPart.parent.width / 2;
bottomPart.y = -bottomPart.parent.height / 2;
const leftBtnNode = bottomPart.getChildByName('btn_left');
//节点中添加了button组件 则可以添加click事件监听
leftBtnNode.on('click', () => {
if (!this._cantouch) {
return;
}
if (this.curPage == 0) {
return;
}
this.curPage = 0
this.leftMove();
this.playLocalAudio('btn');
})
const rightBtnNode = bottomPart.getChildByName('btn_right');
//节点中添加了button组件 则可以添加click事件监听
rightBtnNode.on('click', () => {
if (!this._cantouch) {
return;
}
if (this.curPage == 1) {
return;
}
this.curPage = 1
this.rightMove();
// 游戏结束时需要调用这个方法通知系统作业完成
onHomeworkFinish();
this.playLocalAudio('btn');
})
}
leftMove() {
this._cantouch = false;
const len = this.pic1.parent.width;
cc.tween(this.pic1)
.to(1, { x: this.pic1.baseX }, { easing: 'cubicInOut' })
.start();
cc.tween(this.pic2)
.to(1, { x: this.pic2.baseX }, { easing: 'cubicInOut' })
.call(() => {
this._cantouch = true;
})
.start();
}
rightMove() {
this._cantouch = false;
const len = this.pic1.parent.width;
cc.tween(this.pic1)
.to(1, { x: this.pic1.baseX - len }, { easing: 'cubicInOut' })
.start();
cc.tween(this.pic2)
.to(1, { x: this.pic2.baseX - len }, { easing: 'cubicInOut' })
.call(() => {
this._cantouch = true;
})
.start();
}
// update (dt) {},
initListener() {
}
playLocalAudio(audioName) {
const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => {
const id = cc.audioEngine.playEffect(audio.clip, false);
cc.audioEngine.setFinishCallback(id, () => {
resolve(id);
});
})
}
}
import { defaultData } from "../script/defaultData";
export class MyCocosSceneComponent extends cc.Component {
// 生命周期 onLoad
onLoad() {
this.initSceneData();
this.initSize();
}
_imageResList = null;
_audioResList = null;
_animaResList = null;
initSceneData() {
this._imageResList = [];
this._audioResList = [];
this._animaResList = [];
}
_designSize = null; // 设计分辨率
_frameSize = null; // 屏幕分辨率
_mapScaleMin = null; // 场景中常用缩放(取大值)
_mapScaleMax = null; // 场景中常用缩放(取小值)
_cocosScale = null; // cocos 自缩放 (较少用到)
initSize() {
// 注意cc.winSize只有在适配后(修改fitHeight/fitWidth后)才能获取到正确的值,因此使用cc.getFrameSize()来获取初始的屏幕大小
let screen_size = cc.view.getFrameSize().width / cc.view.getFrameSize().height
let design_size = cc.Canvas.instance.designResolution.width / cc.Canvas.instance.designResolution.height
let f = screen_size >= design_size
cc.Canvas.instance.fitHeight = f
cc.Canvas.instance.fitWidth = !f
const frameSize = cc.view.getFrameSize();
this._frameSize = frameSize;
this._designSize = cc.view.getDesignResolutionSize();
let sx = cc.winSize.width / frameSize.width;
let sy = cc.winSize.height / frameSize.height;
this._cocosScale = Math.min(sx, sy);
sx = frameSize.width / this._designSize.width;
sy = frameSize.height / this._designSize.height;
this._mapScaleMin = Math.min(sx, sy) * this._cocosScale;
this._mapScaleMax = Math.max(sx, sy) * this._cocosScale;
cc.director['_scene'].width = frameSize.width;
cc.director['_scene'].height = frameSize.height;
}
data = null;
// 生命周期 start
start() {
if (window && (<any>window).courseware && (<any>window).courseware.getData) {
(<any>window).courseware.getData((data) => {
this.log('data:' + data);
this.data = data || this.getDefaultData();
this.data = JSON.parse(JSON.stringify(this.data));
this.preloadItem();
})
} else {
this.data = this.getDefaultData();
this.preloadItem();
}
}
getDefaultData() {
return defaultData;
}
preloadItem() {
this.addPreloadImage();
this.addPreloadAudio();
this.addPreloadAnima();
this.preload();
}
addPreloadImage() {
}
addPreloadAudio() {
}
addPreloadAnima() {
}
preload() {
const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList);
cc.assetManager.preloadAny(preloadArr, null, null, async (err, data) => {
if (window && window["air"]) {
// window["air"].onCourseInScreen = (next) => {
// window["air"].isCourseInScreen = true;
// this.onLoadEnd();
// next();
// };
await this.onLoadEnd();
window["air"].hideAirClassLoading();
} else {
await this.onLoadEnd();
}
cc.debug.setDisplayStats(false);
});
}
log (str) {
const node = cc.find('middleLayer');
if(node){
node.getComponent('middleLayer').log(str);
}else{
console.log(str);
}
}
async onLoadEnd() {
}
// ------------------------------------------------
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;
}
getSpriteFrimeByUrl(url, cb) {
cc.loader.load({ url }, (err, img) => {
const spriteFrame = new cc.SpriteFrame(img)
if (cb) {
cb(spriteFrame);
}
})
}
getSprNodeByUrl(url, cb) {
const node = new cc.Node();
const spr = node.addComponent(cc.Sprite);
this.getSpriteFrimeByUrl(url, (sf) => {
spr.spriteFrame = sf;
if (cb) {
cb(node);
}
})
}
playAudioByUrl(audio_url, cb = null) {
if (audio_url) {
cc.assetManager.loadRemote(audio_url, (err, audioClip) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8);
if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => {
cb();
});
}
});
}else{
cb && cb();
}
}
}
\ No newline at end of file
export const defaultData = {
"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"
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.1.2",
"uuid": "8ba21262-178f-4fa5-afc9-2c1dd50ba3ab",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541", "uuid": "5d9f5492-2aa4-4fe0-aa10-687f7c43d3c1",
"isBundle": false, "isBundle": true,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
"compressionType": {}, "compressionType": {},
"optimizeHotUpdate": {}, "optimizeHotUpdate": {},
"inlineSpriteFrames": {}, "inlineSpriteFrames": {},
"isRemoteBundle": { "isRemoteBundle": {
"ios": false, "ios": true,
"android": false "android": true
}, },
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "cb9fa4ea-66ca-45af-ad31-e445c7b0ef32", "uuid": "9e5d8a4b-66e7-47fb-8946-eac98db3384a",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
{
"ver": "1.1.2",
"uuid": "b541b041-9f10-4048-bc93-94dd79af3463",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{"name":"pageturn","version":"5.5","frameRate":24,"armature":[{"name":"Armature","animation":[{"name":"pageturn","frame":[],"ik":[],"duration":34,"slot":[{"name":"外圈","displayFrame":[],"colorFrame":[{"duration":14},{"tweenEasing":0,"duration":4},{"tweenEasing":0,"duration":12,"color":{"aM":52}},{"tweenEasing":0,"duration":4,"color":{"aM":0}},{"duration":0,"color":{"aM":0}}]},{"name":"星2","displayFrame":[],"colorFrame":[{"duration":14},{"tweenEasing":0,"duration":6},{"tweenEasing":0,"duration":14,"color":{"aM":62}},{"duration":0,"color":{"aM":0}}]},{"name":"三角","displayFrame":[],"colorFrame":[{"duration":16},{"tweenEasing":0,"duration":18},{"duration":0,"color":{"aM":0}}]},{"name":"星1","displayFrame":[],"colorFrame":[{"duration":14},{"tweenEasing":0,"duration":20},{"duration":0,"color":{"aM":0}}]},{"name":"中间","displayFrame":[],"colorFrame":[{"duration":22},{"tweenEasing":0,"duration":12},{"duration":0,"color":{"aM":0}}]},{"name":"光","displayFrame":[{"duration":10,"value":-1},{"duration":24}],"colorFrame":[{"duration":10},{"tweenEasing":0,"duration":16,"color":{"aM":0}},{"tweenEasing":0,"duration":4,"color":{"aM":0}},{"tweenEasing":0,"duration":4},{"duration":0}]}],"bone":[{"name":"root","rotateFrame":[],"scaleFrame":[],"translateFrame":[]},{"name":"中间","rotateFrame":[{"tweenEasing":0,"rotate":-58.1972,"duration":10},{"duration":24}],"scaleFrame":[{"duration":10},{"duration":12,"tweenEasing":0},{"duration":6,"tweenEasing":0},{"duration":6,"x":1.3,"tweenEasing":0,"y":1.3},{"duration":0}],"translateFrame":[{"duration":5,"curve":[0,0,0.5,1],"y":300},{"duration":5,"tweenEasing":0,"y":-40},{"duration":24}]},{"name":"星1","rotateFrame":[{"tweenEasing":0,"rotate":30.7638,"duration":10},{"duration":24}],"scaleFrame":[{"duration":10},{"duration":4,"tweenEasing":0},{"duration":6},{"duration":14,"x":1.2,"tweenEasing":0,"y":1.2},{"duration":0,"x":0.5,"y":0.5}],"translateFrame":[{"duration":5,"tweenEasing":0,"y":300},{"duration":5,"tweenEasing":0,"y":-40},{"duration":24}]},{"name":"三角","rotateFrame":[{"tweenEasing":0,"rotate":18.9253,"duration":10},{"duration":24}],"scaleFrame":[{"duration":10},{"duration":24,"tweenEasing":0},{"duration":0}],"translateFrame":[{"duration":5,"tweenEasing":0,"y":300},{"duration":5,"tweenEasing":0,"y":40},{"duration":24}]},{"name":"星2","rotateFrame":[{"tweenEasing":0,"rotate":-40.7489,"duration":10},{"duration":24}],"scaleFrame":[{"duration":10},{"duration":4,"tweenEasing":0},{"duration":6,"tweenEasing":0},{"duration":14,"x":1.2,"tweenEasing":0,"y":1.2},{"duration":0,"x":0.5,"y":0.5}],"translateFrame":[{"duration":5,"tweenEasing":0,"y":300},{"duration":5,"tweenEasing":0,"y":-40},{"duration":24}]},{"name":"外圈","rotateFrame":[{"tweenEasing":0,"rotate":84.1193,"duration":10},{"duration":24}],"scaleFrame":[{"duration":10},{"duration":4},{"duration":4,"tweenEasing":0},{"duration":12,"x":1.2,"tweenEasing":0,"y":1.2},{"duration":4,"x":0.55,"tweenEasing":0,"y":0.55},{"duration":0,"x":0.55,"y":0.55}],"translateFrame":[{"duration":5,"tweenEasing":0,"y":300},{"duration":5,"tweenEasing":0,"y":-40},{"duration":24}]},{"name":"光","rotateFrame":[],"scaleFrame":[{"duration":10},{"duration":16,"x":0.2,"tweenEasing":0,"y":0.2},{"duration":8,"x":0.2,"tweenEasing":0,"y":0.2},{"duration":0,"x":2.42,"y":1.34}],"translateFrame":[]}],"playTimes":0,"ffd":[]},{"name":"pageturn2","frame":[],"ik":[],"duration":12,"slot":[{"name":"外圈","displayFrame":[{"duration":12,"value":-1}],"colorFrame":[]},{"name":"星2","displayFrame":[{"duration":12,"value":-1}],"colorFrame":[]},{"name":"三角","displayFrame":[{"duration":12,"value":-1}],"colorFrame":[]},{"name":"星1","displayFrame":[{"duration":12,"value":-1}],"colorFrame":[]},{"name":"中间","displayFrame":[{"duration":12,"value":-1}],"colorFrame":[]},{"name":"光","displayFrame":[],"colorFrame":[{"tweenEasing":0,"duration":12},{"duration":0,"color":{"aM":0}}]}],"bone":[{"name":"root","rotateFrame":[],"scaleFrame":[],"translateFrame":[]},{"name":"中间","rotateFrame":[],"scaleFrame":[],"translateFrame":[]},{"name":"星1","rotateFrame":[],"scaleFrame":[],"translateFrame":[]},{"name":"三角","rotateFrame":[],"scaleFrame":[],"translateFrame":[]},{"name":"星2","rotateFrame":[],"scaleFrame":[],"translateFrame":[]},{"name":"外圈","rotateFrame":[],"scaleFrame":[],"translateFrame":[]},{"name":"光","rotateFrame":[],"scaleFrame":[{"duration":12,"x":2.42,"y":1.34}],"translateFrame":[]}],"playTimes":0,"ffd":[]}],"slot":[{"name":"光","color":{},"parent":"光"},{"name":"外圈","color":{},"z":1,"parent":"外圈"},{"name":"星2","color":{},"z":2,"parent":"星2"},{"name":"三角","color":{},"z":3,"parent":"三角"},{"name":"星1","color":{},"z":4,"parent":"星1"},{"name":"中间","color":{},"z":5,"parent":"中间"}],"ik":[],"skin":[{"name":"","slot":[{"name":"三角","display":[{"name":"魔法阵/三角","transform":{},"type":"image","path":"魔法阵/三角"}]},{"name":"星2","display":[{"name":"魔法阵/星2","transform":{},"type":"image","path":"魔法阵/星2"}]},{"name":"外圈","display":[{"name":"魔法阵/外圈","transform":{},"type":"image","path":"魔法阵/外圈"}]},{"name":"光","display":[{"name":"魔法阵/光","transform":{},"type":"image","path":"魔法阵/光"}]},{"name":"中间","display":[{"name":"魔法阵/中间","transform":{},"type":"image","path":"魔法阵/中间"}]},{"name":"星1","display":[{"name":"魔法阵/星1","transform":{},"type":"image","path":"魔法阵/星1"}]}]}],"defaultActions":[{"gotoAndPlay":"pageturn"}],"frameRate":24,"bone":[{"name":"root","transform":{}},{"name":"中间","transform":{},"parent":"root"},{"name":"星1","transform":{},"parent":"root"},{"name":"三角","transform":{},"parent":"root"},{"name":"星2","transform":{},"parent":"root"},{"name":"外圈","transform":{},"parent":"root"},{"name":"光","transform":{},"parent":"root"}],"type":"Armature","aabb":{"x":-527,"height":1054,"y":-527,"width":1054}}],"isGlobal":0}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "808ceb38-e666-465d-b370-9382a0d86e3a",
"subMetas": {}
}
\ No newline at end of file
{"name":"pageturn","imagePath":"pageturn_tex.png","height":2048,"SubTexture":[{"name":"魔法阵/光","x":1,"height":1054,"y":1,"width":1054},{"name":"魔法阵/外圈","x":1,"height":519,"y":1057,"width":519},{"name":"魔法阵/星2","x":1,"height":424,"y":1578,"width":424},{"name":"魔法阵/三角","x":427,"height":409,"y":1578,"width":405},{"name":"魔法阵/星1","x":834,"height":322,"y":1578,"width":322},{"name":"魔法阵/中间","x":1158,"height":229,"y":1578,"width":229}],"width":2048}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "9e821f08-01c8-4038-a027-41d0cb2b1d07",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f45e771f-e0aa-480b-b1d5-4f737fc90d52",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2048,
"height": 2048,
"platformSettings": {},
"subMetas": {
"pageturn_tex": {
"ver": "1.0.4",
"uuid": "5bf03537-6547-4a7d-b0c4-fa437fcd47d3",
"rawTextureUuid": "f45e771f-e0aa-480b-b1d5-4f737fc90d52",
"trimType": "custom",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 2048,
"height": 2048,
"rawWidth": 2048,
"rawHeight": 2048,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "87354d45-fb59-41de-8fd2-95f26991b038",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"__type__": "cc.AnimationClip",
"_name": "record",
"_objFlags": 0,
"_native": "",
"_duration": 0.18333333333333332,
"sample": 60,
"speed": 0.8,
"wrapMode": 2,
"curveData": {
"props": {
"opacity": []
},
"comps": {
"cc.Sprite": {
"spriteFrame": [
{
"frame": 0,
"value": {
"__uuid__": "3c89258e-8327-4755-a464-2d3ea890ad6c"
}
},
{
"frame": 0.08333333333333333,
"value": {
"__uuid__": "6475cb32-551f-49e7-84f4-123d0d08e728"
}
},
{
"frame": 0.16666666666666666,
"value": {
"__uuid__": "3c89258e-8327-4755-a464-2d3ea890ad6c"
}
}
]
}
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "10879caf-913f-406b-b0e2-45b9b41bfabb",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "165b2891-4c74-4e74-aff4-172a5c73a85f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 41,
"height": 36,
"platformSettings": {},
"subMetas": {
"record_1": {
"ver": "1.0.4",
"uuid": "3c89258e-8327-4755-a464-2d3ea890ad6c",
"rawTextureUuid": "165b2891-4c74-4e74-aff4-172a5c73a85f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 41,
"height": 36,
"rawWidth": 41,
"rawHeight": 36,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f", "uuid": "b701ac8c-3013-4e39-a63c-d1ddb09203c5",
"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": 41,
"height": 336, "height": 36,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"1orange": { "record_2": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "43d1e79d-6de8-4dcb-b8ce-d767df7913aa", "uuid": "6475cb32-551f-49e7-84f4-123d0d08e728",
"rawTextureUuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f", "rawTextureUuid": "b701ac8c-3013-4e39-a63c-d1ddb09203c5",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": -0.5, "offsetY": -0.5,
"trimX": 0, "trimX": 0,
"trimY": 1, "trimY": 1,
"width": 366, "width": 41,
"height": 335, "height": 35,
"rawWidth": 366, "rawWidth": 41,
"rawHeight": 336, "rawHeight": 36,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "1.1.2",
"uuid": "ed133b64-69db-4d67-8863-dee1075849ba",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "f0680ae0-c079-45ef-abd7-9e63d90b982b", "uuid": "3903b9aa-3741-4ff1-8acf-ba9784f6f672",
"downloadMode": 0, "downloadMode": 0,
"duration": 0.130612, "duration": 0.972,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "aecce431-69a7-454c-b468-dbfbd388843d",
"downloadMode": 0,
"duration": 1.188,
"subMetas": {}
}
\ No newline at end of file
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "0853721c-3f55-4eb2-873d-e3081cfadd4b", "uuid": "32b016dc-c9da-4fdc-a098-9608e93a6831",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
{
"ver": "1.1.2",
"uuid": "a97b702d-19d6-4c1f-8f07-5f51dbf2beb4",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "3b762855-a2f2-4947-a9a8-5fbefe3c5806",
"subMetas": {}
}
\ No newline at end of file
{"name":"mao","imagePath":"mao_tex.png","SubTexture":[{"name":"猫01/影子","x":1,"height":66,"y":343,"width":337},{"name":"猫01/尾巴","x":1,"height":109,"y":188,"width":175},{"name":"猫01/右腿","x":178,"height":117,"y":188,"width":104},{"name":"猫01/左腿","x":1,"height":115,"y":569,"width":64},{"name":"猫01/右手","x":427,"height":122,"y":590,"width":69},{"name":"猫01/左手","x":301,"height":74,"y":590,"width":124},{"name":"猫01伸/左手伸直","x":299,"height":169,"y":1,"width":168},{"name":"猫01伸/右手伸直","x":299,"height":169,"y":172,"width":168},{"name":"猫01/身体","x":340,"height":180,"y":343,"width":122},{"name":"猫01/领带","x":1,"height":156,"y":411,"width":120},{"name":"猫01/右耳","x":155,"height":76,"y":602,"width":90},{"name":"猫01/左耳","x":67,"height":85,"y":602,"width":86},{"name":"猫01/组_1","x":1,"height":185,"y":1,"width":296},{"name":"猫01/右眼","x":247,"height":60,"y":666,"width":59},{"name":"猫01/右眉毛","x":67,"height":5,"y":595,"width":33},{"name":"猫01/左眼","x":1,"height":60,"y":686,"width":59},{"name":"猫01/左眉毛","x":247,"height":12,"y":602,"width":31},{"name":"猫01/眼镜","x":301,"height":63,"y":525,"width":170},{"name":"猫01/胡子","x":123,"height":85,"y":515,"width":176},{"name":"猫01/鼻子","x":67,"height":24,"y":569,"width":28},{"name":"猫01/嘴","x":1,"height":30,"y":299,"width":65},{"name":"猫01/帽子","x":123,"height":102,"y":411,"width":158}],"height":1024,"width":512}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "13437f14-c456-4c90-8a52-0b3de4838632",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "6cb0a3b3-48aa-42a7-a692-58c5a5f6c46c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 512,
"height": 1024,
"platformSettings": {},
"subMetas": {
"mao_tex": {
"ver": "1.0.4",
"uuid": "c36b1fcb-9a9c-422b-9910-e6f6688a8b12",
"rawTextureUuid": "6cb0a3b3-48aa-42a7-a692-58c5a5f6c46c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -7.5,
"offsetY": 138.5,
"trimX": 1,
"trimY": 1,
"width": 495,
"height": 745,
"rawWidth": 512,
"rawHeight": 1024,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "20185448-a1ca-4de2-8b37-7bf6cdfccbae", "uuid": "04777956-98eb-4f32-98e1-bd3c4e13866e",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
{ {
"ver": "1.1.0", "ver": "1.1.0",
"uuid": "c551970e-b095-45f3-9f1d-25cde8b8deb1", "uuid": "5696c8f6-492d-4454-84c4-bdfcb8421351",
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "24d1940d-ff6d-4103-a261-dfa2cacede28",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "e95dc800-c1eb-466d-9ce9-4bf74e6ae789",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "a7ea22f1-9c5c-477f-9c3e-70913d5736f6",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "7dd30286-0436-45a8-8871-e8dc1a6049cc",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "ffcb2a1d-692f-4f38-b689-ef1ecf3013ba",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "catFrame",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 5
}
],
"_active": true,
"_components": [
{
"__id__": 8
}
],
"_prefab": {
"__id__": 9
},
"_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": [
-3.3500000000000227,
-0.7280000000000086,
0,
0,
0,
0,
1,
0.5,
0.5,
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": "cat",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 362.6105263157899,
"height": 483.5647539622176
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-116.562,
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__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "Armature",
"_animationName": "",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": 1,
"premultipliedAlpha": false,
"_armatureKey": "3b762855-a2f2-4947-a9a8-5fbefe3c5806#13437f14-c456-4c90-8a52-0b3de4838632",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "3b762855-a2f2-4947-a9a8-5fbefe3c5806"
},
"_N$dragonAtlasAsset": {
"__uuid__": "13437f14-c456-4c90-8a52-0b3de4838632"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "f74Xci8e9HxrkjeeIIwapj",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "clickBox",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
}
],
"_prefab": {
"__id__": 7
},
"_opacity": 0,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 400,
"height": 500
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
889.612,
-619.253,
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.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "7drQoUHTdFtKEZxfog45jx",
"sync": false
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 36,
"_left": 0,
"_right": 518.6,
"_top": 0,
"_bottom": 244.522,
"_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": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.2.9",
"uuid": "ea28cff3-dfd0-4530-88a3-78b31158260e",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "d2f39be1-9b32-478b-b8b2-60c1bb88f22c",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
// Learn cc.Class:
// - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// // ATTRIBUTES:
// default: null, // The default value will be used only when the component attaching
// // to a node for the first time
// type: cc.SpriteFrame, // optional, default is typeof default
// serializable: true, // optional, default is true
// },
// bar: {
// type: cc.Node,
// get () {
// return this._bar;
// },
// set (value) {
// this._bar = value;
// }
// },
},
// LIFE-CYCLE CALLBACKS:
// onLoad () {},
start () {
this.init();
},
barBaseW: null,
barSpr: null,
barSf: null,
init() {
this.bar = cc.find('bar', this.node);
this.barBaseW = this.bar.width;
this.barSpr = this.bar.getComponent(cc.Sprite);
this.barSf = this.barSpr.spriteFrame;
this.setProgress(0);
},
setProgress(progress) {
setTimeout(() => {
if (!this.barSf) {
return;
}
const w = this.barBaseW * progress;
const rect = this.barSf.getRect();
rect.width = w;
this.bar.width = w;
this.barSpr.spriteFrame.setRect(rect);
}, 1);
},
// update (dt) {},
});
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "f8b451ff-857c-4ca8-9870-866bc5154a29", "uuid": "a9915c00-b46d-481b-a4be-9cdb9b1d3045",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
{
"ver": "1.1.2",
"uuid": "6a96b5df-f9c0-4ef3-931b-782782138dac",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "344dc346-7299-44ae-8693-0ac57ec21aca",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 269,
"height": 16,
"platformSettings": {},
"subMetas": {
"record_progress_bar": {
"ver": "1.0.4",
"uuid": "c43f093f-a7c5-42d5-bf56-778a3548a7c3",
"rawTextureUuid": "344dc346-7299-44ae-8693-0ac57ec21aca",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 269,
"height": 16,
"rawWidth": 269,
"rawHeight": 16,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "cb4c174a-628f-41b0-b661-f98961162196",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 269,
"height": 16,
"platformSettings": {},
"subMetas": {
"record_progress_bg": {
"ver": "1.0.4",
"uuid": "82ee3fa0-26e3-43e8-afca-8bbc978d88e4",
"rawTextureUuid": "cb4c174a-628f-41b0-b661-f98961162196",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 269,
"height": 16,
"rawWidth": 269,
"rawHeight": 16,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "e8bd16b0-3804-45a9-a8ca-f52c02224f55", "uuid": "f9ff87df-13c3-4529-838a-93336988cede",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
This diff is collapsed.
{ {
"ver": "1.2.9", "ver": "1.2.9",
"uuid": "0737ce42-24f0-45c6-8e1a-8bdab4f74ba3", "uuid": "718b4079-d0e4-4b86-a831-e1c06381ae65",
"asyncLoadAssets": false, "asyncLoadAssets": false,
"autoReleaseAssets": true, "autoReleaseAssets": false,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
This diff is collapsed.
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "c41b0e51-55d7-443c-af3a-b22c3dd9b9e5", "uuid": "4d0a8476-7857-44d8-9374-79ae364c2f74",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "b0c008bc-cf92-463b-8360-0984e13c2e4d", "uuid": "0bdf31a9-a3f4-41ec-aa7c-f93ebd2f6505",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
cc.macro.ENABLE_TRANSPARENT_CANVAS = true;
\ No newline at end of file
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "ade7af40-d56d-4087-bbc6-2888fef55353", "uuid": "e7780569-85d9-4616-9503-9716baa443d9",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "408a67f8-65fa-4cf1-8cf2-83e20e1a0fd5", "uuid": "25ccf041-bdf3-4b6a-8683-c24e4c39fed4",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
// Learn cc.Class:
// - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// // ATTRIBUTES:
// default: null, // The default value will be used only when the component attaching
// // to a node for the first time
// type: cc.SpriteFrame, // optional, default is typeof default
// serializable: true, // optional, default is true
// },
// bar: {
// get () {
// return this._bar;
// },
// set (value) {
// this._bar = value;
// }
// },
},
// LIFE-CYCLE CALLBACKS:
// onLoad () {},
start() {
this.init();
},
// barBaseW: null,
// barSpr: null,
// barSf: null,
barBtn: null,
init() {
this.initProgress();
this.initVideoBtn();
this.addListener();
},
initProgress() {
this.bar = cc.find('progress/bar', this.node);
this.barBtn = cc.find('progress/btn', this.node);
// this.barBaseW = 710 //this.bar.width;
// this.barSpr = this.bar.getComponent(cc.Sprite);
// this.barSf = this.barSpr.spriteFrame;
this.barComp = cc.find('progress', this.node).getComponent(cc.ProgressBar);
this.setProgress(0);
},
isPlaying: null,
initVideoBtn() {
const videoBtn = cc.find('btn', this.node);
this.videoPlayIcon = cc.find('btn/play', this.node);
this.videoPauseIcon = cc.find('btn/pause', this.node);
this.isPlaying = false;
videoBtn.addComponent(cc.Button);
videoBtn.on('click', () => {
if (this.isPlaying) {
this.isPlaying = !this.isPlaying;
this.playVideo();
} else {
this.isPlaying = !this.isPlaying;
this.pauseVideo();
}
});
},
playVideo() {
this.refreshVideoBtnState();
this.node.emit('video_btn_click', {isPlaying: this.isPlaying})
},
pauseVideo() {
this.refreshVideoBtnState();
this.node.emit('video_btn_click', {isPlaying: this.isPlaying})
},
refreshVideoBtnState() {
if (this.isPlaying) {
this.videoPlayIcon.active = false;
this.videoPauseIcon.active = true;
} else {
this.videoPlayIcon.active = true;
this.videoPauseIcon.active = false;
}
},
addListener() {
this.node.on('video_play_end', () => {
this.isPlaying = false;
this.refreshVideoBtnState();
})
this.barBtn.minX = 0;
this.barBtn.maxX = this.bar.width;
this.barBtn.on('touchstart', () => {
console.log(' 111111111 ');
// this.curTouchBar = this.barBtn;
// if (this.isPlaying) {
// this.isPlaying = !this.isPlaying;
// this.playVideo();
// }
})
this.node.on('touchend', () => {
this.curTouchBar = null;
})
this.node.on('touchcancel', () => {
this.curTouchBar = null;
})
},
setProgress(progress) {
this.barComp.progress = progress;
this.barBtn.x = 710 * progress;
// console.log('barBtn x: ', this.barBtn.x);
// setTimeout(() => {
// if (!this.barSf || !this.bar) {
// return;
// }
// const w = this.barBaseW * progress;
// const rect = this.barSf.getRect();
// rect.width = w;
// this.bar.width = w;
// this.barSpr.spriteFrame.setRect(rect);
// this.barBtn.x = this.bar.width;
// }, 1);
},
// update (dt) {},
});
{
"ver": "1.0.8",
"uuid": "a169f42b-3d74-4e8d-ad95-dbfcc94e21f0",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "b54300af-b8e5-4b4e-aa2f-9ac1cef7b598", "uuid": "e2e0dcb5-f556-4545-b84a-3e9fb09c0a68",
"isPlugin": true, "isPlugin": true,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
{
"ver": "1.1.2",
"uuid": "2582562a-54bb-483a-8483-727d57c6c974",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "e1b4d971-9876-4832-803a-5a321964a78b", "uuid": "4154638a-341f-4d5d-b5f4-076c3c500d8c",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "point",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 1280, "width": 1280,
"height": 720, "height": 941,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg": { "bg": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "8288e3d4-4c75-4b27-8f01-f7014417f4dd", "uuid": "e527180c-6d51-497c-85dd-c702782594fe",
"rawTextureUuid": "e1b4d971-9876-4832-803a-5a321964a78b", "rawTextureUuid": "4154638a-341f-4d5d-b5f4-076c3c500d8c",
"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": 1280, "width": 1280,
"height": 720, "height": 941,
"rawWidth": 1280, "rawWidth": 1280,
"rawHeight": 720, "rawHeight": 941,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "a9ef20af-1649-4cfc-a6d8-4e94921d9ef1",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 409,
"height": 409,
"platformSettings": {},
"subMetas": {
"bg_circle": {
"ver": "1.0.4",
"uuid": "3d3bca10-cea6-45b2-8a7f-19de4580f99b",
"rawTextureUuid": "a9ef20af-1649-4cfc-a6d8-4e94921d9ef1",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 409,
"height": 409,
"rawWidth": 409,
"rawHeight": 409,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "4cfd0d60-aaf2-49c0-bf48-734f806f3b6c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 682,
"height": 266,
"platformSettings": {},
"subMetas": {
"bg_goodjob": {
"ver": "1.0.4",
"uuid": "3a360532-2cc9-41c1-9116-f67d17630b4f",
"rawTextureUuid": "4cfd0d60-aaf2-49c0-bf48-734f806f3b6c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 682,
"height": 266,
"rawWidth": 682,
"rawHeight": 266,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "68e31337-b23d-467b-9575-08b37d88f573",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "point",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1280,
"height": 171,
"platformSettings": {},
"subMetas": {
"bg_grass": {
"ver": "1.0.4",
"uuid": "b6af8af4-25b7-43fd-b523-6cd3c44b7ad7",
"rawTextureUuid": "68e31337-b23d-467b-9575-08b37d88f573",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1280,
"height": 171,
"rawWidth": 1280,
"rawHeight": 171,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "e368af1b-eb38-41d5-8dc5-18caa6c3ff91",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "point",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 663,
"height": 744,
"platformSettings": {},
"subMetas": {
"bg_house": {
"ver": "1.0.4",
"uuid": "3055660e-1b91-4f6e-a788-ee1f33692e15",
"rawTextureUuid": "e368af1b-eb38-41d5-8dc5-18caa6c3ff91",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 663,
"height": 744,
"rawWidth": 663,
"rawHeight": 744,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "fbe6c1d6-1df6-4d38-9cd3-f008221a9f24",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 663,
"height": 744,
"platformSettings": {},
"subMetas": {
"bg_house_mask": {
"ver": "1.0.4",
"uuid": "4fc00287-fb4a-41e6-9d0e-ce00f7f2fee5",
"rawTextureUuid": "fbe6c1d6-1df6-4d38-9cd3-f008221a9f24",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -0.5,
"offsetY": -7.5,
"trimX": 22,
"trimY": 208,
"width": 618,
"height": 343,
"rawWidth": 663,
"rawHeight": 744,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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