Commit 52d13809 authored by 范雪寒's avatar 范雪寒

feat:

parent 9dbd3133
No preview for this file type
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541", "uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"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",
"uuid": "5724ed2b-9534-4b8c-9d86-813991199116",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"__type__": "cc.AnimationClip",
"_name": "hideAnim",
"_objFlags": 0,
"_native": "",
"_duration": 0,
"sample": 60,
"speed": 1,
"wrapMode": 1,
"curveData": {
"paths": {
"rectangle": {
"props": {
"opacity": [
{
"frame": 0,
"value": 255
}
]
}
}
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "588ad0ee-f93e-4909-bc09-16e28568a59e",
"subMetas": {}
}
\ No newline at end of file
{
"__type__": "cc.AnimationClip",
"_name": "playAudio",
"_objFlags": 0,
"_native": "",
"_duration": 1.5,
"sample": 10,
"speed": 1,
"wrapMode": 2,
"curveData": {
"paths": {
"shape": {
"props": {
"opacity": [
{
"frame": 0,
"value": 0
},
{
"frame": 0.5,
"value": 0
},
{
"frame": 1,
"value": 255
}
]
}
},
"shape1": {
"props": {
"opacity": [
{
"frame": 0,
"value": 0
},
{
"frame": 0.5,
"value": 255
}
]
}
},
"shape2": {
"props": {
"opacity": [
{
"frame": 0,
"value": 0
},
{
"frame": 0.5,
"value": 255
}
]
}
},
"shape3": {
"props": {
"opacity": [
{
"frame": 0,
"value": 0
},
{
"frame": 0.5,
"value": 0
},
{
"frame": 1,
"value": 255
}
]
}
}
},
"props": {
"opacity": [
{
"frame": 0,
"value": 255
},
{
"frame": 1,
"value": 255
},
{
"frame": 1.5,
"value": 0
}
]
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "120fd8be-2579-455f-ba16-b843edb8f914",
"subMetas": {}
}
\ No newline at end of file
{
"__type__": "cc.AnimationClip",
"_name": "stopAudio",
"_objFlags": 0,
"_native": "",
"_duration": 0.5,
"sample": 10,
"speed": 1,
"wrapMode": 1,
"curveData": {
"props": {
"opacity": [
{
"frame": 0,
"value": 255,
"curve": "cubicInOut"
},
{
"frame": 0.5,
"value": 0
}
]
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "2e2ebfa2-b695-4273-9367-34a19066fd2e",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "7e5df83a-be7d-40b6-bbb4-f2869255eef9",
"downloadMode": 0,
"duration": 3.787755,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "356c5e56-b524-4c85-9f70-b0ac0b468dd8",
"downloadMode": 0,
"duration": 1.854694,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "995608bc-0cfd-4cea-a03e-4f0d27b02f86",
"downloadMode": 0,
"duration": 0.130612,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "f982908d-a0a9-4010-987b-8d9959d70cb8",
"downloadMode": 0,
"duration": 0.412,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "6aa65df2-b9ab-458a-b1e4-4d2359be83c3",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "ffdff4b8-162d-473d-9ba1-7d9eea88a485",
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{ {
"ver": "1.2.9", "ver": "1.2.9",
"uuid": "0737ce42-24f0-45c6-8e1a-8bdab4f74ba3", "uuid": "3134393d-e843-4095-94d8-dc1877aac390",
"asyncLoadAssets": false, "asyncLoadAssets": false,
"autoReleaseAssets": true, "autoReleaseAssets": true,
"subMetas": {} "subMetas": {}
......
This diff is collapsed.
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "f8b451ff-857c-4ca8-9870-866bc5154a29", "uuid": "f0d56990-49cd-42a5-aa21-fc14e246a198",
"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;
export default class NewClass extends cc.Component {
label = null;
text = 'hello';
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
start() {
cc.color()
this.node.off(cc.Node.EventType.MOUSE_DOWN)
}
// update (dt) {}
onEnable() {
let one = new cc.Animation()
one.currentClip.speed
one.play().wrapMode
one.defaultClip.wrapMode = cc.WrapMode.Reverse
cc.Node.EventType.MOUSE_LEAVE
cc.tween(this.node).to(1,{opacity:1}).to
}
}
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "408a67f8-65fa-4cf1-8cf2-83e20e1a0fd5", "uuid": "81db3e2c-d815-4891-a77d-5651d54dc92d",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
cc.sys.capabilities["touches"] = true;
!(function (global) { !(function (global) {
"use strict"; "use strict";
......
...@@ -165,7 +165,7 @@ export function getSprNodeByUrl(url, cb) { ...@@ -165,7 +165,7 @@ export function getSprNodeByUrl(url, cb) {
export function playAudio(audioClip, cb = null) { export function playAudio(audioClip, cb = null) {
if (audioClip) { if (audioClip) {
const audioId = cc.audioEngine.playEffect(audioClip, false); const audioId = cc.audioEngine.playEffect(audioClip, false, 0.8);
if (cb) { if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => { cc.audioEngine.setFinishCallback(audioId, () => {
cb(); cb();
...@@ -178,7 +178,7 @@ export async function asyncDelay(time) { ...@@ -178,7 +178,7 @@ export async function asyncDelay(time) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
try { try {
setTimeout(() => { setTimeout(() => {
resolve(null); resolve();
}, time * 1000); }, time * 1000);
} catch (e) { } catch (e) {
reject(e); reject(e);
...@@ -296,7 +296,7 @@ export async function asyncTweenTo(node, duration, obj, ease = undefined) { ...@@ -296,7 +296,7 @@ export async function asyncTweenTo(node, duration, obj, ease = undefined) {
cc.tween(node) cc.tween(node)
.to(duration, obj, ease) .to(duration, obj, ease)
.call(() => { .call(() => {
resolve(null); resolve();
}) })
.start(); .start();
} catch (e) { } catch (e) {
...@@ -311,7 +311,7 @@ export async function asyncTweenBy(node, duration, obj, ease = undefined) { ...@@ -311,7 +311,7 @@ export async function asyncTweenBy(node, duration, obj, ease = undefined) {
cc.tween(node) cc.tween(node)
.by(duration, obj, ease) .by(duration, obj, ease)
.call(() => { .call(() => {
resolve(null); resolve();
}) })
.start(); .start();
} catch (e) { } catch (e) {
...@@ -348,7 +348,6 @@ export function onHomeworkFinish() { ...@@ -348,7 +348,6 @@ export function onHomeworkFinish() {
if (middleLayerComponent.role == 'student') { if (middleLayerComponent.role == 'student') {
middleLayerComponent.onHomeworkFinish(() => { }); middleLayerComponent.onHomeworkFinish(() => { });
} }
} else { return;
console.log('onHomeworkFinish');
} }
} }
\ No newline at end of file
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "9a79969a-0506-48d4-bc98-3c05d109b027", "uuid": "5bd403c0-9676-4b25-8b82-b8bba1f11db1",
"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": 29,
"height": 67, "height": 29,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_left": { "Img_paper": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5", "uuid": "9b6f7e88-adc2-446f-b791-1259c116637c",
"rawTextureUuid": "9a79969a-0506-48d4-bc98-3c05d109b027", "rawTextureUuid": "5bd403c0-9676-4b25-8b82-b8bba1f11db1",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 61, "width": 29,
"height": 67, "height": 29,
"rawWidth": 61, "rawWidth": 29,
"rawHeight": 67, "rawHeight": 29,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "1.1.2",
"uuid": "5c3defd2-5c4e-4dfb-9d8f-162d47db79fb",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "15402e1f-77bc-4ddd-bec3-26645d8edf4c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 650,
"height": 410,
"platformSettings": {},
"subMetas": {
"13151616148416-pic-hd": {
"ver": "1.0.4",
"uuid": "ff5b5f1e-9620-496d-ba6a-0ab6f517fc3b",
"rawTextureUuid": "15402e1f-77bc-4ddd-bec3-26645d8edf4c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 650,
"height": 410,
"rawWidth": 650,
"rawHeight": 410,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "2f69f1e0-da46-41db-a404-01b002ca417d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "point",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 103,
"height": 53,
"platformSettings": {},
"subMetas": {
"Combined Shape": {
"ver": "1.0.4",
"uuid": "c8cf8408-3dfb-4c8b-88ce-d5c9c79491df",
"rawTextureUuid": "2f69f1e0-da46-41db-a404-01b002ca417d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 103,
"height": 53,
"rawWidth": 103,
"rawHeight": 53,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 24,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "666097fd-038d-4b7b-a2b7-2d03389d4d71",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "point",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 60,
"height": 40,
"platformSettings": {},
"subMetas": {
"Group": {
"ver": "1.0.4",
"uuid": "5dbb6b29-69be-4805-b8d9-e63ebeca90ef",
"rawTextureUuid": "666097fd-038d-4b7b-a2b7-2d03389d4d71",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 60,
"height": 40,
"rawWidth": 60,
"rawHeight": 40,
"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": "8a58b9d4-3aa5-47d6-840e-041c6e6d879a",
"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": 1280, "width": 1169,
"height": 720, "height": 181,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg": { "Oval 3": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "8288e3d4-4c75-4b27-8f01-f7014417f4dd", "uuid": "10857084-2da5-4659-acfb-41ff9460726e",
"rawTextureUuid": "e1b4d971-9876-4832-803a-5a321964a78b", "rawTextureUuid": "8a58b9d4-3aa5-47d6-840e-041c6e6d879a",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 1280, "width": 1169,
"height": 720, "height": 181,
"rawWidth": 1280, "rawWidth": 1169,
"rawHeight": 720, "rawHeight": 181,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f", "uuid": "498a8cdd-ce1a-4651-9ba3-d3701c34a4a1",
"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": 273,
"height": 336, "height": 495,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"1orange": { "Oval Copy": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "43d1e79d-6de8-4dcb-b8ce-d767df7913aa", "uuid": "45224f1d-8ab0-4850-b5ae-a6477ed21c31",
"rawTextureUuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f", "rawTextureUuid": "498a8cdd-ce1a-4651-9ba3-d3701c34a4a1",
"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": 273,
"height": 335, "height": 495,
"rawWidth": 366, "rawWidth": 273,
"rawHeight": 336, "rawHeight": 495,
"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": "cf462678-5a56-4c63-b244-9679bc88818a",
"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": 227,
"height": 67, "height": 218,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_right": { "Path 2 Copy": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59", "uuid": "e668056f-ac84-44f3-83b6-182916ceb26d",
"rawTextureUuid": "d582359e-924e-4ee9-9964-1fc4bb417e71", "rawTextureUuid": "cf462678-5a56-4c63-b244-9679bc88818a",
"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": 227,
"height": 66, "height": 218,
"rawWidth": 61, "rawWidth": 227,
"rawHeight": 67, "rawHeight": 218,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "fd138167-3ea2-4f2b-8a88-94e740152531",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 496,
"height": 128,
"platformSettings": {},
"subMetas": {
"Rectangle 16@2x": {
"ver": "1.0.4",
"uuid": "a23efbdd-1b8a-453b-9b4e-4cb497c2c156",
"rawTextureUuid": "fd138167-3ea2-4f2b-8a88-94e740152531",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 496,
"height": 128,
"rawWidth": 496,
"rawHeight": 128,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "8fd6793f-f6a5-405e-a7c7-5252ad5d2c4c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "point",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 112,
"height": 200,
"platformSettings": {},
"subMetas": {
"combined-shape-copy": {
"ver": "1.0.4",
"uuid": "43c1a202-7dcd-4194-8735-e7de697fbd4d",
"rawTextureUuid": "8fd6793f-f6a5-405e-a7c7-5252ad5d2c4c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 112,
"height": 200,
"rawWidth": 112,
"rawHeight": 200,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f7acb24a-a689-447b-ab7a-77298dd12925",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "point",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 158,
"height": 300,
"platformSettings": {},
"subMetas": {
"combined-shape": {
"ver": "1.0.4",
"uuid": "94ecff79-76d6-4a97-ac9a-e12659d4a734",
"rawTextureUuid": "f7acb24a-a689-447b-ab7a-77298dd12925",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 158,
"height": 300,
"rawWidth": 158,
"rawHeight": 300,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "18d07592-51a9-421e-8972-0f67b68d29e1", "uuid": "1daf3640-7cb1-4325-bc28-79539c156772",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": true,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 144, "width": 204,
"height": 144, "height": 204,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"icon": { "leftArrow": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a", "uuid": "1f0f0214-63c0-4c73-b762-40578a0d92d8",
"rawTextureUuid": "18d07592-51a9-421e-8972-0f67b68d29e1", "rawTextureUuid": "1daf3640-7cb1-4325-bc28-79539c156772",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 0, "offsetX": 0,
"offsetY": -0.5, "offsetY": 0,
"trimX": 3, "trimX": 1,
"trimY": 2, "trimY": 1,
"width": 138, "width": 202,
"height": 141, "height": 202,
"rawWidth": 144, "rawWidth": 204,
"rawHeight": 144, "rawHeight": 204,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "6e988f8e-9206-4ec6-a699-768212d529e4",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 236,
"height": 236,
"platformSettings": {},
"subMetas": {
"leftArrow_0": {
"ver": "1.0.4",
"uuid": "3e5ace3d-9885-498b-964f-3a8a4291131d",
"rawTextureUuid": "6e988f8e-9206-4ec6-a699-768212d529e4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 1,
"trimY": 1,
"width": 234,
"height": 234,
"rawWidth": 236,
"rawHeight": 236,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "3ceb8adb-e6ef-43f6-a3b0-fa467c3fcc66",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "point",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 680,
"height": 440,
"platformSettings": {},
"subMetas": {
"mask": {
"ver": "1.0.4",
"uuid": "72b076e2-55dd-4f87-8086-a3489c1d30ab",
"rawTextureUuid": "3ceb8adb-e6ef-43f6-a3b0-fa467c3fcc66",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 680,
"height": 440,
"rawWidth": 680,
"rawHeight": 440,
"borderTop": 30,
"borderBottom": 30,
"borderLeft": 30,
"borderRight": 30,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "6203ebeb-8b8a-479d-b7a4-e9d324e9e03f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 679,
"height": 453,
"platformSettings": {},
"subMetas": {
"mask_shader": {
"ver": "1.0.4",
"uuid": "f5322b3d-0897-4985-9b49-56b4bfd27767",
"rawTextureUuid": "6203ebeb-8b8a-479d-b7a4-e9d324e9e03f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 679,
"height": 453,
"rawWidth": 679,
"rawHeight": 453,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "69bc9685-6566-471a-85e0-7891fa79d248",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 203,
"height": 82,
"platformSettings": {},
"subMetas": {
"rectangle-13": {
"ver": "1.0.4",
"uuid": "bd9469ad-a64d-42e0-9d02-99e5d1bbb88e",
"rawTextureUuid": "69bc9685-6566-471a-85e0-7891fa79d248",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 203,
"height": 82,
"rawWidth": 203,
"rawHeight": 82,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "eec8aebd-20a5-47b5-9347-0bb8113db99b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "point",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 191,
"height": 54,
"platformSettings": {},
"subMetas": {
"rectangle": {
"ver": "1.0.4",
"uuid": "e8547d04-51ef-4822-8872-b595f931b7db",
"rawTextureUuid": "eec8aebd-20a5-47b5-9347-0bb8113db99b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 191,
"height": 54,
"rawWidth": 191,
"rawHeight": 54,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "a4a9dfcb-58f9-4b34-9654-5b0427f6cfd3",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 117,
"height": 36,
"platformSettings": {},
"subMetas": {
"replay": {
"ver": "1.0.4",
"uuid": "6cb4f36a-95c0-42f1-a28a-707076bf9203",
"rawTextureUuid": "a4a9dfcb-58f9-4b34-9654-5b0427f6cfd3",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 117,
"height": 36,
"rawWidth": 117,
"rawHeight": 36,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "7bab5dc8-8e49-471f-97d3-4bbbd246a2dd",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 204,
"height": 204,
"platformSettings": {},
"subMetas": {
"rightArrow": {
"ver": "1.0.4",
"uuid": "2c3e2369-ad6e-489b-bec4-c90bcbdaf524",
"rawTextureUuid": "7bab5dc8-8e49-471f-97d3-4bbbd246a2dd",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 1,
"trimY": 1,
"width": 202,
"height": 202,
"rawWidth": 204,
"rawHeight": 204,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "8554f634-9ea8-4ed5-b8c0-006645f3cd6a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 236,
"height": 236,
"platformSettings": {},
"subMetas": {
"rightArrow_0": {
"ver": "1.0.4",
"uuid": "179191dd-d294-4ac7-af59-33249601ffa3",
"rawTextureUuid": "8554f634-9ea8-4ed5-b8c0-006645f3cd6a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 1,
"trimY": 1,
"width": 234,
"height": 234,
"rawWidth": 236,
"rawHeight": 236,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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() {
}
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.loadAny(preloadArr, null, null, (err, data) => {
if (window && window["air"]) {
// window["air"].onCourseInScreen = (next) => {
// window["air"].isCourseInScreen = true;
// this.onLoadEnd();
// next();
// };
this.onLoadEnd();
window["air"].hideAirClassLoading();
} else {
this.onLoadEnd();
}
cc.debug.setDisplayStats(false);
});
}
log (str) {
const node = cc.find('middleLayer');
if(node){
node.getComponent('middleLayer').log(str);
}else{
cc.log(str);
}
}
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();
});
}
});
}
}
}
\ No newline at end of file
This diff is collapsed.
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
"compilerOptions": { "compilerOptions": {
"target": "es6", "target": "es6",
"module": "commonjs", "module": "commonjs",
"experimentalDecorators": true "experimentalDecorators": true,
"sourceMap": true
}, },
"exclude": [ "exclude": [
"node_modules", "node_modules",
......
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
"packages": "packages", "packages": "packages",
"name": "play", "name": "play",
"id": "9af72fd2-44a6-4131-8ea3-3e1b3fa22231", "id": "9af72fd2-44a6-4131-8ea3-3e1b3fa22231",
"version": "2.4.5", "version": "2.4.4",
"isNew": false "isNew": false
} }
\ No newline at end of file
{ {
"title": "play", "title": "play",
"packageName": "org.cocos2d.demo", "packageName": "org.cocos2d.demo",
"startScene": "0737ce42-24f0-45c6-8e1a-8bdab4f74ba3", "startScene": "3134393d-e843-4095-94d8-dc1877aac390",
"excludeScenes": [], "excludeScenes": [],
"includeSDKBox": false, "includeSDKBox": false,
"orientation": { "orientation": {
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
"experimentalDecorators": true, "experimentalDecorators": true,
"skipLibCheck": true, "skipLibCheck": true,
"outDir": "temp/vscode-dist", "outDir": "temp/vscode-dist",
"allowJs": true,
"forceConsistentCasingInFileNames": true "forceConsistentCasingInFileNames": true
}, },
"exclude": [ "exclude": [
......
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