diff --git a/cocos/3d/ui/components/label-component.ts b/cocos/3d/ui/components/label-component.ts index 1618c7456c..c64bd31b7e 100644 --- a/cocos/3d/ui/components/label-component.ts +++ b/cocos/3d/ui/components/label-component.ts @@ -179,6 +179,7 @@ export class LabelComponent extends UIRenderComponent { return this._string; } set string (value) { + value = value.toString(); if (this._string === value) { return; } diff --git a/cocos/3d/ui/components/label-outline-component.ts b/cocos/3d/ui/components/label-outline-component.ts index 6f2b07e8c1..a380279c00 100644 --- a/cocos/3d/ui/components/label-outline-component.ts +++ b/cocos/3d/ui/components/label-outline-component.ts @@ -37,12 +37,18 @@ * node.parent = this.node; */ +import { Component } from '../../../components'; +import { ccclass, executionOrder, menu, property } from '../../../core/data/class-decorator'; import { Color } from '../../../core/value-types'; import { LabelComponent } from './label-component'; -import { UIComponent } from './ui-component'; -export class LabelOutlineComponent extends UIComponent { +@ccclass('cc.LabelOutlineComponent') +@executionOrder(100) +@menu('UI/Render/LabelOutline') +export class LabelOutlineComponent extends Component { + @property private _color = new Color(255, 255, 255, 255); + @property private _width = 1; /** @@ -53,9 +59,11 @@ export class LabelOutlineComponent extends UIComponent { * @example * outline.color = new cc.Color(0.5, 0.3, 0.7, 1.0);; */ + @property get color () { return this._color; } + set color (value) { if (this._color === value){ return; @@ -73,6 +81,7 @@ export class LabelOutlineComponent extends UIComponent { * @example * outline.width = 3; */ + @property get width () { return this._width; }