Hello,
I am trying to figure things out with Xenko, an my current goal would be to get a certain text appear on screen.
I am using BasicCameraController sync script from one of the example projects (1.9 engine version, of course), and adding some code I figured out from engine sources and documentation:
public override void Update () {
if (DefaultSpriteBatch == null)
DefaultSpriteBatch = new SpriteBatch(Game.GraphicsDevice);
if (DefaultFont == null)
DefaultFont = Content.Load<SpriteFont>("XenkoDefaultFont");
PrintString();
ProcessInput();
UpdateTransform();
}
private void PrintString () {
DefaultSpriteBatch.Begin(Game.GraphicsContext);
DefaultSpriteBatch.DrawString(DefaultFont, "Whatever", new Vector2(0.5f, 0.5f), Color.Red);
DefaultSpriteBatch.End();
}
No text shows up on the screen. What am I doing wrong?