Commit 41472ed4 authored by 范雪寒's avatar 范雪寒

feat: 初次提交

parent ce304201
{
"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": "replayBtn",
"_objFlags": 0,
"_native": "",
"_duration": 0.5,
"sample": 60,
"speed": 1,
"wrapMode": 1,
"curveData": {
"paths": {
"btn_left": {
"props": {
"scale": [
{
"frame": 0,
"value": {
"__type__": "cc.Vec2",
"x": 1,
"y": 1
}
},
{
"frame": 0.08333333333333333,
"value": {
"__type__": "cc.Vec2",
"x": 1.08,
"y": 1.08
}
},
{
"frame": 0.25,
"value": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
}
}
]
}
},
"btn_right": {
"props": {
"scale": [
{
"frame": 0,
"value": {
"__type__": "cc.Vec2",
"x": 1,
"y": 1
}
},
{
"frame": 0.08333333333333333,
"value": {
"__type__": "cc.Vec2",
"x": 1.08,
"y": 1.08
}
},
{
"frame": 0.25,
"value": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
}
}
]
}
},
"rectangle-16": {
"props": {
"active": [
{
"frame": 0,
"value": false
},
{
"frame": 0.25,
"value": true
}
],
"x": [
{
"frame": 0,
"value": 124
},
{
"frame": 0.25,
"value": 124
},
{
"frame": 0.5,
"value": -124
}
]
}
}
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "3bc75976-b8ba-4543-8957-5e1e0c63ec8a",
"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": "f0680ae0-c079-45ef-abd7-9e63d90b982b",
"uuid": "995608bc-0cfd-4cea-a03e-4f0d27b02f86",
"downloadMode": 0,
"duration": 0.130612,
"subMetas": {}
......
{
"ver": "2.0.1",
"uuid": "356c5e56-b524-4c85-9f70-b0ac0b468dd8",
"downloadMode": 0,
"duration": 1.854694,
"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.
// 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 () {
},
// update (dt) {},
});
{
"ver": "1.0.8",
"uuid": "c41b0e51-55d7-443c-af3a-b22c3dd9b9e5",
"uuid": "550b162e-3850-413b-b473-4c5a28bb84a5",
"isPlugin": false,
"loadPluginInWeb": 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 {
@property(cc.Label)
label: cc.Label = null;
@property
text: string = '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",
"uuid": "81db3e2c-d815-4891-a77d-5651d54dc92d",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
......@@ -5,8 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/
cc.sys.capabilities["touches"] = true;
!(function (global) {
"use strict";
......
This diff is collapsed.
......@@ -348,7 +348,6 @@ export function onHomeworkFinish() {
if (middleLayerComponent.role == 'student') {
middleLayerComponent.onHomeworkFinish(() => { });
}
} else {
console.log('onHomeworkFinish');
return;
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "9a79969a-0506-48d4-bc98-3c05d109b027",
"uuid": "5bd403c0-9676-4b25-8b82-b8bba1f11db1",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 61,
"height": 67,
"width": 29,
"height": 29,
"platformSettings": {},
"subMetas": {
"btn_left": {
"Img_paper": {
"ver": "1.0.4",
"uuid": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5",
"rawTextureUuid": "9a79969a-0506-48d4-bc98-3c05d109b027",
"uuid": "9b6f7e88-adc2-446f-b791-1259c116637c",
"rawTextureUuid": "5bd403c0-9676-4b25-8b82-b8bba1f11db1",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......@@ -22,10 +22,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 61,
"height": 67,
"rawWidth": 61,
"rawHeight": 67,
"width": 29,
"height": 29,
"rawWidth": 29,
"rawHeight": 29,
"borderTop": 0,
"borderBottom": 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": "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_x2": {
"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": "f7acb24a-a689-447b-ab7a-77298dd12925",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"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",
"uuid": "8fd6793f-f6a5-405e-a7c7-5252ad5d2c4c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"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": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f",
"uuid": "1daf3640-7cb1-4325-bc28-79539c156772",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 366,
"height": 336,
"width": 204,
"height": 204,
"platformSettings": {},
"subMetas": {
"1orange": {
"leftArrow": {
"ver": "1.0.4",
"uuid": "43d1e79d-6de8-4dcb-b8ce-d767df7913aa",
"rawTextureUuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f",
"uuid": "1f0f0214-63c0-4c73-b762-40578a0d92d8",
"rawTextureUuid": "1daf3640-7cb1-4325-bc28-79539c156772",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 0,
"offsetY": 0,
"trimX": 1,
"trimY": 1,
"width": 366,
"height": 335,
"rawWidth": 366,
"rawHeight": 336,
"width": 202,
"height": 202,
"rawWidth": 204,
"rawHeight": 204,
"borderTop": 0,
"borderBottom": 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": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 650,
"height": 410,
"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": 650,
"height": 410,
"rawWidth": 650,
"rawHeight": 410,
"borderTop": 40,
"borderBottom": 40,
"borderLeft": 40,
"borderRight": 40,
"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": 707,
"height": 481,
"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": 707,
"height": 481,
"rawWidth": 707,
"rawHeight": 481,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "e1b4d971-9876-4832-803a-5a321964a78b",
"uuid": "c48a3446-0552-4ff0-8ee0-c3a87b84f530",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 1280,
"height": 720,
"width": 288,
"height": 139,
"platformSettings": {},
"subMetas": {
"bg": {
"oval": {
"ver": "1.0.4",
"uuid": "8288e3d4-4c75-4b27-8f01-f7014417f4dd",
"rawTextureUuid": "e1b4d971-9876-4832-803a-5a321964a78b",
"uuid": "b0fb4a3d-3d59-4a26-88bb-18dcd6e385bb",
"rawTextureUuid": "c48a3446-0552-4ff0-8ee0-c3a87b84f530",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......@@ -22,10 +22,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1280,
"height": 720,
"rawWidth": 1280,
"rawHeight": 720,
"width": 288,
"height": 139,
"rawWidth": 288,
"rawHeight": 139,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "d582359e-924e-4ee9-9964-1fc4bb417e71",
"uuid": "e3c87510-c6b4-4038-b4e5-8ae6e0801166",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 61,
"height": 67,
"width": 472,
"height": 182,
"platformSettings": {},
"subMetas": {
"btn_right": {
"oval_copy": {
"ver": "1.0.4",
"uuid": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59",
"rawTextureUuid": "d582359e-924e-4ee9-9964-1fc4bb417e71",
"uuid": "4b00f80d-6db6-47fe-9634-6003382e7100",
"rawTextureUuid": "e3c87510-c6b4-4038-b4e5-8ae6e0801166",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -0.5,
"offsetY": 0.5,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 60,
"height": 66,
"rawWidth": 61,
"rawHeight": 67,
"width": 472,
"height": 182,
"rawWidth": 472,
"rawHeight": 182,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "182597fe-0048-41a8-84d5-09b581d9a39a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 154,
"height": 254,
"platformSettings": {},
"subMetas": {
"path_2": {
"ver": "1.0.4",
"uuid": "092742b9-3f5a-4aae-8d65-7b24c15b16a1",
"rawTextureUuid": "182597fe-0048-41a8-84d5-09b581d9a39a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 154,
"height": 254,
"rawWidth": 154,
"rawHeight": 254,
"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": "trilinear",
"premultiplyAlpha": true,
"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": "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": "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": "18d07592-51a9-421e-8972-0f67b68d29e1",
"uuid": "7bab5dc8-8e49-471f-97d3-4bbbd246a2dd",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 144,
"height": 144,
"width": 204,
"height": 204,
"platformSettings": {},
"subMetas": {
"icon": {
"rightArrow": {
"ver": "1.0.4",
"uuid": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a",
"rawTextureUuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"uuid": "2c3e2369-ad6e-489b-bec4-c90bcbdaf524",
"rawTextureUuid": "7bab5dc8-8e49-471f-97d3-4bbbd246a2dd",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 3,
"trimY": 2,
"width": 138,
"height": 141,
"rawWidth": 144,
"rawHeight": 144,
"offsetY": 0,
"trimX": 1,
"trimY": 1,
"width": 202,
"height": 202,
"rawWidth": 204,
"rawHeight": 204,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
{
"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 { onHomeworkFinish } from "../script/util";
import { defaultData } from "../script/defaultData";
cc.Class({
extends: cc.Component,
properties: {
},
// 生命周期 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;
},
// 生命周期 start
start() {
let getData = this.getData.bind(this);
if (window && window.courseware) {
getData = window.courseware.getData;
}
getData((data) => {
console.log('data:', data);
this.data = data || this.getDefaultData();
this.data = JSON.parse(JSON.stringify(this.data))
this.preloadItem()
})
},
getData(func) {
if (window && window.courseware) {
window.courseware.getData(func, 'scene');
return;
}
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
const middleLayerComponent = middleLayer.getComponent('middleLayer');
middleLayerComponent.getData(func);
return;
}
func(this.getDefaultData());
},
getDefaultData() {
return defaultData;
},
preloadItem() {
this.addPreloadImage();
this.addPreloadAudio();
this.addPreloadAnima();
this.preload();
},
addPreloadImage() {
this._imageResList.push({ url: this.data.pic_url });
this._imageResList.push({ url: this.data.pic_url_2 });
},
addPreloadAudio() {
this._audioResList.push({ url: this.data.audio_url });
},
addPreloadAnima() {
},
preload() {
const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList);
cc.assetManager.loadAny(preloadArr, null, null, (err, data) => {
this.loadEnd();
if (window && window["air"]) {
window["air"].hideAirClassLoading();
}
cc.debug.setDisplayStats(false);
});
},
loadEnd() {
this.initData();
this.initAudio();
this.initView();
// this.initListener();
},
_cantouch: null,
initData() {
// 所有全局变量 默认都是null
this._cantouch = true;
},
audioBtn: null,
initAudio() {
const audioNode = cc.find('Canvas/res/audio');
const getAudioByResName = (resName) => {
return audioNode.getChildByName(resName).getComponent(cc.AudioSource);
}
this.audioBtn = getAudioByResName('btn');
},
initView() {
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();
// 游戏结束时需要调用这个方法通知系统作业完成
onHomeworkFinish();
cc.audioEngine.play(this.audioBtn.clip, false, 0.8)
})
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();
cc.audioEngine.play(this.audioBtn.clip, false, 0.5)
})
},
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) {},
// ------------------------------------------------
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();
});
}
});
}
},
// ------------------------------------------
});
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.
......@@ -2,7 +2,8 @@
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"experimentalDecorators": true
"experimentalDecorators": true,
"sourceMap": true
},
"exclude": [
"node_modules",
......
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