Example #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
            };

            _biscuitText = new Text(size =>
                                new PointF((1024f / 2f) - (size.Width / 2f), (768f / 2f) - (size.Height / 2f)),
                                                         string.Format("Biscuit Dev Build {0}", _game.Version),
                                                                            shadow: true, colour: Color4.White)
            {
                Camera = Camera
            };

            _startText = new Text(size =>
                                new PointF((1024f / 2f) - (size.Width / 2f),
                                     (768f / 2f) - (size.Height / 2f) + 50),
                                                    "Press escape to begin",
                                shadow: true, colour: Color4.Orange) {Camera = Camera};

            _menuMusic = AudioManager.LoadFromFile(Resources.MENU_MUSIC);
            _menuMusic.Play(true, true);
        }
Example #2
0
 public WorldScreen(Game game, string name)
     : base(game, name)
 {
     Camera = new Camera();
     _self = new Character { Camera = Camera };
     _map = new Map(game, _self) { Camera = Camera };
 }
Example #3
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};
        }
Example #4
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);
        }