mirror of
https://github.com/stride3d/stride
synced 2026-05-24 10:19:21 +00:00
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
// Copyright (c) Xenko contributors (https://xenko.com) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
|
|
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.
|
|
using Xenko.Core.Mathematics;
|
|
using Xenko.Engine;
|
|
using Xenko.Graphics;
|
|
using Xenko.UI;
|
|
using Xenko.UI.Controls;
|
|
using Xenko.UI.Panels;
|
|
|
|
namespace SpriteStudioDemo
|
|
{
|
|
/// <summary>
|
|
/// The GUI script
|
|
/// </summary>
|
|
public class GuiScript : StartupScript
|
|
{
|
|
public SpriteFont Font { get; set; }
|
|
|
|
public override void Start()
|
|
{
|
|
var font = Font;
|
|
var textBlock = new TextBlock
|
|
{
|
|
Font = font,
|
|
TextSize = 18,
|
|
TextColor = Color.Gold,
|
|
Text = "Shoot : Touch in a vertical section where the Agent resides\n" +
|
|
"Move : Touch in the screen on the corresponding side of the Agent",
|
|
};
|
|
textBlock.SetCanvasRelativePosition(new Vector3(0.008f, 0.9f, 0));
|
|
|
|
Entity.Get<UIComponent>().Page = new UIPage { RootElement = new Canvas { Children = { textBlock } } };
|
|
}
|
|
}
|
|
}
|