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.InsideMouseLeftDown(); EasyInputAction.InsideMouseLeftUp(); var font = FontClass.Fonts(FontSize); if (TellTranslation == false) { Content = ContentA; } else { Content = ContentA + GiveTheTranslation(); } //do not need to change the text buffer, because we do not change any propertry if (mTextBuffer != null && mTextBuffer.Content == Content && mTextBuffer.Font == font) { return; } Utility.Dispose(ref mTextBuffer); mTextBuffer = new Text(Content, font, new Size()); }
protected override void Update(float delta) { RenewContainers_UpDown(); MovingHandCardPlace(delta); RenewContainers_Sort(delta); //EasyInputAction.OnlyInsideMouseLeftUp(); EasyInputAction.MouseDownDragOutside(); EasyInputAction.MouseDownDragInside(); }
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); }
protected override void Update(float delta) { EasyInputAction.InsideMouseLeftDown(); EasyInputAction.InsideMouseLeftOnceDown(); EasyInputAction.InsideMouseLeftUp(); EasyInputAction.InsideMouseRightUp(); EasyAnimation.Update_Animation(delta); //Update_Trans(delta); base.Update(delta); }
public Container(Size size, MainPlace main) { ContainerKind = GuiCard.Where.Place; this.MainPlace = main; base.Size = size; this.state = StateToDraw.None; this.Style = new ContainerStyle(); this.CardImage = Image.Load(".\\pic\\pic_called.jpg"); this.ContainerRect = new ContainerRect(size); Dragable = false; EasyInputAction = new EasyInputAction(this); EasyInputAction.AddEvent_MouseDownDragInside(Event_DragInside); EasyInputAction.AddEvent_OnlyInsideMouseLeftUp(Event_OnlyInsideUp); }
public HandCardPlaceContainer(Size size, Point2f point) { base.Size = size; this.point = point; EasyTranform.Offset(Transform, point); SetTrans = Transform.Matrix; var vtemp = Transform.Matrix; vtemp.Translation += new System.Numerics.Vector3(0, -GoUpHeight, 0); SelectTrans = vtemp; EasyInputAction = new EasyInputAction(this); //EasyInputAction.AddEvent_OnlyInsideMouseLeftUp(Event_OnlyInsideMouseLeftUp); EasyInputAction.AddEvent_MouseDownDragInside(Event_MouseDownDragIn); EasyInputAction.AddEvent_MouseDownDragOutside(Event_MouseDownDragOutside); EasyInputAction.AddEvent_MouseDownDragOutside_MouseUp(Event_MouseDownDragOutside_MouseUp); this.Dragable = false; }
public MyGuiButton(string content, FontClass fontClass, int fontSize, Size size) { Content = content; ContentA = content; FontClass = fontClass; FontSize = fontSize; Size = size; Image = Image.Load(".\\pic\\rectbutton_null.png"); Style = new GuiButtonStyle(); Dragable = false; Readable = false; var font = FontClass.Fonts(FontSize); mTextBuffer = new Text(Content, font, new Size()); EasyInputAction = new EasyInputAction(this); EasyInputAction.AddEvent_InsideMouseLeftDown(Event_MouseLiftDown0); }
/// <summary> /// 当鼠标左键按下时,持续触发的事件。 /// </summary> /// <param name="del"></param> public void AddEvent_MouseLiftDown(EasyInputAction.EventDel del) { EasyInputAction.AddEvent_InsideMouseLeftDown(del); }
/// <summary> /// 当鼠标左键抬起瞬间触发的事件。 /// </summary> /// <param name="del"></param> public void AddEvent_InsideMouseLeftUp(EasyInputAction.EventDel del) { EasyInputAction.AddEvent_InsideMouseLeftUp(del); }