Exemplo n.º 1
0
 private void Form1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     if (PopupNotifierOld.CloseButton)
     {
         if (RectClose.Contains(e.X, e.Y))
         {
             bMouseOnClose = true;
         }
         else
         {
             bMouseOnClose = false;
         }
     }
     if (PopupNotifierOld.OptionsButton)
     {
         if (RectOptions.Contains(e.X, e.Y))
         {
             bMouseOnOptions = true;
         }
         else
         {
             bMouseOnOptions = false;
         }
     }
     if (RectText.Contains(e.X, e.Y))
     {
         bMouseOnLink = true;
     }
     else
     {
         bMouseOnLink = false;
     }
     Invalidate();
 }
Exemplo n.º 2
0
 // Добавление панели очков
 public void add_scores_pan()
 {
     scores_pan = add_child(typeof(RectText), "Scores");
     scores     = scores_pan.GetComponent <RectText>();
     scores.set_size(new RectSize(240, 40));
     scores.set_pos(new Vector2(10, 50));
     scores.set_style(FontStyle.Bold);
     scores.set_font("Arial.ttf");
     scores.set_font_size(24);
     scores.set_color(Funcs.hex_to_col("#6FFF0BFF"));
     scores.set_text("Scores: 0");
 }
Exemplo n.º 3
0
 // Добавление панели таймера
 public void add_timer_pan()
 {
     timer_pan = add_child(typeof(RectText), "Timer");
     timer     = timer_pan.GetComponent <RectText>();
     timer.set_size(new RectSize(240, 40));
     timer.set_pos(new Vector2(10, 10));
     timer.set_style(FontStyle.Bold);
     timer.set_font("Arial.ttf");
     timer.set_font_size(24);
     timer.set_color(Funcs.hex_to_col("#6FFF0BFF"));
     timer.set_text("Timer: 0");
 }
Exemplo n.º 4
0
        private void AddScoresText()
        {
            int fontSize = (int)(28 * RectUI.scaleFactor);

            scoresText               = AddChild <RectText>("ScoresText");
            scoresText.position      = new Vector2(0, 0);
            scoresText.size          = new Vector2(180, 56);
            scoresText.text          = "";
            scoresText.font          = Font.CreateDynamicFontFromOSFont("Arial", fontSize);
            scoresText.fontSize      = fontSize;
            scoresText.color         = Funcs.HexToCol("#FFFFFF");
            scoresText.textAlignment = TextAnchor.MiddleCenter;
        }
Exemplo n.º 5
0
    // Панель вывода счета
    public void add_scores_pan()
    {
        scores_pan = add_child(typeof(RectText), "Scores");
        RectText scores = scores_pan.GetComponent <RectText>();

        scores.set_size(new RectSize(160, 40));
        scores.set_pos(new Vector2(90, 56));
        scores.set_style(FontStyle.Bold);
        scores.set_font("Arial.ttf");
        scores.set_font_size(24);
        scores.set_color(Funcs.hex_to_col("#6FFF0BFF"));

        Scene scn = GameObject.FindGameObjectWithTag("GameController").GetComponent <Scene>();

        scores.set_text("Scores: " + scn.scores_num);
    }
Exemplo n.º 6
0
        private void drawRectangle(double x, double y, double width, double height, string label)
        {
            Rect.Width  = width;
            Rect.Height = height;
            Rect.SetValue(Canvas.LeftProperty, x);
            Rect.SetValue(Canvas.TopProperty, y);
            Rect.Visibility = Visibility.Visible;

            RectText.Text = label;
            RectText.SetValue(Canvas.LeftProperty, x);
            RectText.SetValue(Canvas.TopProperty, y);

            RectBorder.SetValue(Canvas.LeftProperty, x);
            RectBorder.SetValue(Canvas.TopProperty, y);
            RectBorder.Visibility = Visibility.Visible;
            RectText.Visibility   = Visibility.Visible;
        }
Exemplo n.º 7
0
 private void Form_MouseUp(object Sender, MouseEventArgs e)
 {
     if (RectClose.Contains(e.X, e.Y))
     {
         CloseClick(this, EventArgs.Empty);
     }
     if (RectText.Contains(e.X, e.Y))
     {
         LinkClick(this, EventArgs.Empty);
     }
     if (RectOptions.Contains(e.X, e.Y))
     {
         if (Parent.OptionsMenu != null)
         {
             Parent.OptionsMenu.Show(this, new Point(RectOptions.Right - Parent.OptionsMenu.Width, RectOptions.Bottom));
             Parent.bShouldRemainVisible = true;
         }
     }
 }
Exemplo n.º 8
0
 private void Form1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     if (RectClose.Contains(e.X, e.Y))
     {
         OnCloseClick();
     }
     if (RectText.Contains(e.X, e.Y))
     {
         OnLinkClick();
     }
     if (RectOptions.Contains(e.X, e.Y))
     {
         if ((PopupNotifierOld.OptionsMenu != null))
         {
             PopupNotifierOld.OptionsMenu.Show(this, new Point(RectOptions.Right - PopupNotifierOld.OptionsMenu.Width, RectOptions.Bottom));
             PopupNotifierOld.bShouldRemainVisible = true;
         }
     }
 }
Exemplo n.º 9
0
        private void Form_MouseMove(object Sender, MouseEventArgs e)
        {
            if (Parent.CloseButton)
            {
                if (RectClose.Contains(e.X, e.Y))
                {
                    bMouseOnClose = true;
                }
                else
                {
                    bMouseOnClose = false;
                }
            }

            if (Parent.OptionsButton)
            {
                if (RectOptions.Contains(e.X, e.Y))
                {
                    bMouseOnOptions = true;
                }
                else
                {
                    bMouseOnOptions = false;
                }
            }

            if (RectText.Contains(e.X, e.Y))
            {
                bMouseOnLink = true;
            }
            else
            {
                bMouseOnLink = false;
            }

            Invalidate();
        }