Exemplo n.º 1
0
 /// <summary>
 /// Inicializa uma nova instância de DebugComponent.
 /// </summary>
 /// <param name="actor">O ator a ser associado a esse componente.</param>
 /// <param name="font">O objeto SpriteFont a ser usado para desenho do texto.</param>
 public DebugComponent(Actor actor, SpriteFont font) : base(actor)
 {
     text           = new TextActor(actor.Game, "", font);
     verticalLine   = Sprite.GetRectangle(actor.Game, "", new Point(1, actor.Game.GraphicsDevice.Viewport.Height), Color.White);
     horizontalLine = Sprite.GetRectangle(actor.Game, "", new Point(actor.Game.GraphicsDevice.Viewport.Width, 1), Color.White);
     this.Priority  = DrawPriority.Forward;
 }
Exemplo n.º 2
0
        /// <summary>Inicializa uma nova instância de TextActor como cópia de outro TextActor.</summary>
        /// <param name="source">O ator a ser copiado.</param>
        public TextActor(TextActor source) : base(source)
        {
            //Para uma cópia profunda
            //Font = GetDeeepCopy(source.Font);

            Font = source.Font;
            Text = new StringBuilder(source.Text.ToString());
        }
Exemplo n.º 3
0
 /// <summary>
 /// Inicializa uma nova instância de DebugComponent como cópia de outra instância.
 /// </summary>
 /// <param name="destination">O ator a ser associado esse componente</param>
 /// <param name="source">A instância de origem a ser copiada esse componente</param>
 public DebugComponent(Actor destination, DebugComponent source) : base(destination, source)
 {
     this.text           = new TextActor(source.text);
     this.verticalLine   = new Sprite(source.verticalLine);
     this.horizontalLine = new Sprite(source.horizontalLine);
     this.ShowOrigin     = source.ShowOrigin;
     this.ShowTransform  = source.ShowTransform;
     this.TextColor      = source.TextColor;
     this.LineColor      = source.LineColor;
 }