Example #1
0
        // Process
        private Vector2 Process(ref StringProxy text, FontStyle fontStyle, int renderPass, int layer, ref Vector3 pos, float height, E_Align align, ref SpriteColors colors, float wrapSizeX)
        {
            RenderPass = renderPass;
            Layer      = layer;
            Position   = pos;
            Align      = align;
            Colors     = colors;

            if ((fontStyle.RenderState.BlendState == E_BlendState.AlphaBlend) && !Colors.PreMultipliedAlpha)
            {
                Colors.ToPremultiplied();
            }

            return(Process(ref text, fontStyle, height, wrapSizeX, E_FontProcessType.Draw));
        }
Example #2
0
        // OnProcess
        protected unsafe override void OnProcess(FontSpriteList list)
        {
            fixed(FontSprite *pSpriteStart = &list.Sprites[0])
            {
                for (int i = list.RenderStart; i < list.RenderEnd; ++i)
                {
                    FontSprite *pSprite = (pSpriteStart + i);

                    SpriteColors c = Colors;
                    c.MultA(ref pSprite->Colors);

                    if (pSprite->Colors.PreMultipliedAlpha)
                    {
                        c.ToPremultiplied();
                    }

                    pSprite->Colors.Lerp(ref pSprite->Colors, ref c, Lerp.Adjust(SpriteTimes01[i], LerpType));
                }
            }
        }
Example #3
0
        // Process
        private Vector2 Process( ref StringProxy text, FontStyle fontStyle, int renderPass, int layer, ref Vector3 pos, float height, E_Align align, ref SpriteColors colors, float wrapSizeX )
        {
            RenderPass = renderPass;
            Layer = layer;
            Position = pos;
            Align = align;
            Colors = colors;

            if ( ( fontStyle.RenderState.BlendState == E_BlendState.AlphaBlend ) && !Colors.PreMultipliedAlpha )
            Colors.ToPremultiplied();

            return Process( ref text, fontStyle, height, wrapSizeX, E_FontProcessType.Draw );
        }