Commit 791aa3e3 authored by liujiangnan's avatar liujiangnan

feat: showTips

parent 0431cb00
...@@ -287,15 +287,18 @@ ...@@ -287,15 +287,18 @@
}, },
{ {
"__id__": 10 "__id__": 10
},
{
"__id__": 21
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 21 "__id__": 30
}, },
{ {
"__id__": 22 "__id__": 31
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -455,7 +458,7 @@ ...@@ -455,7 +458,7 @@
"__id__": 14 "__id__": 14
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 19 "__id__": 19
...@@ -892,6 +895,419 @@ ...@@ -892,6 +895,419 @@
"_originalHeight": 720, "_originalHeight": 720,
"_id": "1bguARpx9AQLLu5di8IlgL" "_id": "1bguARpx9AQLLu5di8IlgL"
}, },
{
"__type__": "cc.Node",
"_name": "tipsLayer",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [
{
"__id__": 22
},
{
"__id__": 25
}
],
"_active": false,
"_components": [
{
"__id__": 29
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
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": "8dpIhzuitKjLurWo/y+zqQ"
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 21
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
},
{
"__id__": 24
}
],
"_prefab": null,
"_opacity": 0,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
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": "ccrzoppA9P3Jxmw63M2SK2"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "c48X7gXABAUKUb5HwLkjQB"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 2,
"_originalHeight": 2,
"_id": "6e0q1iDfpDZ7oBFcQZ5i8T"
},
{
"__type__": "cc.Node",
"_name": "tips",
"_objFlags": 0,
"_parent": {
"__id__": 21
},
"_children": [
{
"__id__": 26
}
],
"_active": true,
"_components": [
{
"__id__": 28
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 398,
"height": 172
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
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": "bc+NX8srtGCpx8x3MHUErI"
},
{
"__type__": "cc.Node",
"_name": "label",
"_objFlags": 0,
"_parent": {
"__id__": 25
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 27
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 587.23,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
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": "3azAiHeUBNDK9qvDCJVcIo"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 26
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "LabelLabelLabelLabelLabelLabel",
"_N$string": "LabelLabelLabelLabelLabelLabel",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "4e+eKpO8ZAGpll0BY9jZOn"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "e1f510a2-a688-49f7-8de5-9501732f9e31"
},
"_type": 1,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "ffhjvN3nlAF7lGhW+hmTcV"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 21
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1280,
"_originalHeight": 720,
"_id": "b3B9SCYStJNpe7QmCD2vYN"
},
{ {
"__type__": "d98e34LKINGEIpG3utycEds", "__type__": "d98e34LKINGEIpG3utycEds",
"_name": "", "_name": "",
......
...@@ -26,6 +26,21 @@ export default class NewClass extends middleLayerBase { ...@@ -26,6 +26,21 @@ export default class NewClass extends middleLayerBase {
this.hideMask(); this.hideMask();
} }
} }
showTips(str: string) {
const tipsLayer = cc.find('middleLayer/tipsLayer');
tipsLayer.active = true;
const label = cc.find('middleLayer/tipsLayer/tips/label');
label.getComponent(cc.Label).string = ` ${str} `;
const tips = cc.find('middleLayer/tipsLayer/tips');
tips.width = label.width + 50;
cc.tween(tips)
.set({ opacity: 255 })
.to(2, { opacity: 0 })
.call(() => {
tipsLayer.active = false;
})
.start();
}
showMask() { showMask() {
} }
...@@ -50,7 +65,6 @@ export default class NewClass extends middleLayerBase { ...@@ -50,7 +65,6 @@ export default class NewClass extends middleLayerBase {
const laodingLayer = cc.find('middleLayer/loadingLayer'); const laodingLayer = cc.find('middleLayer/loadingLayer');
laodingLayer.active = true; laodingLayer.active = true;
laodingLayer.zIndex = 9999;
const loading = cc.find('middleLayer/loadingLayer/loading'); const loading = cc.find('middleLayer/loadingLayer/loading');
const anim = loading.getComponent(cc.Animation) const anim = loading.getComponent(cc.Animation)
......
{
"ver": "2.3.5",
"uuid": "b54b0342-3b5c-44ab-9995-12ef00d9919d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 398,
"height": 172,
"platformSettings": {},
"subMetas": {
"bg_tip": {
"ver": "1.0.4",
"uuid": "e1f510a2-a688-49f7-8de5-9501732f9e31",
"rawTextureUuid": "b54b0342-3b5c-44ab-9995-12ef00d9919d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 398,
"height": 172,
"rawWidth": 398,
"rawHeight": 172,
"borderTop": 35,
"borderBottom": 35,
"borderLeft": 35,
"borderRight": 35,
"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