예제 #1
0
    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);
    }
예제 #2
0
 public static void SetMessage(string message)
 {
     if (null == _mask)
     {
         return;
     }
     _mask.SetMessage(message);
 }
예제 #3
0
    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);
    }