Files
FlaxEngine/Source/Editor/SceneGraph/Actors/TextRenderNode.cs
2021-01-02 14:28:49 +01:00

33 lines
910 B
C#

// Copyright (c) 2012-2021 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);
}
}
}