Beispiel #1
0
 protected SceneFirstMenu(PositronGame game)
     : base(game)
 {
     UIGroup = new UIElementGroup();
     SceneEntry += (sender, e) => {
         _Game.SetInputAccepters("Main Menu",  new IInputAccepter[] { UIGroup });
     };
     SceneExit += (sender, e) => {
         _Game.RemoveInputAccepters("Main Menu");
     };
     SetupPlayerOnExit();
 }
Beispiel #2
0
 protected SceneFirstMenu()
     : base()
 {
     UIGroup = new UIElementGroup();
     this.SceneEntry += (sender, e) => {
         Program.MainGame.SetInputAccepters("Main Menu",  new IInputAccepter[] { UIGroup });
     };
     SceneExit += (sender, e) => {
         Program.MainGame.RemoveInputAccepters("Main Menu");
     };
     SetupPlayerOnExit();
 }
Beispiel #3
0
 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());
 }