mirror of
https://github.com/galacean/engine.git
synced 2026-05-06 22:23:05 +08:00
fix: init outline width
This commit is contained in:
@@ -346,6 +346,9 @@ export class TextRenderer extends Renderer implements ITextRenderer {
|
||||
this._font = engine._textDefaultFont;
|
||||
this._addResourceReferCount(this._font, 1);
|
||||
this.setMaterial(engine._basicResources.textDefaultMaterial);
|
||||
const shaderData = this.shaderData;
|
||||
shaderData.setFloat(TextRenderer._outlineWidthProperty, this._outlineWidth);
|
||||
shaderData.setColor(TextRenderer._outlineColorProperty, this._outlineColor);
|
||||
//@ts-ignore
|
||||
this._color._onValueChanged = this._onColorChanged.bind(this);
|
||||
// @ts-ignore
|
||||
|
||||
@@ -274,6 +274,9 @@ export class Text extends UIRenderer implements ITextRenderer {
|
||||
this.raycastEnabled = false;
|
||||
// @ts-ignore
|
||||
this.setMaterial(engine._basicResources.textDefaultMaterial);
|
||||
const shaderData = this.shaderData;
|
||||
shaderData.setFloat(Text._outlineWidthProperty, this._outlineWidth);
|
||||
shaderData.setColor(Text._outlineColorProperty, this._outlineColor);
|
||||
// @ts-ignore
|
||||
this._outlineColor._onValueChanged = this._onOutlineColorChanged.bind(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user