This commit is contained in:
szrpf 2023-05-27 22:54:23 +08:00
parent ff57cedfd7
commit d34094d0ba
7 changed files with 38 additions and 38 deletions

View File

@ -598,7 +598,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "3bJREBcbZKLqDSz4LhRHLJ"
"_id": "02aPEAdt9H1KZFvp0jiC6V"
},
{
"__type__": "cc.Node",
@ -660,7 +660,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "bcSyBGvI1Plqe/WzYr3VDx"
"_id": "58D9GcW51Oq4ww7qAoD4YL"
},
{
"__type__": "cc.Sprite",
@ -690,7 +690,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "e4rWXBZIdL3I37yOiMLUkp"
"_id": "6b/PokY7ZFrp5yZoggTldA"
},
{
"__type__": "cc.Node",
@ -752,7 +752,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "d2mriWi19PIq4Szy+gixHz"
"_id": "46WE2ar3VOaakiPJum+yPu"
},
{
"__type__": "cc.Sprite",
@ -782,7 +782,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "57C42kzTlNG6EIZG27BGvo"
"_id": "b2s/+gsF5Ds4NYzdUb3qEU"
},
{
"__type__": "cc.Node",
@ -844,7 +844,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "86jFRLVFRCEZKk+7T7UNZp"
"_id": "b0ukWnN9lHgaSyvpJ44q2K"
},
{
"__type__": "cc.Sprite",
@ -874,7 +874,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "3f+lBF49pJWLH2L7X5jaEt"
"_id": "7aJNz2zWtOBp75N1TERtdX"
},
{
"__type__": "cc.Node",
@ -939,7 +939,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "4fBx2G8glEe4Xv4ozR+OYB"
"_id": "a2hqpAZktGbKAnkSVtm1zl"
},
{
"__type__": "cc.Label",
@ -956,8 +956,8 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "坐标:\t0.0,\t0.0\n角度:\t0.0°,\t弧度:\t0.0π\n世界坐标:\t540.0,\t960.0\nhp:\t100.0\t\t\t\t\t\tmp:\t60.0\n5.0",
"_N$string": "坐标:\t0.0,\t0.0\n角度:\t0.0°,\t弧度:\t0.0π\n世界坐标:\t540.0,\t960.0\nhp:\t100.0\t\t\t\t\t\tmp:\t60.0\n5.0",
"_string": "坐标:\t0.0,\t0.0\n角度:\t0.0°,\t弧度:\t0.0π\n世界坐标:\t540.0,\t960.0\nhp:\t100.0\t\tmp:\t60.0\n5.0",
"_N$string": "坐标:\t0.0,\t0.0\n角度:\t0.0°,\t弧度:\t0.0π\n世界坐标:\t540.0,\t960.0\nhp:\t100.0\t\tmp:\t60.0\n5.0",
"_fontSize": 60,
"_lineHeight": 72,
"_enableWrapText": true,
@ -972,7 +972,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "b9AHQFFjJI0q9XNZUOYi0T"
"_id": "17v4VMcstH1bzbpazMkeve"
},
{
"__type__": "cc.LabelOutline",
@ -990,7 +990,7 @@
"a": 255
},
"_width": 6,
"_id": "6d1Kd0iBJCHptcQsvN7S7E"
"_id": "95XQUbLhtI86PHFI+wIARD"
},
{
"__type__": "9285eM4YhBJhL8+C569X294",
@ -1030,7 +1030,7 @@
"_collideBoxOpacity": 100,
"_isCustomLabelActive": true,
"customComponentName": "Hero",
"_customLabelString": "坐标:x,y\n角度:angle,弧度:radian\n世界坐标:wp\nhp:#hp mp:#mp\n#equip.shoe.attr.speed",
"_customLabelString": "坐标:x,y\n角度:angle,弧度:radian\n世界坐标:wp\nhp:#hp mp:#mp\n#equip.shoe.attr.speed",
"_customLabelOffset": {
"__type__": "cc.Vec2",
"x": 0,

View File

@ -96,7 +96,7 @@ export default class DataBoard extends cc.Component {
private set customLabelString(value: string) {
this._customLabelString = value;
this.customLabelStringSplit = value
.replace(/,|/g, '_~_').replace(/:|/g, '_!_').replace(/ /g, '_@_')
.replace(/,|/g, '_~_').replace(/:|/g, '_!_').replace(/ /g, '_@_')
.replace(/_*\n_*/g, '_\n_').split('_');
}
@property
@ -235,7 +235,7 @@ export default class DataBoard extends cc.Component {
protected update() {
if (!this.isCustomLabelActive) return;
if (!this.customLabelStringSplit) return;
if(this.customLabelOffset.x !== 0 || this.customLabelOffset.y !== 0){
if (this.customLabelOffset.x !== 0 || this.customLabelOffset.y !== 0) {
let radian = -this.node.angle * Math.PI / 180;
let cos = Math.cos(radian);
let sin = Math.sin(radian);

View File

@ -154,7 +154,7 @@ var DataBoard = /** @class */ (function (_super) {
set: function (value) {
this._customLabelString = value;
this.customLabelStringSplit = value
.replace(/,|/g, '_~_').replace(/:|/g, '_!_').replace(/ /g, '_@_')
.replace(/,|/g, '_~_').replace(/:|/g, '_!_').replace(/ /g, '_@_')
.replace(/_*\n_*/g, '_\n_').split('_');
},
enumerable: false,

File diff suppressed because one or more lines are too long

View File

@ -599,7 +599,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "3bJREBcbZKLqDSz4LhRHLJ"
"_id": "02aPEAdt9H1KZFvp0jiC6V"
},
{
"__type__": "cc.Node",
@ -661,7 +661,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "bcSyBGvI1Plqe/WzYr3VDx"
"_id": "58D9GcW51Oq4ww7qAoD4YL"
},
{
"__type__": "cc.Sprite",
@ -691,7 +691,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "e4rWXBZIdL3I37yOiMLUkp"
"_id": "6b/PokY7ZFrp5yZoggTldA"
},
{
"__type__": "cc.Node",
@ -753,7 +753,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "d2mriWi19PIq4Szy+gixHz"
"_id": "46WE2ar3VOaakiPJum+yPu"
},
{
"__type__": "cc.Sprite",
@ -783,7 +783,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "57C42kzTlNG6EIZG27BGvo"
"_id": "b2s/+gsF5Ds4NYzdUb3qEU"
},
{
"__type__": "cc.Node",
@ -845,7 +845,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "86jFRLVFRCEZKk+7T7UNZp"
"_id": "b0ukWnN9lHgaSyvpJ44q2K"
},
{
"__type__": "cc.Sprite",
@ -875,7 +875,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "3f+lBF49pJWLH2L7X5jaEt"
"_id": "7aJNz2zWtOBp75N1TERtdX"
},
{
"__type__": "cc.Node",
@ -940,7 +940,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "4fBx2G8glEe4Xv4ozR+OYB"
"_id": "a2hqpAZktGbKAnkSVtm1zl"
},
{
"__type__": "cc.Label",
@ -957,8 +957,8 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "坐标:\t0.0,\t0.0\n角度:\t0.0°,\t弧度:\t0.0π\n世界坐标:\t540.0,\t960.0\nhp:\t100.0\t\t\t\t\t\tmp:\t60.0\n5.0",
"_N$string": "坐标:\t0.0,\t0.0\n角度:\t0.0°,\t弧度:\t0.0π\n世界坐标:\t540.0,\t960.0\nhp:\t100.0\t\t\t\t\t\tmp:\t60.0\n5.0",
"_string": "坐标:\t0.0,\t0.0\n角度:\t0.0°,\t弧度:\t0.0π\n世界坐标:\t540.0,\t960.0\nhp:\t100.0\t\tmp:\t60.0\n5.0",
"_N$string": "坐标:\t0.0,\t0.0\n角度:\t0.0°,\t弧度:\t0.0π\n世界坐标:\t540.0,\t960.0\nhp:\t100.0\t\tmp:\t60.0\n5.0",
"_fontSize": 60,
"_lineHeight": 72,
"_enableWrapText": true,
@ -973,7 +973,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "b9AHQFFjJI0q9XNZUOYi0T"
"_id": "17v4VMcstH1bzbpazMkeve"
},
{
"__type__": "cc.LabelOutline",
@ -991,7 +991,7 @@
"a": 255
},
"_width": 6,
"_id": "6d1Kd0iBJCHptcQsvN7S7E"
"_id": "95XQUbLhtI86PHFI+wIARD"
},
{
"__type__": "9285eM4YhBJhL8+C569X294",
@ -1031,7 +1031,7 @@
"_collideBoxOpacity": 100,
"_isCustomLabelActive": true,
"customComponentName": "Hero",
"_customLabelString": "坐标:x,y\n角度:angle,弧度:radian\n世界坐标:wp\nhp:#hp mp:#mp\n#equip.shoe.attr.speed",
"_customLabelString": "坐标:x,y\n角度:angle,弧度:radian\n世界坐标:wp\nhp:#hp mp:#mp\n#equip.shoe.attr.speed",
"_customLabelOffset": {
"__type__": "cc.Vec2",
"x": 0,

View File

@ -515,8 +515,8 @@
"relativePath": "Texture"
},
"2d2f792f-a40c-49bb-a189-ed176a246e49": {
"asset": 1685198509889,
"meta": 1685198509897,
"asset": 1685199229658,
"meta": 1685199229670,
"relativePath": "Scene\\helloworld.fire"
},
"a8027877-d8d6-4645-97a0-52d4a0123dba": {
@ -540,8 +540,8 @@
"relativePath": "Script\\Hero.ts"
},
"1c1526d4-850a-49e8-9d63-1a14155187fc": {
"asset": 1685198725140,
"meta": 1685198735447,
"asset": 1685199089854,
"meta": 1685199090808,
"relativePath": "Script\\DataBoard.ts"
}
}

View File

@ -19,7 +19,7 @@
"children": [
{
"width": 459,
"height": 317.140625,
"height": 316.828125,
"type": "panel",
"active": 0,
"children": [
@ -28,7 +28,7 @@
},
{
"width": 459,
"height": 599.359375,
"height": 599.671875,
"type": "panel",
"active": 0,
"children": [
@ -44,7 +44,7 @@
"children": [
{
"width": 980,
"height": 564.453125,
"height": 564.3125,
"type": "panel",
"active": 0,
"children": [
@ -53,7 +53,7 @@
},
{
"width": 980,
"height": 352.03125,
"height": 352.1875,
"type": "panel",
"active": 1,
"children": [