Пример #1
0
        public override void render(float maxWidth, RenderCache cache, ref float x, ref uint yline, List <Line> lines, float offsetX, float offsetY)
        {
            Vector2 pt = new Vector2(x + offsetX, offsetY);

            for (int i = 0; i < yline; ++i)
            {
                pt.y += lines[i].y;
            }

            // 因对齐,X轴偏移量
            float alignedX = AlignedFormatting(owner, formatting, maxWidth, lines[(int)(yline)].x, 0);

            if (x + d_offset + alignedX > maxWidth)
            {
                yline++;
                x = NextLineX;
            }
            else
            {
                x += d_offset;
            }

//          d_beginLine = yline;
//          d_endLine   = yline;

            if (d_bNewLine == true)
            {
                yline++;
                x = NextLineX;
            }
        }
Пример #2
0
 public abstract void render(
     float maxWidth,
     RenderCache cache,
     ref float x,
     ref uint yline,
     List <Line> lines,
     float offsetX,
     float offsetY);
Пример #3
0
        protected override void OnRectRender(RenderCache cache, Line line, Rect rect)
        {
            float space = cartoon.space;

            rect.x     += space / 2f;
            rect.width -= space;
            cache.cacheCartoon(line, this, cartoon, rect);
        }
Пример #4
0
        public List <Line> mLines = new List <Line>(); // 每一行的大小

        protected override void Awake()
        {
            mRenderCache = new RenderCache(this);
            base.Awake();

            m_textDirty       = true;
            m_renderNodeDirty = true;

            DestroyDrawChild();
        }
Пример #5
0
 public override void render(float maxWidth, RenderCache cache, ref float x, ref uint yline, List <Line> lines, float offsetX, float offsetY)
 {
     if (d_bNewLine == true)
     {
         yline++;
         x = offsetX;
     }
     else
     {
     }
 }
Пример #6
0
        public override void render(float maxWidth, RenderCache cache, ref float x, ref uint yline, List <Line> lines, float offsetX, float offsetY)
        {
            float width  = getWidth();
            float height = getHeight();

            if (x + width > maxWidth)
            {
                x = 0;
                yline++;
            }

            float alignedX = AlignedFormatting(owner, formatting, maxWidth, lines[(int)(yline)].x);

            float y_offset = offsetY;

            for (int i = 0; i < yline; ++i)
            {
                y_offset += lines[i].y;
            }

            //y_offset += lines[(int)(yline)].y;
            Rect areaRect = new Rect(x + offsetX + alignedX, y_offset, width, height);

            float newfx = 0f;

            while (!owner.around.isContain(areaRect, out newfx))
            {
                areaRect.x = newfx;
                x          = newfx - alignedX - offsetX;
                if (x + width > maxWidth)
                {
                    x = 0;
                    yline++;
                    y_offset += lines[(int)yline].y;
                    areaRect  = new Rect(x + offsetX + alignedX, y_offset, width, height);
                }
            }

            OnRectRender(cache, lines[(int)yline], areaRect);

            x += width;

            if (d_bNewLine)
            {
                x = 0;
                yline++;
            }
        }
Пример #7
0
        public override void render(float maxWidth, RenderCache cache, ref float x, ref uint yline, List <Line> lines, float offsetX, float offsetY)
        {
            if (d_font == null)
            {
                return;
            }

            using (PD <StringBuilder> psb = Pool.GetSB())
            {
                Helper helper = new Helper(maxWidth, cache, x, yline, lines, formatting, offsetX, offsetY, psb.value);
                helper.Draw(this, NextLineX);

                x     = helper.x;
                yline = helper.yline;
            }
        }
Пример #8
0
            public Helper(float maxWidth, RenderCache cache, float x, uint yline, List <Line> lines, Anchor xFormatting, float offsetX, float offsetY, StringBuilder sb)
            {
                this.maxWidth    = maxWidth;
                this.cache       = cache;
                this.x           = x;
                this.yline       = yline;
                this.lines       = lines;
                this.xFormatting = xFormatting;
                this.offsetX     = offsetX;
                this.offsetY     = offsetY;

                pixelsPerUnit = 1f;
                alignedX      = 0;
                pt            = Vector2.zero;
                node          = null;
                fHeight       = 0f;

                this.sb = sb;
            }
Пример #9
0
 public override void render(float maxWidth, RenderCache cache, ref float x, ref uint yline, List <Line> lines, float offsetX, float offsetY)
 {
     cache.cacheSprite(null, this, sprite, rect);
 }
Пример #10
0
 public override void render(float maxWidth, RenderCache cache, ref float x, ref uint yline, List <Line> lines, float offsetX, float offsetY)
 {
     AlterX(ref x, maxWidth);
 }
Пример #11
0
 protected abstract void OnRectRender(RenderCache cache, Line line, Rect rect);
Пример #12
0
 protected override void OnRectRender(RenderCache cache, Line line, Rect rect)
 {
     node.OnRender(owner, rect);
 }
Пример #13
0
 protected override void OnRectRender(RenderCache cache, Line line, Rect rect)
 {
     cache.cacheISprite(line, this, sprite, rect);
 }