Пример #1
0
        private BubbleInfo GetBubbleInfo(BubblePosition position, BubbleFigure bubbleFigure)
        {
            BubbleInfo info = new BubbleInfo();

            // ie : bubble-TOPLEFT-STAR.png
            info.ImageName  = $"BUBBLE-{position.ToString()}-{bubbleFigure.ToString()}.png";
            info.StartPoint = new Point(0, 0); // Right position is calculated after automatically

            //Point p = new Point();
            switch (position)
            {
            case BubblePosition.TOPLEFT:
                switch (bubbleFigure)
                {
                case BubbleFigure.STAR:
                    info.TextArea = new Rectangle(10, 0, 200, 120);
                    break;

                case BubbleFigure.CLOUD:

                case BubbleFigure.NORMAL:
                default:
                    info.TextArea = new Rectangle(10, 10, 200, 110);
                    break;
                }
                return(info);

            case BubblePosition.TOPRIGHT:
                switch (bubbleFigure)
                {
                case BubbleFigure.STAR:
                    info.TextArea = new Rectangle(70, 0, 200, 140);
                    break;

                case BubbleFigure.CLOUD:

                case BubbleFigure.NORMAL:
                default:
                    info.TextArea = new Rectangle(10, 10, 200, 120);
                    break;
                }
                return(info);

            //info.STARtpoint = new Point(200, 0);
            //info.ImageName = "bubble-tr.png";
            //info.TextArea = new Rectangle(10, 10, 200, 120);
            //break;
            case BubblePosition.BOTTOMLEFT:
                switch (bubbleFigure)
                {
                case BubbleFigure.STAR:
                    info.TextArea = new Rectangle(5, 60, 200, 130);
                    break;

                case BubbleFigure.CLOUD:

                case BubbleFigure.NORMAL:
                default:
                    info.TextArea = new Rectangle(10, 60, 200, 120);
                    break;
                }
                return(info);

            //info.STARtpoint = new Point(0, 400);
            //info.ImageName = "bubble-bl.png";
            //info.TextArea = new Rectangle(10, 60, 200, 120);
            //break;
            case BubblePosition.BOTTOMRIGHT:
                switch (bubbleFigure)
                {
                case BubbleFigure.STAR:
                    info.TextArea = new Rectangle(70, 50, 200, 160);
                    break;

                case BubbleFigure.CLOUD:

                case BubbleFigure.NORMAL:
                default:
                    info.TextArea = new Rectangle(0, 50, 200, 140);
                    break;
                }
                return(info);

            //info.STARtpoint = new Point(200, 400);
            //info.ImageName = "bubble-STAR2br.png";
            //info.TextArea = new Rectangle(70, 60, 200, 140);
            //return info;
            default:
                return(null);
            }
        }