// 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 PhysicsSample { /// /// The script in charge of displaying the UI /// public class GuiScript : StartupScript { public SpriteFont Font; public override void Start() { base.Start(); var textBlock = new TextBlock { Text = "Shoot the cubes!", Font = Font, TextColor = Color.White, TextSize = 60 }; textBlock.SetCanvasPinOrigin(new Vector3(0.5f, 0.5f, 0)); textBlock.SetCanvasRelativePosition(new Vector3(0.5f, 0.9f, 0f)); Entity.Get().Page = new UIPage { RootElement = new Canvas { Children = { textBlock } } }; } } }