예제 #1
0
파일: UIButton.cs 프로젝트: peges/hungry
 public UIButton(Scene scene, double x, double y, SpriteBase.SpriteFrame free, SpriteBase.SpriteFrame selected, UIElementGroup grp) :
     base(scene.HUD, x, y, free.Texture)
 {
     _Group = grp;
     _Group.Add(this);
     _ToFree     = new SpriteAnimation(false, false, free);
     _ToSelected = new SpriteAnimation(false, false, selected);
     Refresh    += (sender, e) => {
         var animation = this == _Group.ElementFocused ? _ToSelected : _ToFree;
         _AnimationFrameIndex = _AnimationCurrent == animation ? _AnimationFrameIndex : animation.FrameCount - _AnimationFrameIndex - 1;
         _AnimationCurrent    = animation;
     };
     OnRefresh(this, new EventArgs());
 }
예제 #2
0
파일: UIButton.cs 프로젝트: peges/hungry
 public UIButton(Scene scene, double x, double y, SpriteBase.SpriteFrame free) :
     this(scene, x, y, free, free)
 {
 }
예제 #3
0
파일: UIButton.cs 프로젝트: peges/hungry
 public UIButton(Scene scene, double x, double y, SpriteBase.SpriteFrame free, SpriteBase.SpriteFrame selected) :
     this(scene, x, y, free, selected, new UIElementGroup())
 {
 }