Transformer.Transformer C# (CSharp) Method

Transformer() public method

Constructor for the Transformer object. This is used to create a transformer which will transform specified types using transforms loaded from the class path. Transforms are matched to types using the specified matcher object.
public Transformer ( Matcher matcher ) : SimpleFramework.Xml.Util
matcher Matcher /// this is used to match types to transforms ///
return SimpleFramework.Xml.Util
   public Transformer(Matcher matcher) {
      this.matcher = new DefaultMatcher(matcher);
      this.cache = new TransformCache();
      this.error = new WeakCache();
   }
   /// <summary>

Usage Example

Example #1
0
        public override void Draw(GameTime gameTime)
        {
            WithZoom(zoom, (b) =>
            {
                base.Draw(gameTime);
                _inputChat.Draw(gameTime);
                // Stop drawing
                if (ChatLines.Count <= 0)
                {
                    SpriteBatch.End();
                    return;
                }
                int count = 0;
                _chatLinesFont.Position = _initialLinePos;

                // Go to every line
                foreach (ChatMessage line in ChatLines)
                {
                    _chatLinesFont.Text  = line.Text;
                    _chatLinesFont.Color = line.Color;

                    if (count > 0) // Passed the first
                    {
                        _chatLinesFont.Alpha    = 1.0F;
                        _chatLinesFont.Position = Positioner.GetSideBy(_chatLinesFont.BoundingBox, _chatLinesFont.BoundingBox, Positioner.SideFrom.Top);
                    }
                    else if (count == 0) // The last, the most recent message
                    {
                        // Checks do animation again
                        if (doAnimation)
                        {
                            _lastMessage = _lastMessage.Transformer(0.0F, 1.0F, 250, gameTime, (t) => _chatLinesFont.Alpha = t.CurrentValue);

                            // If last message animation is done, reset and restart
                            if (_lastMessage.Done)
                            {
                                _lastMessage = null;
                                doAnimation  = false;
                            }
                        }
                    }
                    _chatLinesFont.Draw(gameTime);
                    count++;
                }
                SpriteBatch.End();
            });
        }
All Usage Examples Of Transformer::Transformer