This commit is contained in:
szrpf 2023-05-27 22:44:16 +08:00
parent 81ab8086b1
commit 2a9cda65a4
6 changed files with 48 additions and 44 deletions

View File

@ -532,7 +532,7 @@
{
"__type__": "cc.Node",
"_name": "DataBoard",
"_objFlags": 512,
"_objFlags": 1536,
"_parent": {
"__id__": 8
},
@ -598,7 +598,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "85BlQuDb9HZKuhEJxwyGF+"
"_id": "3bJREBcbZKLqDSz4LhRHLJ"
},
{
"__type__": "cc.Node",
@ -660,7 +660,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "49+qljSBFDb61/iC62OrLE"
"_id": "bcSyBGvI1Plqe/WzYr3VDx"
},
{
"__type__": "cc.Sprite",
@ -690,7 +690,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "6axJdFuntK570hv44oHwcH"
"_id": "e4rWXBZIdL3I37yOiMLUkp"
},
{
"__type__": "cc.Node",
@ -752,7 +752,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "66fiagvGZM17jxJS3e3R/O"
"_id": "d2mriWi19PIq4Szy+gixHz"
},
{
"__type__": "cc.Sprite",
@ -782,7 +782,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "e7StEP5C5EIY76/7RYAGaS"
"_id": "57C42kzTlNG6EIZG27BGvo"
},
{
"__type__": "cc.Node",
@ -844,7 +844,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "67uLDk0kNPMLrmc4a+2Lcz"
"_id": "86jFRLVFRCEZKk+7T7UNZp"
},
{
"__type__": "cc.Sprite",
@ -874,7 +874,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "19kjTk6vxDsqYAK8l1jO+n"
"_id": "3f+lBF49pJWLH2L7X5jaEt"
},
{
"__type__": "cc.Node",
@ -939,7 +939,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "930hpjvLBPHbYO0z9MngLs"
"_id": "4fBx2G8glEe4Xv4ozR+OYB"
},
{
"__type__": "cc.Label",
@ -972,7 +972,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "357EdNN/VPTaPJCzr51Jj0"
"_id": "b9AHQFFjJI0q9XNZUOYi0T"
},
{
"__type__": "cc.LabelOutline",
@ -990,7 +990,7 @@
"a": 255
},
"_width": 6,
"_id": "b4ov1ei1RJaZNO5PGzLCHc"
"_id": "6d1Kd0iBJCHptcQsvN7S7E"
},
{
"__type__": "9285eM4YhBJhL8+C569X294",
@ -1000,7 +1000,7 @@
"__id__": 8
},
"_enabled": true,
"_id": "1b9viFHsFJHrX+D1PV5q6g"
"_id": "98YtBkfwdHMbzYr7nANfcY"
},
{
"__type__": "1c152bUhQpJ6J1jGhQVUYf8",

View File

@ -235,11 +235,13 @@ 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){
let radian = -this.node.angle * Math.PI / 180;
let cos = Math.cos(radian);
let sin = Math.sin(radian);
this.customLabelNode.x = this.customLabelOffset.x * cos - this.customLabelOffset.y * sin;
this.customLabelNode.y = this.customLabelOffset.x * sin + this.customLabelOffset.y * cos;
}
let str = '';
let strs = this.customLabelStringSplit;
if (!this.monitorComp && this.customComponentName) {

View File

@ -287,11 +287,13 @@ var DataBoard = /** @class */ (function (_super) {
return;
if (!this.customLabelStringSplit)
return;
if (this.customLabelOffset.x !== 0 || this.customLabelOffset.y !== 0) {
var radian = -this.node.angle * Math.PI / 180;
var cos = Math.cos(radian);
var sin = Math.sin(radian);
this.customLabelNode.x = this.customLabelOffset.x * cos - this.customLabelOffset.y * sin;
this.customLabelNode.y = this.customLabelOffset.x * sin + this.customLabelOffset.y * cos;
}
var str = '';
var strs = this.customLabelStringSplit;
if (!this.monitorComp && this.customComponentName) {

File diff suppressed because one or more lines are too long

View File

@ -533,7 +533,7 @@
{
"__type__": "cc.Node",
"_name": "DataBoard",
"_objFlags": 512,
"_objFlags": 1536,
"_parent": {
"__id__": 8
},
@ -599,7 +599,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "85BlQuDb9HZKuhEJxwyGF+"
"_id": "3bJREBcbZKLqDSz4LhRHLJ"
},
{
"__type__": "cc.Node",
@ -661,7 +661,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "49+qljSBFDb61/iC62OrLE"
"_id": "bcSyBGvI1Plqe/WzYr3VDx"
},
{
"__type__": "cc.Sprite",
@ -691,7 +691,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "6axJdFuntK570hv44oHwcH"
"_id": "e4rWXBZIdL3I37yOiMLUkp"
},
{
"__type__": "cc.Node",
@ -753,7 +753,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "66fiagvGZM17jxJS3e3R/O"
"_id": "d2mriWi19PIq4Szy+gixHz"
},
{
"__type__": "cc.Sprite",
@ -783,7 +783,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "e7StEP5C5EIY76/7RYAGaS"
"_id": "57C42kzTlNG6EIZG27BGvo"
},
{
"__type__": "cc.Node",
@ -845,7 +845,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "67uLDk0kNPMLrmc4a+2Lcz"
"_id": "86jFRLVFRCEZKk+7T7UNZp"
},
{
"__type__": "cc.Sprite",
@ -875,7 +875,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "19kjTk6vxDsqYAK8l1jO+n"
"_id": "3f+lBF49pJWLH2L7X5jaEt"
},
{
"__type__": "cc.Node",
@ -940,7 +940,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "930hpjvLBPHbYO0z9MngLs"
"_id": "4fBx2G8glEe4Xv4ozR+OYB"
},
{
"__type__": "cc.Label",
@ -973,7 +973,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "357EdNN/VPTaPJCzr51Jj0"
"_id": "b9AHQFFjJI0q9XNZUOYi0T"
},
{
"__type__": "cc.LabelOutline",
@ -991,7 +991,7 @@
"a": 255
},
"_width": 6,
"_id": "b4ov1ei1RJaZNO5PGzLCHc"
"_id": "6d1Kd0iBJCHptcQsvN7S7E"
},
{
"__type__": "9285eM4YhBJhL8+C569X294",
@ -1001,7 +1001,7 @@
"__id__": 8
},
"_enabled": true,
"_id": "1b9viFHsFJHrX+D1PV5q6g"
"_id": "98YtBkfwdHMbzYr7nANfcY"
},
{
"__type__": "1c152bUhQpJ6J1jGhQVUYf8",

View File

@ -515,8 +515,8 @@
"relativePath": "Texture"
},
"2d2f792f-a40c-49bb-a189-ed176a246e49": {
"asset": 1685197458380,
"meta": 1685197458389,
"asset": 1685198509889,
"meta": 1685198509897,
"relativePath": "Scene\\helloworld.fire"
},
"a8027877-d8d6-4645-97a0-52d4a0123dba": {
@ -534,14 +534,14 @@
"meta": 1685194622776,
"relativePath": "Texture\\zhizhuxia.png"
},
"9285e338-6210-4984-bf3e-0b9ebd5f6f78": {
"asset": 1685197428895,
"meta": 1685197433673,
"relativePath": "Script\\Hero.ts"
},
"1c1526d4-850a-49e8-9d63-1a14155187fc": {
"asset": 1685197605521,
"meta": 1685197607883,
"asset": 1685198389728,
"meta": 1685198397873,
"relativePath": "Script\\DataBoard.ts"
},
"9285e338-6210-4984-bf3e-0b9ebd5f6f78": {
"asset": 1685198371101,
"meta": 1685198397889,
"relativePath": "Script\\Hero.ts"
}
}