private static void CreateButton(Group parent) { Button btn1 = new Button { Text = @"Click to mask me for 3 seconds :)", Icon = Resources.Load <Texture>("Icons/star_big"), SkinClass = typeof(ButtonSkin5), Left = 100, Top = 100, Width = 250, Height = 250, FocusEnabled = false }; btn1.Click += new EventHandler(delegate { int count = 0; LoadingMask mask = new LoadingMask(btn1); Timer t = new Timer(1, 3) { TickOnStart = true }; t.Tick += delegate { mask.SetMessage(string.Format("Masking... {0} seconds", count)); count++; }; t.Complete += delegate { mask.Unmask(); }; t.Start(); }); parent.AddChild(btn1); }
public static void SetMessage(string message) { if (null == _mask) { return; } _mask.SetMessage(message); }
private static void CreateButton(Group parent) { Button btn1 = new Button { Text = @"Click to mask me for 3 seconds :)", Icon = Resources.Load<Texture>("Icons/star_big"), SkinClass = typeof (ButtonSkin5), Left = 100, Top = 100, Width = 250, Height = 250, FocusEnabled = false }; btn1.Click += new EventHandler(delegate { int count = 0; LoadingMask mask = new LoadingMask(btn1); Timer t = new Timer(1, 3) {TickOnStart = true}; t.Tick += delegate { mask.SetMessage(string.Format("Masking... {0} seconds", count)); count++; }; t.Complete += delegate { mask.Unmask(); }; t.Start(); }); parent.AddChild(btn1); }