Commit eb739a36 authored by liujiangnan's avatar liujiangnan

feat: 全屏

parent 2a172259
......@@ -87,25 +87,25 @@
"__id__": 21
},
{
"__id__": 62
"__id__": 72
},
{
"__id__": 66
"__id__": 76
},
{
"__id__": 68
"__id__": 78
}
],
"_active": true,
"_components": [
{
"__id__": 74
"__id__": 84
},
{
"__id__": 75
"__id__": 85
},
{
"__id__": 76
"__id__": 86
}
],
"_prefab": null,
......@@ -931,12 +931,18 @@
"_children": [
{
"__id__": 22
},
{
"__id__": 61
},
{
"__id__": 66
}
],
"_active": true,
"_components": [
{
"__id__": 61
"__id__": 71
}
],
"_prefab": null,
......@@ -1341,7 +1347,7 @@
"ctor": "Float64Array",
"array": [
-821.106,
1.519,
5.519,
0,
0,
0,
......@@ -1654,8 +1660,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-822.911,
1.519,
-821.911,
4.519,
0,
0,
0,
......@@ -1898,7 +1904,7 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 8,
"_left": -238.91099999999994,
"_left": -237.91099999999994,
"_right": 0,
"_top": 0,
"_bottom": 0,
......@@ -1958,8 +1964,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-825.192,
1.519,
-822.192,
4.519,
0,
0,
0,
......@@ -2202,7 +2208,7 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 8,
"_left": -241.192,
"_left": -238.192,
"_right": 0,
"_top": 0,
"_bottom": 0,
......@@ -2676,6 +2682,424 @@
"_originalHeight": 0,
"_id": "70m+PVzhhBpKXNmtdvKZ+d"
},
{
"__type__": "cc.Node",
"_name": "fullscreen",
"_objFlags": 0,
"_parent": {
"__id__": 21
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 62
},
{
"__id__": 63
},
{
"__id__": 64
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 64,
"height": 64
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
751.628,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "32l6G9pQJOcZChahgmE4cU"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 61
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "e6977100-ddff-47b9-8887-5f6476bdca44"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "06ezJzYdpJt5zSfzWdMn2m"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 61
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 32,
"_left": 0,
"_right": -95.12800000000004,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "b7Ro9KwAtNfIUBPHuaYp3Q"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 61
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 65
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "6c03HtVU1AEoUmE6o86xss"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "280c3rsZJJKnZ9RqbALVwtK",
"handler": "fullScreen",
"customEventData": ""
},
{
"__type__": "cc.Node",
"_name": "exitfull",
"_objFlags": 0,
"_parent": {
"__id__": 21
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 67
},
{
"__id__": 68
},
{
"__id__": 69
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 62,
"height": 62
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
751.628,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e0OzWg1sZCN5/gM4giOAMo"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 66
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "0a604615-4a1e-4bb1-b106-3a95f04d3e88"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "c4iYlOEjlP2r3+A4Sc9aCx"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 66
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 32,
"_left": 0,
"_right": -94.12800000000004,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "53meCrSy1LOaAujWL+Wt8W"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 66
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 70
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "843VW785JMMqmhMI6LNjMI"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "280c3rsZJJKnZ9RqbALVwtK",
"handler": "exitFullScreen",
"customEventData": ""
},
{
"__type__": "cc.Widget",
"_name": "",
......@@ -2714,13 +3138,13 @@
"_active": false,
"_components": [
{
"__id__": 63
"__id__": 73
},
{
"__id__": 64
"__id__": 74
},
{
"__id__": 65
"__id__": 75
}
],
"_prefab": null,
......@@ -2776,7 +3200,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 62
"__id__": 72
},
"_enabled": true,
"_materials": [
......@@ -2808,7 +3232,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 62
"__id__": 72
},
"_enabled": true,
"alignMode": 1,
......@@ -2835,7 +3259,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 62
"__id__": 72
},
"_enabled": true,
"_id": "beaGv1g0JBZ59RUOJpzt0W"
......@@ -2851,7 +3275,7 @@
"_active": false,
"_components": [
{
"__id__": 67
"__id__": 77
}
],
"_prefab": null,
......@@ -2907,7 +3331,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 66
"__id__": 76
},
"_enabled": true,
"alignMode": 1,
......@@ -2938,16 +3362,16 @@
},
"_children": [
{
"__id__": 69
"__id__": 79
}
],
"_active": true,
"_components": [
{
"__id__": 72
"__id__": 82
},
{
"__id__": 73
"__id__": 83
}
],
"_prefab": null,
......@@ -3003,16 +3427,16 @@
"_name": "title",
"_objFlags": 0,
"_parent": {
"__id__": 68
"__id__": 78
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 70
"__id__": 80
},
{
"__id__": 71
"__id__": 81
}
],
"_prefab": null,
......@@ -3068,7 +3492,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 69
"__id__": 79
},
"_enabled": true,
"_materials": [
......@@ -3103,7 +3527,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 69
"__id__": 79
},
"_enabled": true,
"alignMode": 1,
......@@ -3130,7 +3554,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 68
"__id__": 78
},
"_enabled": true,
"_materials": [
......@@ -3162,7 +3586,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 68
"__id__": 78
},
"_enabled": true,
"alignMode": 1,
......
......@@ -226,8 +226,9 @@ cc.Class({
});
this.barTag.off(cc.Node.EventType.TOUCH_MOVE);
this.barTag.on(cc.Node.EventType.TOUCH_MOVE,(e) => {
console.log("TOUCH_MOVE");
var delta = e.getDelta();
let newX = this.barTag.x+delta.x*2;
let newX = this.barTag.x+delta.x;
newX = Math.min(maxX, Math.max(newX, minX));
this.barTag.x = newX;
......@@ -238,10 +239,10 @@ cc.Class({
});
this.barTag.off(cc.Node.EventType.TOUCH_ENDED);
this.barTag.on(cc.Node.EventType.TOUCH_ENDED, (e) => {
console.log("TOUCH_ENDED");
this.userDragStart = false;
this.updateBarByPos(this.barTag.x);
this.triggerInteractive()
console.log("TOUCH_ENDED");
this.userDragStart = false;
this.updateBarByPos(this.barTag.x);
this.triggerInteractive()
});
this.barTag.on(cc.Node.EventType.MOUSE_UP, (e) => {
console.log("MOUSE_UP");
......@@ -315,7 +316,6 @@ cc.Class({
});
const animaNode = animNode['animaNode'];
animaNode.scale = 0.667;
animaNode.x = 500;
const db = animaNode.getComponent(dragonBones.ArmatureDisplay);
const anis = db.getAnimationNames("armatureName");
......@@ -389,7 +389,7 @@ cc.Class({
const minX = 0;
let newX = percent * maxX;
newX = Math.min(maxX, Math.max(newX, minX));
this.barTag.x = newX;
this.barTag.x = newX>=(maxX-90)?(maxX-90):newX;
this.bar.width = newX;
this.bar.x = 0 - (maxX / 2);
},
......@@ -465,6 +465,43 @@ cc.Class({
cc.audioEngine.playEffect(audio.clip, false);
},
isVideoFull: false,
fullScreen() {
if (this.isVideoFull) {
return;
}
console.log("====进入全屏===");
this.isVideoFull = true;
cc.find(`Canvas/Controls/fullscreen`).active = !this.isVideoFull;
cc.find(`Canvas/Controls/exitfull`).active = this.isVideoFull;
cc.find(`Canvas/video_node`).width = this.node.width;
cc.find(`Canvas/video_node`).height = this.node.height;
cc.find(`Canvas/bg_empty`).width = this.node.width;
cc.find(`Canvas/bg_empty`).height = this.node.height;
this.videoPlayer.node.width = this.node.width;
this.videoPlayer.node.height = this.node.height;
},
exitFullScreen() {
if (!this.isVideoFull) {
return;
}
console.log("====退出全屏===");
this.isVideoFull = false;
cc.find(`Canvas/Controls/fullscreen`).active = !this.isVideoFull;
cc.find(`Canvas/Controls/exitfull`).active = this.isVideoFull;
cc.find(`Canvas/video_node`).width = 1377;
cc.find(`Canvas/video_node`).height = 775;
cc.find(`Canvas/bg_empty`).width = 1377;
cc.find(`Canvas/bg_empty`).height = 775;
this.videoPlayer.node.width = 1377;
this.videoPlayer.node.height = 775;
},
// called every frame
update: function (dt) {
......@@ -499,6 +536,9 @@ cc.Class({
if (this.pauseButton.node.active) {
this.pauseButton.node.active = false;
}
if (this.restartButton.node.active) {
this.playButton.node.active = false;
}
}
}
......
......@@ -2,7 +2,7 @@
export const defaultData = {
"title": "Hello Apples",
"tipSwitch": 1,
"tipSwitch": 0,
"audio": "https://staging-teach.cdn.ireadabc.com/c03129693e6cabf061661fba349fa031.mp3",
"imgAni": {
"ske": {
......
{
"ver": "2.3.5",
"uuid": "eca6275d-4886-4508-b957-b359c4d6c6b4",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 64,
"height": 64,
"platformSettings": {},
"subMetas": {
"exitfull": {
"ver": "1.0.4",
"uuid": "0a604615-4a1e-4bb1-b106-3a95f04d3e88",
"rawTextureUuid": "eca6275d-4886-4508-b957-b359c4d6c6b4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 1,
"trimY": 1,
"width": 62,
"height": 62,
"rawWidth": 64,
"rawHeight": 64,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "2da91cfa-5880-4e41-bfbd-997e31f618c6",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 64,
"height": 64,
"platformSettings": {},
"subMetas": {
"fullscreen": {
"ver": "1.0.4",
"uuid": "e6977100-ddff-47b9-8887-5f6476bdca44",
"rawTextureUuid": "2da91cfa-5880-4e41-bfbd-997e31f618c6",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 64,
"height": 64,
"rawWidth": 64,
"rawHeight": 64,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ 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