コード例 #1
0
ファイル: SplashScreen.cs プロジェクト: aevv/Biscuit
        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);
        }
コード例 #2
0
ファイル: CharacterSelectScreen.cs プロジェクト: aevv/Biscuit
        public void OnSelectableCharacter(Packet packet)
        {
            var p = (SelectableCharacterPacket)packet;
            Out.Green(string.Format("Name: {0}, Id: {1}", p.Name, p.Id));

            Character character = new Character
            {
                Name = p.Name,
                Id = p.Id
            };

            Text text = new Text(colour: Color4.White, shadow: true, location: new PointF(600, _charCount * 75));
            text.Camera = Camera;
            _characters.Add(character);
            _charTexts.Add(text);
            _deferralQueue.Enqueue(new QueuedFunction
            {
                Parameters = new List<object> { _charCount, character },
                Function = (args) => text.Value = string.Format("{0} - level x something ({1})", args[1], args[0])
            });
            _deferralQueue.Enqueue(new QueuedFunction
            {
                Parameters = new List<object> { _charCount, p.Name, p.Id },
                Function = args => _delButtons.Add(new Button(new PointF(300, (int)(args[0]) * 75),
                    new SizeF(250, 100),
                    "assets/gfx/buttons/options.png", () =>
                        PacketWriter.WritePacketAsync(new DeleteCharacterPacket { Id = (Guid)args[2], Name = (string)args[1] }, _game.Connection.Writer)))
            });
            _charCount++;
        }