Beispiel #1
0
        // Update
        public void Update(float time01)
        {
            float oldValue = Value;

            Value = From + (To - From) * Lerp.Adjust(time01, LerpType);

            OnChange(Value - oldValue);
        }
Beispiel #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)
     {
         (pSpriteStart + i)->Colors.MultA((byte)(Lerp.Adjust(SpriteTimes01[i], LerpType) * 255.0f));
     }
 }
Beispiel #3
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));
                }
            }
        }
Beispiel #4
0
        // OnProcess
        protected unsafe override void OnProcess(FontSpriteList list)
        {
            float multY = Widget.UpY;

            fixed(FontSprite *pSpriteStart = &list.Sprites[0])
            {
                for (int i = list.RenderStart; i < list.RenderEnd; ++i)
                {
                    FontSprite *pSprite = (pSpriteStart + i);

                    float time01 = Lerp.Adjust(SpriteTimes01[i], LerpType);

                    float scaleX = ScaleFromX + (ScaleToX - ScaleFromX) * time01;
                    float scaleY = ScaleFromY + (ScaleToY - ScaleFromY) * time01;

                    pSprite->Position.X -= (pSprite->Size.X * (scaleX - 1.0f) * 0.5f);
                    pSprite->Position.Y -= (pSprite->Size.Y * (scaleY - 1.0f) * 0.5f) * multY;

                    pSprite->Size.X *= scaleX;
                    pSprite->Size.Y *= scaleY;
                }
            }
        }