コード例 #1
0
ファイル: LoginBox.cs プロジェクト: shengpingwu/mir-ethernity
        public LoginBox()
        {
            VerticalAlignment   = VerticalAlignment.Bottom;
            HorizontalAlignment = HorizontalAlignment.Center;
            Top = -100;

            var background = new MirImageBrush()
            {
                Index   = 2,
                Library = Mir.Models.LibraryType.Interface1c
            };

            Background = background;
            Width      = background.Size.X;
            Height     = background.Size.Y;

            Widgets.Add(_idField = new TextBox
            {
                Id         = "txt_id",
                Left       = 68,
                Top        = 64,
                Width      = 184,
                Height     = 16,
                Background = new SolidBrush(Color.Transparent),
                Font       = Fonts.Size8
            });
            _idField.KeyDown += IdField_KeyDown;
            _idField.SetKeyboardFocus();

            Widgets.Add(_passField = new TextBox
            {
                Id            = "txt_pass",
                Left          = 355,
                Top           = 64,
                Width         = 184,
                Height        = 16,
                PasswordField = true,
                Background    = new SolidBrush(Color.Transparent),
                Font          = Fonts.Size8
            });

            Widgets.Add(_loginButton = new MirButton()
            {
                Text = "Login",
                Left = 550,
                Top  = 60,
            });
            _loginButton.Click += LoginButton_Click;

            Widgets.Add(_exitButton = new MirButton()
            {
                Text = "Close",
                Left = 680,
                Top  = 60,
            });
            _exitButton.Click += ExitButton_Click;
        }
コード例 #2
0
        public LoginScene()
        {
            Background = new MirImageBrush
            {
                Index   = 20,
                Library = LibraryType.Interface1c
            };

            Widgets.Add(new MirImage
            {
                Id        = "Sun",
                Library   = LibraryType.Interface1c,
                UseOffset = true,
                Blend     = true
            }.WithAnimation((s, e) => ((MirImage)s).Index = e, 2300, 2329, TimeSpan.FromSeconds(5), true));

            Widgets.Add(new MirImage
            {
                Id        = "Birds",
                Library   = LibraryType.Interface1c,
                UseOffset = true
            }.WithAnimation((s, e) => ((MirImage)s).Index = e, 2200, 2288, TimeSpan.FromSeconds(10), true));

            Widgets.Add(new MirImage
            {
                Id        = "Flags",
                Library   = LibraryType.Interface1c,
                UseOffset = true
            }.WithAnimation((s, e) => ((MirImage)s).Index = e, 2400, 2429, TimeSpan.FromSeconds(4), true));

            Widgets.Add(new MirImage
            {
                Id        = "Water",
                Library   = LibraryType.Interface1c,
                UseOffset = true
            }.WithAnimation((s, e) => ((MirImage)s).Index = e, 2500, 2529, TimeSpan.FromSeconds(4), true));


            Widgets.Add(new MirImage
            {
                Id                  = "LogoShadow",
                Library             = LibraryType.Interface1c,
                Index               = 23,
                HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center,
                Top                 = 100
            });

            Widgets.Add(new MirImage
            {
                Id                  = "Logo",
                Blend               = true,
                Library             = LibraryType.Interface1c,
                Index               = 22,
                HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center,
                Top                 = 66
            });

            Widgets.Add(new MirImage
            {
                Id                  = "PegiA",
                Library             = LibraryType.Interface1c,
                Index               = 3,
                HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Right,
            });


            Widgets.Add(new MirImage
            {
                Id                  = "PegiB",
                Library             = LibraryType.Interface1c,
                Index               = 4,
                Top                 = 100,
                HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Right,
            });

            Widgets.Add(_loginBox = new LoginBox());
        }
コード例 #3
0
        public CharacterScene()
        {
            Background = new MirImageBrush
            {
                Index   = 50,
                Library = LibraryType.Interface1c
            };

            Widgets.Add(new MirImage
            {
                Id      = "Header",
                Library = LibraryType.Interface1c,
                Index   = 51
            });

            Widgets.Add(new MirImage
            {
                Id                = "Footer",
                Library           = LibraryType.Interface1c,
                Index             = 52,
                Top               = 3,
                VerticalAlignment = VerticalAlignment.Bottom
            });

            Widgets.Add(new MirImage
            {
                Id        = "Lights",
                Library   = LibraryType.Interface1c,
                UseOffset = true,
                Blend     = true
            }.WithAnimation(WidgetAnimation.Create()
                            .WithCallback((s, e) => ((MirImage)s).Index = e)
                            .From(2800).To(2816)
                            .Elapse(TimeSpan.FromSeconds(2))
                            .WithLoop()
                            ));

            Widgets.Add(new MirImage
            {
                Id        = "Torches",
                Library   = LibraryType.Interface1c,
                UseOffset = true,
                Blend     = true,
                Left      = 20,
                Top       = 25
            }.WithAnimation(WidgetAnimation.Create()
                            .WithCallback((s, e) => ((MirImage)s).Index = e)
                            .From(2900).Count(16)
                            .Elapse(TimeSpan.FromSeconds(2))
                            .WithLoop()
                            ));


            var player = new MirImage()
            {
                Top       = 100,
                Left      = 100,
                Library   = LibraryType.Interface1c,
                Index     = 200,
                UseOffset = true,
            };

            Widgets.Add(player);

            var playerEffect = new MirImage()
            {
                Top       = 100,
                Left      = 100,
                Library   = LibraryType.Interface1c,
                Index     = 200,
                UseOffset = true,
                Blend     = true
            };

            Widgets.Add(playerEffect);

            player.WithAnimation(WidgetAnimation.Create()
                                 .WithCallback((s, e) =>
            {
                player.Index       = e;
                playerEffect.Index = e + 100;
            })
                                 .From(240).Count(21)
                                 .Elapse(TimeSpan.FromSeconds(2))
                                 .OnEnd((c) =>
            {
                playerEffect.Enabled = false;

                player.WithAnimation(WidgetAnimation.Create()
                                     .WithCallback((s, e) => ((MirImage)s).Index = e)
                                     .From(300).Count(12)
                                     .Elapse(TimeSpan.FromSeconds(2))
                                     .WithLoop());
            })
                                 );

            //_characters = new CharacterSelectControl[4];

            //for (short i = 0; i < _characters.Length; i++)
            //{
            //    Widgets.Add(_characters[i] = new CharacterSelectControl
            //    {
            //        Id = "Character_" + i,
            //        Selected = i == 0,
            //        Left = (short)(100 + (i * 210)),
            //        Top = 0,
            //        Visible = false,
            //    });
            //    _characters[i].TouchUp += Character_Click;
            //}

            //var createCharacterButton = new MirButton()
            //{
            //    Text = "Create character",
            //    Left = 300,
            //    Top = -15,
            //    Width = 100,
            //    HorizontalAlignment = HorizontalAlignment.Center,
            //    VerticalAlignment = VerticalAlignment.Bottom
            //};
            //createCharacterButton.Click += CreateCharacterButton_Click;
            //Widgets.Add(createCharacterButton);


            //_characters[0].Visible = true;
            //_characters[0].Set(new Character
            //{
            //    Class = new MirClass { Id = 0, Name = "Warrior" },
            //    Gender = new MirGender { Id = 0, Name = "Male" },
            //    Level = 50,
            //    Name = "Test",
            //    Id = 1
            //});
        }