This repository has been archived on 2019-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2016-11-14 14:09:44 +00:00
|
|
|
|
using Microsoft.Xna.Framework;
|
|
|
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
|
|
|
using MyMonoGame.GUI;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Galactic_Colors_Control_GUI.States
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Only title in screen (and state change)
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class TitleState : State
|
|
|
|
|
{
|
|
|
|
|
private DateTime _changeDate;
|
|
|
|
|
private State _target;
|
|
|
|
|
|
|
|
|
|
public TitleState()
|
|
|
|
|
{
|
|
|
|
|
_target = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TitleState(State target, TimeSpan time)
|
|
|
|
|
{
|
|
|
|
|
_target = target;
|
|
|
|
|
_changeDate = DateTime.Now.Add(time);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Draw(SpriteBatch spritebatch)
|
|
|
|
|
{
|
|
|
|
|
Game.singleton.background.Draw(spritebatch);
|
2016-12-08 10:51:19 +00:00
|
|
|
|
Game.singleton.GUI.Label(new MyMonoGame.Vector(Game.singleton.ScreenWidth / 2, Game.singleton.ScreenHeight / 2), Game.singleton.multilang.Get("GCC", Game.singleton.config.lang), Game.singleton.GUI.content.GetFont("title"), new MyMonoGame.Colors(Color.White), Manager.textAlign.centerCenter);
|
2016-11-14 14:09:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Update()
|
|
|
|
|
{
|
|
|
|
|
if (_target != null)
|
|
|
|
|
{
|
|
|
|
|
if (DateTime.Now > _changeDate) { Game.singleton.gameState = _target; }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-11-21 11:46:35 +00:00
|
|
|
|
}
|