Commit b62d6173 authored by Tt's avatar Tt

处理完成005

parent 9f5f5457
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541", "uuid": "6950e3f2-0480-42e0-a48b-3f0884b73e4a",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "cb9fa4ea-66ca-45af-ad31-e445c7b0ef32", "uuid": "6c84098e-3779-4f91-a5f4-bac570841f24",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "f0680ae0-c079-45ef-abd7-9e63d90b982b", "uuid": "0325f960-8e48-4eff-84d5-89fda747a969",
"downloadMode": 0, "downloadMode": 0,
"duration": 0.130612, "duration": 0.130612,
"subMetas": {} "subMetas": {}
......
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "0853721c-3f55-4eb2-873d-e3081cfadd4b", "uuid": "cada208f-96ae-4336-95da-35bd14a4c467",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "20185448-a1ca-4de2-8b37-7bf6cdfccbae", "uuid": "4dfd472b-d8f0-4ed4-bc48-7a04fda3ceb1",
"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": "adaba431-db00-4b50-930f-dd1466bce3ef",
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "8700c4ce-513b-4374-b284-b51c1d29393c",
"subMetas": {}
}
\ No newline at end of file
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "e8bd16b0-3804-45a9-a8ca-f52c02224f55", "uuid": "bc83392c-0c01-4ca8-805c-7e7e235b84d6",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
{ {
"ver": "1.2.9", "ver": "1.2.9",
"uuid": "0737ce42-24f0-45c6-8e1a-8bdab4f74ba3", "uuid": "1ab00db5-6e09-402f-b719-f7910b9ec758",
"asyncLoadAssets": false, "asyncLoadAssets": false,
"autoReleaseAssets": true, "autoReleaseAssets": true,
"subMetas": {} "subMetas": {}
......
import { asyncDelay, onHomeworkFinish, callMiddleLayerFunction } 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() {
}
@property(cc.Node)
page3: cc.Node = null;
onLoadEnd() {
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this.initData();
this.initView();
this.initListener();
}
_cantouch = null;
initData() {
// 所有全局变量 默认都是null
this._cantouch = true;
}
initView() {
this.toPage3();
}
initListener() {
this.node.on('page3_btn_click', (event) => {
event.stopPropagation();
let data = event.getUserData();
console.log(JSON.stringify(data));
callMiddleLayerFunction('NS_select_game', { gameId: data.id }, (result) => {
console.log(JSON.stringify(result));
});
});
}
toPage3(testData = null) {
testData = { gameList: this.data.gameList };
this.page3.active = true;
this.page3.getComponent('page3').setData(testData)
}
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);
});
})
}
}
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "408a67f8-65fa-4cf1-8cf2-83e20e1a0fd5", "uuid": "6f4527c1-8710-47ec-8c0e-25a8e1a22c5d",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.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
const { ccclass, property } = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
private yList = [70, -85];
private list: Array<{ img, name, id }>;
//TODO:入口方法
public setData(val) {
this.list = val.gameList.concat();
this.initView();
// img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
// name: '小红帽历险记2',
// locked: false,
// id: 1232,
}
//TODO:点击事件
public onTouchItem(e) {
let data = e.target.data;
console.log(data);
// if (data.locked) return;
let event = new cc.Event.EventCustom('page3_btn_click', true);
event.setUserData(data);
this.node.dispatchEvent(event);
}
private layout: cc.Node;
private item: cc.Node;
onLoad() {
let scrollview = this.node.getChildByName("scrollview");
let view = scrollview.getChildByName("view");
this.layout = view.getChildByName("content");
this.item = this.node.getChildByName("item");
this.item.active = false;
}
initView() {
this.list.forEach((data, index) => {
let item = cc.instantiate(this.item);
this.updateItem(item, data, index);
this.layout.addChild(item)
})
}
updateItem(item: any, data, index) {
item.active = true;
item.data = data;
item.y = this.yList[index % 2];
// img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
// name: '小红帽历险记2',
// locked: false,
// id: 1232,
let icon = item.getChildByName("icon")
let title = item.getChildByName("title")
let bg_0 = item.getChildByName("bg_0")
let bg_1 = item.getChildByName("bg_1")
let bg_2 = item.getChildByName("bg_2")
let lock = item.getChildByName('lock')
this.setNetImg(icon, data.img, { w: 263, h: 183 })
title.getComponent(cc.Label).string = data.name;
bg_0.active = index % 3 == 0
bg_1.active = index % 3 == 1
bg_2.active = index % 3 == 2
lock.active = data.locked;
item.on(cc.Node.EventType.TOUCH_END, this.onTouchItem, this);
}
setNetImg(item, url, { w, h }) {
return new Promise((resolve, reject) => {
if (!item) return console.log("图片更换失败,传入了错误的item");
let node = item.node ? item.node : item;
if (!url) {
if (node) node.active = false;
return console.log("图片更换失败,传入了错误的res");
}
if (!node) return console.log("图片更换失败,传入了错误的item");
if (node.net_url == url) return;
node.active = false;//
cc.loader.load({ url }, (err, texture) => {
if (err && !texture) return;
if (!cc.isValid(node)) return console.log("节点已销毁");
let nw = node.width = texture.width;
let nh = node.height = texture.height;
let component = node.getComponent(cc.Sprite);
let spriteFrame = new cc.SpriteFrame(texture);
component.spriteFrame = spriteFrame;
node.net_url = url;
if (!cc.isValid(node)) return console.log("节点已销毁");
if (!node) return console.log("节点已销毁");
if (w && h) {
let scaleX = w / nw;
let scaleY = h / nh;
let scale = scaleX <= scaleY ? scaleX : scaleY;
node.width = nw * scale;
node.height = nh * scale;
}
node.active = true;
resolve({ w: nw, h: nh });
});
})
}
}
{
"ver": "1.0.8",
"uuid": "cfef9452-d5b4-4566-aa56-fbe182a14b5e",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "b0c008bc-cf92-463b-8360-0984e13c2e4d", "uuid": "124fd056-4356-460c-9d5e-9435846c5dbb",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "f8b451ff-857c-4ca8-9870-866bc5154a29", "uuid": "3de20842-acf0-42ee-997e-0bd4b7973635",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
// 新剧本地图页
export const defaultData = {
//左右两个
left: {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记',
id: 1234,
},
right: {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '大红帽历险记',
id: 1235,
},
//固定3个
eventList: [{
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记',
totalIcon: 0,
locked: false,
id: 1234,
}, {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '中红帽历险记',
totalIcon: 100,
locked: false,
id: 1235,
}, {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '大红帽历险记',
totalIcon: 100,
locked: true,
id: 1236,
}],
//游戏列表
gameList: [{
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记1',
locked: false,
id: 1231,
}, {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记2',
locked: false,
id: 1232,
}, {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记3',
locked: false,
id: 1233,
}, {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记4',
locked: false,
id: 1234,
}, {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记5',
locked: false,
id: 1235,
}],
}
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "c41b0e51-55d7-443c-af3a-b22c3dd9b9e5", "uuid": "217d6ffd-f02b-4ff2-83d5-2acb9fddaea5",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "b54300af-b8e5-4b4e-aa2f-9ac1cef7b598", "uuid": "a9501814-aaa6-47cd-8fe6-ccbb78217b7f",
"isPlugin": true, "isPlugin": true,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "ade7af40-d56d-4087-bbc6-2888fef55353", "uuid": "0679d979-a76f-4ac0-86ed-c868879a8d3b",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "8ba21262-178f-4fa5-afc9-2c1dd50ba3ab", "uuid": "59ef2d05-38e7-4ac6-809c-53280e2ec0e6",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f", "uuid": "780f7c0f-0d61-47b2-9f2e-f5301cb4121a",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
"subMetas": { "subMetas": {
"1orange": { "1orange": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "43d1e79d-6de8-4dcb-b8ce-d767df7913aa", "uuid": "d8863a1a-6912-49b3-9877-d104370b72a4",
"rawTextureUuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f", "rawTextureUuid": "780f7c0f-0d61-47b2-9f2e-f5301cb4121a",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
......
{
"ver": "1.1.2",
"uuid": "22e06234-9e4b-45f9-aa27-93330d85c353",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "aa77e238-fe5e-4561-a44e-b1e7e2432d24",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"1": {
"ver": "1.0.4",
"uuid": "a889c09f-333a-497e-b0ef-35aa2c23218e",
"rawTextureUuid": "aa77e238-fe5e-4561-a44e-b1e7e2432d24",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "af289696-bd2a-4200-a510-0b25d1469249",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"2": {
"ver": "1.0.4",
"uuid": "943f4d95-c940-4c2f-be23-2dbcf0d7cd88",
"rawTextureUuid": "af289696-bd2a-4200-a510-0b25d1469249",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "5f7084f8-34a9-4c45-be8c-b8d0c3b71713",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"3": {
"ver": "1.0.4",
"uuid": "1086c184-1331-4894-98c5-a2c117251634",
"rawTextureUuid": "5f7084f8-34a9-4c45-be8c-b8d0c3b71713",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "1c7e36e0-bdcb-4c28-98a0-a9f131a54c79",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "fadbf4ff-8682-45f7-85e2-408119b8f6aa",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"bg_bg": {
"ver": "1.0.4",
"uuid": "c6cde812-dfde-4062-a1de-c710dd9ec762",
"rawTextureUuid": "fadbf4ff-8682-45f7-85e2-408119b8f6aa",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "0e75c549-3a21-466b-8313-3a0f47e4792d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 415,
"height": 477,
"platformSettings": {},
"subMetas": {
"bg_di1": {
"ver": "1.0.4",
"uuid": "de8121a4-fced-45b3-9a0b-2fd5448c8f38",
"rawTextureUuid": "0e75c549-3a21-466b-8313-3a0f47e4792d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 415,
"height": 477,
"rawWidth": 415,
"rawHeight": 477,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "88f0c7cb-b8b5-4fd7-8cb1-9abcb6337a70",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 135,
"platformSettings": {},
"subMetas": {
"bg_earth": {
"ver": "1.0.4",
"uuid": "a20a6851-74b4-444b-b628-7bcdfb07e516",
"rawTextureUuid": "88f0c7cb-b8b5-4fd7-8cb1-9abcb6337a70",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 135,
"rawWidth": 1334,
"rawHeight": 135,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "de5171cd-7342-4d65-a8d8-7784ea489b17",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "8471e99a-e1dc-4fb1-a018-8e8fe0659c19",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"bg_bg": {
"ver": "1.0.4",
"uuid": "6b360053-e054-4ab8-a3e0-65e1ee9892b9",
"rawTextureUuid": "8471e99a-e1dc-4fb1-a018-8e8fe0659c19",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "e03dddd9-e7dc-4414-afc9-293c26aefe6c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 365,
"height": 534,
"platformSettings": {},
"subMetas": {
"bg_di2-nostone": {
"ver": "1.0.4",
"uuid": "c27ee172-1cc3-48ed-926e-b821ff9f01e9",
"rawTextureUuid": "e03dddd9-e7dc-4414-afc9-293c26aefe6c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -31.5,
"trimX": 0,
"trimY": 63,
"width": 365,
"height": 471,
"rawWidth": 365,
"rawHeight": 534,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f8064466-cc54-42dd-999e-ef8525ebbec1",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 365,
"height": 534,
"platformSettings": {},
"subMetas": {
"bg_di2": {
"ver": "1.0.4",
"uuid": "313668a6-0099-419b-ba9c-37351cddd468",
"rawTextureUuid": "f8064466-cc54-42dd-999e-ef8525ebbec1",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 365,
"height": 534,
"rawWidth": 365,
"rawHeight": 534,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "c614361d-b0fb-4290-9bfd-9d7143c5c289",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 685,
"platformSettings": {},
"subMetas": {
"bg_grass": {
"ver": "1.0.4",
"uuid": "0d59d485-a236-4834-8d58-4a65d883bb6a",
"rawTextureUuid": "c614361d-b0fb-4290-9bfd-9d7143c5c289",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 685,
"rawWidth": 1334,
"rawHeight": 685,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "00e46c1b-3069-4ae2-9f3b-e6f8d6a0f37c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 318,
"height": 143,
"platformSettings": {},
"subMetas": {
"bg_left": {
"ver": "1.0.4",
"uuid": "1d8d2342-d797-4ac9-9b33-878aa6d54488",
"rawTextureUuid": "00e46c1b-3069-4ae2-9f3b-e6f8d6a0f37c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 318,
"height": 143,
"rawWidth": 318,
"rawHeight": 143,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "5b3035f7-7925-4f6d-99d2-3fa22fe5988a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 304,
"height": 119,
"platformSettings": {},
"subMetas": {
"bg_right": {
"ver": "1.0.4",
"uuid": "d7af4920-a821-4151-9c0f-d30057e4039e",
"rawTextureUuid": "5b3035f7-7925-4f6d-99d2-3fa22fe5988a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 304,
"height": 119,
"rawWidth": 304,
"rawHeight": 119,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "d83a0ef4-3003-416c-9a8c-8558d288e112",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 72,
"height": 75,
"platformSettings": {},
"subMetas": {
"icon_key": {
"ver": "1.0.4",
"uuid": "42d52a00-5b96-4488-b67e-abe305312284",
"rawTextureUuid": "d83a0ef4-3003-416c-9a8c-8558d288e112",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 72,
"height": 75,
"rawWidth": 72,
"rawHeight": 75,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "e032c45f-8fd1-4dd9-9e19-73720caaab0d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 134,
"height": 37,
"platformSettings": {},
"subMetas": {
"text_huigu": {
"ver": "1.0.4",
"uuid": "3fb76620-203d-4cb6-8420-2d01796e7032",
"rawTextureUuid": "e032c45f-8fd1-4dd9-9e19-73720caaab0d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0.5,
"trimX": 0,
"trimY": 0,
"width": 134,
"height": 36,
"rawWidth": 134,
"rawHeight": 37,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "a308de4f-e58d-4eb1-a78e-039204f06a04",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 134,
"height": 37,
"platformSettings": {},
"subMetas": {
"text_tiyan": {
"ver": "1.0.4",
"uuid": "4b9b0f96-253e-47e2-aeef-f07df02c5bbb",
"rawTextureUuid": "a308de4f-e58d-4eb1-a78e-039204f06a04",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0.5,
"trimX": 0,
"trimY": 0,
"width": 134,
"height": 36,
"rawWidth": 134,
"rawHeight": 37,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "ac4a41a1-4577-4cb1-a273-f33b97f9f636",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 134,
"height": 37,
"platformSettings": {},
"subMetas": {
"text_yugao": {
"ver": "1.0.4",
"uuid": "6fff9a8a-c1ca-4d8d-a36a-3a78669e9d97",
"rawTextureUuid": "ac4a41a1-4577-4cb1-a273-f33b97f9f636",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": 0,
"trimX": 1,
"trimY": 0,
"width": 133,
"height": 37,
"rawWidth": 134,
"rawHeight": 37,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "3fd9345b-87d3-4ffb-8ba8-0e68242c8a51",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "d993a052-5d29-4563-98f9-463632be87a5",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"bg_bg3": {
"ver": "1.0.4",
"uuid": "ac8f6eee-c7e2-483f-944e-e622912f339b",
"rawTextureUuid": "d993a052-5d29-4563-98f9-463632be87a5",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "ed687ef3-6943-4027-a6f4-7602e49f7e5b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 429,
"height": 385,
"platformSettings": {},
"subMetas": {
"bg_di3-blue": {
"ver": "1.0.4",
"uuid": "16127455-cab8-44dc-ad57-3b4af72d3409",
"rawTextureUuid": "ed687ef3-6943-4027-a6f4-7602e49f7e5b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 429,
"height": 385,
"rawWidth": 429,
"rawHeight": 385,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f51bbe4d-7c70-4690-8934-e5b24332ebe3",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 429,
"height": 385,
"platformSettings": {},
"subMetas": {
"bg_di3-green": {
"ver": "1.0.4",
"uuid": "2427fa49-e715-4890-a63a-61ff1dfb46ff",
"rawTextureUuid": "f51bbe4d-7c70-4690-8934-e5b24332ebe3",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 429,
"height": 385,
"rawWidth": 429,
"rawHeight": 385,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "1e850ae0-42cb-4316-9c34-b2078cc28cf0",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 429,
"height": 385,
"platformSettings": {},
"subMetas": {
"bg_di3-yellow": {
"ver": "1.0.4",
"uuid": "13b7af78-fa9e-4212-9e09-6f95e5d894b6",
"rawTextureUuid": "1e850ae0-42cb-4316-9c34-b2078cc28cf0",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 429,
"height": 385,
"rawWidth": 429,
"rawHeight": 385,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "6e341725-0139-4375-8915-53971f36d6c6",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 166,
"platformSettings": {},
"subMetas": {
"bg_front": {
"ver": "1.0.4",
"uuid": "afda8217-35d3-4e21-9cac-84e1b3fac607",
"rawTextureUuid": "6e341725-0139-4375-8915-53971f36d6c6",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 166,
"rawWidth": 1334,
"rawHeight": 166,
"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": "fb448bcd-e640-4c25-a238-7c37855b0123",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
"subMetas": { "subMetas": {
"bg": { "bg": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "8288e3d4-4c75-4b27-8f01-f7014417f4dd", "uuid": "bd1b61fa-4061-4917-ac39-28363b62827a",
"rawTextureUuid": "e1b4d971-9876-4832-803a-5a321964a78b", "rawTextureUuid": "fb448bcd-e640-4c25-a238-7c37855b0123",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
......
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "9a79969a-0506-48d4-bc98-3c05d109b027", "uuid": "709452c0-3497-43db-acc1-f2384d174146",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
"subMetas": { "subMetas": {
"btn_left": { "btn_left": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5", "uuid": "4be179a0-12e9-4865-837d-f5b06d065e53",
"rawTextureUuid": "9a79969a-0506-48d4-bc98-3c05d109b027", "rawTextureUuid": "709452c0-3497-43db-acc1-f2384d174146",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
......
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "d582359e-924e-4ee9-9964-1fc4bb417e71", "uuid": "70818e32-20b3-4968-82d6-e968cb116eae",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
"subMetas": { "subMetas": {
"btn_right": { "btn_right": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59", "uuid": "9dc146d6-9fad-4c86-85e4-c547237193ed",
"rawTextureUuid": "d582359e-924e-4ee9-9964-1fc4bb417e71", "rawTextureUuid": "70818e32-20b3-4968-82d6-e968cb116eae",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
......
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "18d07592-51a9-421e-8972-0f67b68d29e1", "uuid": "0ddbbba1-9f39-46ee-9c7e-0d13a44b194e",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
"subMetas": { "subMetas": {
"icon": { "icon": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a", "uuid": "209d0349-d0cd-4173-83bb-752db98212f7",
"rawTextureUuid": "18d07592-51a9-421e-8972-0f67b68d29e1", "rawTextureUuid": "0ddbbba1-9f39-46ee-9c7e-0d13a44b194e",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
......
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() {
}
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);
});
})
}
}
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
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