示例#1
0
 public ButtonElement(Button button, Coordinate buttonDimensions, string name, SideTack attachment)
 {
     internalButton = button;
     size           = buttonDimensions;
     SideAttachment = attachment;
     Name           = name;
 }
示例#2
0
 public FlatColorElement(Coordinate minSize, Coordinate maxSize, Color color, string name, SideTack attachment)
 {
     if (minSize != null)
     {
         if (minSize.X < 0)
         {
             minSize.X = 0;
         }
         if (minSize.Y < 0)
         {
             minSize.Y = 0;
         }
         MinimumSize = minSize;
     }
     if (maxSize != null)
     {
         if (maxSize.X <= 0)
         {
             maxSize.X = int.MaxValue;
         }
         if (maxSize.Y <= 0)
         {
             maxSize.Y = int.MaxValue;
         }
         MaximumSize = maxSize;
     }
     SideAttachment = attachment;
     ResizeBehavior = ResizeKind.FillSpace;
     this.color     = color;
     Name           = name;
 }
示例#3
0
 public FlatColorElement(Coordinate minSize, Coordinate maxSize, Vector2 proportions, SideTack attachment, ResizeKind resize, Color color)
 {
     if (minSize != null)
     {
         if (minSize.X < 0)
         {
             minSize.X = 0;
         }
         if (minSize.Y < 0)
         {
             minSize.Y = 0;
         }
         MinimumSize = minSize;
     }
     if (maxSize != null)
     {
         if (maxSize.X <= 0)
         {
             maxSize.X = int.MaxValue;
         }
         if (maxSize.Y <= 0)
         {
             maxSize.Y = int.MaxValue;
         }
         MaximumSize = maxSize;
     }
     IdealDimensions = proportions;
     SideAttachment  = attachment;
     ResizeBehavior  = resize;
     this.color      = color;
 }
示例#4
0
        public ScrollableList(Element[] elements, bool horizontal, Rectangle initialDimensions, Coordinate minSize, Coordinate maxSize, Color color, SideTack attachment)
        {
            if (minSize.X < 0)
            {
                minSize.X = 0;
            }
            if (minSize.Y < 0)
            {
                minSize.Y = 0;
            }
            trueMin = minSize;
            if (maxSize.X < 0)
            {
                maxSize.X = int.MaxValue;
            }
            if (maxSize.Y < 0)
            {
                maxSize.Y = int.MaxValue;
            }
            MaximumSize = maxSize;

            this.elements   = elements;
            this.horizontal = horizontal;
            this.color      = color;
            SideAttachment  = attachment;

            Resize(initialDimensions);
        }
示例#5
0
 public RGBElement(Color color, bool horizontal, string name, SideTack attachment)
 {
     this.color      = color;
     this.horizontal = horizontal;
     ResizeBehavior  = ResizeKind.FillSpace;
     Name            = name;
     SideAttachment  = attachment;
 }
示例#6
0
 public TextListElement(ColumnOptions[] columns, Color textColor, Coordinate maxSize, Coordinate minSize, SideTack attachment = SideTack.Center, DataProvider provider = null, string fontName = "Default")
 {
     font           = fontName;
     this.columns   = columns;
     boundFunction  = provider;
     MaximumSize    = maxSize;
     MinimumSize    = minSize;
     this.color     = textColor;
     SideAttachment = attachment;
     UpdateData();
 }
示例#7
0
        public LineElement(bool horizontal, Vector2 proportions, Color color, string name, SideTack attachment)
        {
            Coordinate size = Coordinate.Zero;

            IdealDimensions = proportions;
            SideAttachment  = attachment;
            ResizeBehavior  = ResizeKind.FillRatio;
            Color           = color;
            this.horizontal = horizontal;
            Name            = name;
        }
示例#8
0
 public LineElement(bool horizontal, int width, SideTack attachment, Color color)
 {
     if (width <= 0)
     {
         throw new ArgumentException("The line must have a width.", "width");
     }
     MaximumSize     = new Coordinate(width, 0);
     SideAttachment  = attachment;
     ResizeBehavior  = ResizeKind.FillSpace;
     Color           = color;
     this.horizontal = horizontal;
 }
示例#9
0
 public MapElement(Texture2D map, Texture2D tiles, SideTack attachment = SideTack.Center, DataProvider provider = null)
 {
     mapImage   = map;
     tilesImage = tiles;
     if (map.Width != tiles.Width || map.Height != tiles.Height)
     {
         throw new ArgumentException("map and tiles must have matching dimension.");
     }
     MaximumSize = new Coordinate(map.Width, map.Height);
     MinimumSize = new Coordinate(map.Width, map.Height);
     croppedArea = new Rectangle(0, 0, map.Width, map.Height);
     if (provider != null)
     {
         BindData(provider);
     }
 }
 public ConstructSelectElement(Coordinate minSize, Coordinate maxSize, Vector2 proportions, SideTack attachment, Simulator sim)
 {
     this.IdealDimensions = proportions;
     this.MaximumSize     = maxSize;
     MinimumSize          = minSize;
     this.SideAttachment  = attachment;
     this.sim             = sim;
 }