Example #1
0
 public TextComponent(String Name, DrawableComponent drawInfo)
     : base(Name, drawInfo)
 {
     _VisibleText = "";
     _Text = "";
     AutoScroll = false;
 }
Example #2
0
 public TextComponent(String Name, DrawableComponent drawInfo)
     : base(Name, drawInfo)
 {
     _VisibleText = "";
     _Text        = "";
     AutoScroll   = false;
 }
Example #3
0
        public static void ModifyBoarders(DrawableComponent Component)
        {
            for (int x = 0; x < Component.SizeX; x++)
                for (int y = 0; y < Component.SizeY; y++)
                {
                    if (x == 0 || x == Component.SizeX - 1 ||
                        y == 0 || y == Component.SizeY - 1) //If it's on the boarders
                        Component.Contents[x, y] = new Pixel(Component.Foreground);

                }
        }
Example #4
0
 public DrawableComponent(string Name, DrawableComponent instance)
     : base(Name)
 {
     this.Contents = new IDrawableUnit[instance.SizeX, instance.SizeY];
     this.SizeX = instance.SizeX;
     this.SizeY = instance.SizeY;
     this.X = instance.X;
     this.Y = instance.Y;
     this.Rotation = instance.Rotation;
     this.DrawEnabled = instance.DrawEnabled;
     this.Background = instance.Background;
     this.Foreground = instance.Foreground;
     this.Transparent = instance.Transparent;
 }
Example #5
0
 public DrawableComponent(string Name, DrawableComponent instance)
     : base(Name)
 {
     this.Contents    = new IDrawableUnit[instance.SizeX, instance.SizeY];
     this.SizeX       = instance.SizeX;
     this.SizeY       = instance.SizeY;
     this.X           = instance.X;
     this.Y           = instance.Y;
     this.Rotation    = instance.Rotation;
     this.DrawEnabled = instance.DrawEnabled;
     this.Background  = instance.Background;
     this.Foreground  = instance.Foreground;
     this.Transparent = instance.Transparent;
 }
Example #6
0
        public static void WriteString(DrawableComponent Component, string Str, int X, int Y, int SizeX, int SizeY)
        {
            if (Str != null)
            {

                int i = 0;
                for (int y = Y; y < SizeY  && i < Str.Length; y++)
                    for (int x = X; x < SizeX  && i < Str.Length; x++)
                    {
                        if (Str[i] == '\n')
                        {
                            y++;
                            x = X-1; //Because x is incremented next time, set it to 1 below the original X position
                        }
                        else if(Str[i] != '\r' && i < Str.Length && y < Component.SizeY && x < Component.SizeX) //F*****g '\r'
                            Component.Contents[x, y] = new Pixel(Str[i], Component.Foreground, Component.Background);
                        i++;
                    }
            }
        }
Example #7
0
 public static void WriteStringInBoarder(DrawableComponent Component, string Str)
 {
     WriteString(Component, Str, 1, 1, Component.SizeX-1, Component.SizeY-1);
 }
Example #8
0
 public static void WriteString(DrawableComponent Component, string Str)
 {
     WriteString(Component, Str, 0, 0, Component.SizeX, Component.SizeY);
 }
Example #9
0
 public static void ModifyAll(DrawableComponent Component, IDrawableUnit Modification)
 {
     for (int x = 0; x < Component.SizeX; x++)
         for (int y = 0; y < Component.SizeY; y++)
             Component.Contents[x, y] = Modification;
 }
Example #10
0
 public static void Clear(DrawableComponent Component)
 {
     for (int x = 0; x < Component.SizeX; x++)
         for (int y = 0; y < Component.SizeY; y++)
             Component.Contents[x, y] = new Pixel(Component.Background);
 }
 public DrawableComponentBuilder()
 {
     build = new DrawableComponent();
 }