Пример #1
0
        public override void OnLoad(EventArgs args)
        {
            base.OnLoad(args);

            Camera = new Camera();

            _bg = new Image(new PointF(0, 0), new SizeF(1024, 768), "assets/gfx/background/menubg.png")
            {
                Camera = Camera
            };

            _charactersButton = new Button(new PointF(100, 200), new SizeF(250, 100), "assets/gfx/buttons/play.png",
                () =>
                {
                    _game.SwitchScreen("Chars");
                    _music.Stop();
                }) {Camera = Camera};

            _optionsButton = new Button(
                new PointF(100, 350), new SizeF(250, 100), "assets/gfx/buttons/options.png", () =>
                {
                    if (!_game.FormManager.HasForm<OptionsForm>())
                    {
                        _game.FormManager.OpenOrGetForm<OptionsForm>().Run();
                    }
                }) {Camera = Camera};

            _exitButton = new Button(new PointF(100, 500), new SizeF(250, 100), "assets/gfx/buttons/exit.png",
                () => _game.Exit()) {Camera = Camera};
        }
Пример #2
0
        public override void OnLoad(EventArgs args)
        {
            base.OnLoad(args);
            Camera = new Camera();
            _characters = new List<Character>();
            _charTexts = new List<Text>();
            _delButtons = new List<Button>();

            _charCreateButton = new Button(new PointF(100, 200), new SizeF(250, 100), "assets/gfx/buttons/play.png",
                () =>
                {
                    if (!_game.FormManager.HasForm<CharCreateForm>())
                    {
                        _game.FormManager.OpenOrGetForm<CharCreateForm>().Run();
                    }
                }) {Camera = Camera};

            Camera.ScreenOffset = new PointF(200, 200);
            _game.Connection.AddSubscriber(this);
        }