Files
FlaxEngine/Source/Editor/SceneGraph/Actors/TextRenderNode.cs
2023-01-10 15:29:37 +01:00

33 lines
910 B
C#

// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using FlaxEngine;
namespace FlaxEditor.SceneGraph.Actors
{
/// <summary>
/// Scene tree node for <see cref="TextRender"/> actor type.
/// </summary>
/// <seealso cref="ActorNode" />
[HideInEditor]
public sealed class TextRenderNode : ActorNode
{
/// <inheritdoc />
public TextRenderNode(Actor actor)
: base(actor)
{
}
/// <inheritdoc />
public override void PostSpawn()
{
base.PostSpawn();
// Setup for default values
var text = (TextRender)Actor;
text.Text = "My Text";
text.Font = FlaxEngine.Content.LoadAsyncInternal<FontAsset>(EditorAssets.PrimaryFont);
text.Material = FlaxEngine.Content.LoadAsyncInternal<MaterialBase>(EditorAssets.DefaultFontMaterial);
}
}
}