Beispiel #1
0
        public GuiCard(Size size)
        {
            base.Size        = size;
            this.State       = StateToDraw.None;
            this.Style       = new GuiCardStyle();
            this.FrontImage  = Image.Load(".\\pic\\mon_wunaichacha.png");
            this.BackImage   = Image.Load(".\\pic\\pic_backimage.jpg"); //Card.BaceImage;
            this.GuiCardRect = new GuiCardRect(size);
            base.Dragable    = true;
            WhereIsCard      = Where.None;
            //------------------------------------------
            GuiButtonList = new GuiButtonList(this);
            GuiButtonList.AddButton(new MyGuiButton("点击1", 15, new Size(100, 50)));
            GuiButtonList.AddButton(new MyGuiButton("点击2", 15, new Size(100, 50)));
            //------------------------------------------
            EasyAudio_1 = new EasyAudio(MusicAndSounds.LightButton);
            EasyAudio_2 = new EasyAudio(MusicAndSounds.Water);
            //-----------------------------------------
            EasyInputAction = new EasyInputAction(this);
            EasyInputAction.AddEvent_InsideMouseLeftUp(Event_MouseLeftUp);
            EasyInputAction.AddEvent_InsideMouseLeftDown(Event_MouseLeftDown);
            EasyInputAction.AddEvent_InsideMouseRightUp(Event_MouseRightUp);
            EasyInputAction.AddEvent_InsideMouseLeftOnceDown(Event_MouseLeftOnceDown);


            EasyAnimation = new EasyAnimation();
            EasyAnimation.AddAnimation(Animation0, 0.7f);
        }
 protected override void Update(float delta)
 {
     EasyInputAction.MouseHoverFromInsideOut();
     EasyAnimation.Update_Animation(0, delta);
     EasyAnimation.Update_Animation(1, delta);
     base.Update(delta);
 }
 public GuiButtonList(GuiCard f)
 {
     FatherCard    = f;
     EasyAnimation = new EasyAnimation();
     EasyAnimation.AddAnimation(Animation0_FlyOut, 0.3f);
     EasyAnimation.AddAnimation(Animation1_Fade, Animation1_WhenEnd, 0.3f);
     Size = f.Size;
     Transform.SetTransform(FatherCard.Transform.Matrix);
     EasyInputAction = new EasyInputAction(this);
     EasyInputAction.AddEvent_MouseHoverFromInsideOut(CloseAllButtons);
 }
Beispiel #4
0
        protected override void Update(float delta)
        {
            EasyInputAction.InsideMouseLeftDown();
            EasyInputAction.InsideMouseLeftOnceDown();
            EasyInputAction.InsideMouseLeftUp();
            EasyInputAction.InsideMouseRightUp();
            EasyAnimation.Update_Animation(delta);

            //Update_Trans(delta);


            base.Update(delta);
        }
 /// <summary>
 /// 展示所有Button
 /// </summary>
 public void ShowAllButtons()
 {
     if (open == false)
     {
         open = true;
         Transform.SetTransform(FatherCard.Transform.Matrix);
         if (Buttons.Count > 0)
         {
             Size = new Size(Buttons[0].Size.Width + Size.Width, Size.Height);
             FatherCard.Card.Player.MainPlaceInfo.MainPlace.DynamicInsertElement(FatherCard.Card.Player.MainPlaceInfo.MainPlace.Elements.Count - 1, this);
             for (int i = 0; i < Buttons.Count; i++)
             {
                 Buttons[i].Transform.SetTransform(Transform.Matrix);
                 FatherCard.Card.Player.MainPlaceInfo.MainPlace.DynamicInsertElement(FatherCard.Card.Player.MainPlaceInfo.MainPlace.Elements.Count - 1, Buttons[i]);
             }
             EasyAnimation.AnimationStart(0);
         }
     }
 }
Beispiel #6
0
        private void Event_MouseLeftUp()
        {
            var temp = Card.Player.MainPlaceInfo.MainPlace;

            if (temp.ElementsGoWithMouse.Count != 0)
            {
                //if (temp.ElementsGoWithMouse[0].LastLayer != null)
                //{
                //    temp.LayerController.MoveToLayerTop(
                //        temp.ElementsGoWithMouse[0],
                //        temp.ElementsGoWithMouse[0].LastLayer.LayerName);
                //}
                temp.ElementsGoWithMouse.Clear();
                temp.last = null;
            }

            EasyAudio_1.Reset();
            EasyAudio_1.Start();
            EasyAnimation.AnimationStart(0);
            // Transform.SetTransform(SetTrans);
        }
 public void CloseAllButtons()
 {
     EasyAnimation.AnimationStart(1);
 }