Esempio n. 1
0
 /// <summary>
 /// Создаёт новый экземпляр класса <see cref="NewGamePanel"/>.
 /// </summary>
 /// <param name="texture">The texture.</param>
 public NewGamePanel(SourceryGame game)
 {
     Type = PanelTypes.NewGame;
       _Game = game;
       _Texture = game.Panel;
       _StartGame = new Button(game,"Новая игра");
       _StartGame.OnValueChanged += OnStartGame;
       Items = new List<Control>();
       LoadLevels();
 }
Esempio n. 2
0
 /// <summary>
 /// Создаёт новый экземпляр класса <see cref="SaveLoadPanel"/>.
 /// </summary>
 /// <param name="game">Ссылка на игру</param>
 /// <param name="IsSave">if set to <c>true</c> [is save].</param>
 public SaveLoadPanel(SourceryGame game, bool IsSave)
 {
     _Game = game;
       _Texture = game.Panel;
       Items = new List<Control>();
       var _ButtonFont = game.Font;
       if (IsSave)
     _SaveLoadButton = new Button(game, "Сохранить");
       else
     _SaveLoadButton = new Button(game, "Загрузить");
       LoadGames();
 }
Esempio n. 3
0
 /// <summary>
 /// Создаёт новый экземпляр класса <see cref="Dialog"/>.
 /// </summary>
 /// <param name="game">Ссылка на игру.</param>
 /// <param name="text">Текст сообщения.</param>
 public Dialog(SourceryGame game, string text)
 {
     _Panel = game.Panel;
       _Font = game.Font;
       _Ok = new Button(game, "Oк");
       _Ok.OnValueChanged += OnOkClick;
       _Cancel = new Button(game, "Отмена");
       _Cancel.OnValueChanged += OnCancelClick;
       _Text = text;
       _ClientWidth = game.graphics.GraphicsDevice.Viewport.Width;
       _ClientHeight = game.graphics.GraphicsDevice.Viewport.Height;
       _DialogRect = new Rectangle(_ClientWidth / 2 - 200, _ClientHeight / 2 - 100, 400, 200);
 }
Esempio n. 4
0
 /// <summary>Загружает все необходимое</summary>
 public override void LoadContent()
 {
     _Settings = new Menu("Settings/GameMenu.xml",Helper.Game);
       _MenuButton = new Button(Helper.Game, "Меню");
       _MenuButton.OnValueChanged += ShowMenu;
 }