diff --git a/cocos/core/assets/sprite-frame.ts b/cocos/core/assets/sprite-frame.ts index 80a22ed4bf..fb895e05f1 100644 --- a/cocos/core/assets/sprite-frame.ts +++ b/cocos/core/assets/sprite-frame.ts @@ -149,8 +149,12 @@ const temp_uvs: IUV[] = [{ u: 0, v: 0 }, { u: 0, v: 0 }, { u: 0, v: 0 }, { u: 0, * * // Second way to use a SpriteFrame * const self = this; - * const url = "assets/PurpleMonster/icon"; + * const url = "test_assets/PurpleMonster"; * cc.loader.loadRes(url, (err, imageAsset) => { + * if(err){ + * return; + * } + * * const node = new Node("New Sprite"); * const sprite = node.addComponent(SpriteComponent); * const spriteFrame = new SpriteFrame(); diff --git a/cocos/ui/components/graphics-component.ts b/cocos/ui/components/graphics-component.ts index cf78f7eed3..a779392aed 100644 --- a/cocos/ui/components/graphics-component.ts +++ b/cocos/ui/components/graphics-component.ts @@ -180,6 +180,16 @@ export class GraphicsComponent extends UIRenderComponent { return this._color; } + set color (value) { + if (this._color === value) { + return; + } + + this._color.set(value); + this._updateColor(); + this.markForUpdateRenderData(); + } + public static LineJoin = LineJoin; public static LineCap = LineCap; public impl: Impl | null = null;