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); }
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); }