Ejemplo n.º 1
0
 protected ClickHandler LeftOnly(SimpleClickHandler action)
 {
     return(delegate(Game g, Widget w, MouseButton btn, int x, int y) {
         if (btn != MouseButton.Left)
         {
             return;
         }
         if (action != null)
         {
             action(g, w);
         }
     });
 }
Ejemplo n.º 2
0
 ButtonWidget Make(int x, int y, string text, SimpleClickHandler onClick)
 {
     return(ButtonWidget.Create(game, 40, text, font, LeftOnly(onClick))
            .SetLocation(Anchor.Centre, Anchor.Centre, x, y));
 }
Ejemplo n.º 3
0
 ButtonWidget Make(int dir, int y, string text, SimpleClickHandler onClick)
 {
     return(ButtonWidget.Create(game, 300, text, titleFont, LeftOnly(onClick))
            .SetLocation(Anchor.Centre, Anchor.Centre, dir * 160, y));
 }
Ejemplo n.º 4
0
 protected ButtonWidget MakeBack(int width, string text, int y, Font font, SimpleClickHandler onClick)
 {
     return(ButtonWidget.Create(game, width, text, font, LeftOnly(onClick))
            .SetLocation(Anchor.Centre, Anchor.BottomOrRight, 0, y));
 }
Ejemplo n.º 5
0
        protected ButtonWidget MakeBack(bool toGame, Font font, SimpleClickHandler onClick)
        {
            int width = game.UseClassicOptions ? 400 : 200;

            return(MakeBack(width, toGame ? "Back to game" : "Cancel", 25, font, onClick));
        }