public ThumbnailContainer(GUIComponent theInterface, int tilesOrActors = 0)
            : base(theInterface)
        {
            this.orientation = Orientation.HORIZONTAL;
            if (tilesOrActors == 0)
            {
                loadTiles();
            }
            if (tilesOrActors == 1)
            {
                loadActors();
            }
            int len = thumbPics.Count();

            thumbs = new Thumbnail[len];
            TableContainer table;

            if (1 == tilesOrActors)
            {
                table = new TableContainer(theInterface, 2, (len + 1) / 2 + 1, 8);
            }
            else
            {
                table = new TableContainer(theInterface, 4, (len + 1) / 4 + 1, 16);
            }
            for (int i = 0; i < len; i++)
            {
                thumbs[i] = new Thumbnail(theInterface, thumbPics[i], i);
                if (tilesOrActors == 1)
                {
                    thumbs[i].forcedSize = new Vector2(32, 32);
                }
                thumbs[i].margin = 2;
                table.Add(thumbs[i]);
            }
            left             = new Button(theInterface, "");
            left.normTexture = theInterface.guiTextures[23];
            left.clicTexture = theInterface.guiTextures[24];
            left.clickEvent += (lol) =>
            {
                table.left();
            };
            right             = new Button(theInterface, "");
            right.normTexture = theInterface.guiTextures[25];
            right.clicTexture = theInterface.guiTextures[26];
            right.clickEvent += (lol) =>
            {
                table.right();
            };
            this.Add(left);
            this.Add(table);
            this.Add(right);
        }
        public void Initialize()
        {
            float width  = guiComponent.graphics.camera.screenWidth / guiComponent.graphics.camera.scale;
            float height = guiComponent.graphics.camera.screenHeight / guiComponent.graphics.camera.scale;

            Vector2 iconSize = new Vector2(20, 20);
            int     margin   = 0;

            size     = new Vector2(width, .25f * height);
            location = new Vector2(0, .75f * height);

            row       = new TableContainer(guiComponent, 6, 3, 3);
            row.align = ListContainer.Align.CENTER;
            Button temp = new Button(guiComponent, "");

            temp.margin      = margin;
            temp.normTexture = guiComponent.guiTextures[38];
            temp.clicTexture = guiComponent.guiTextures[49];
            temp.forcedSize  = iconSize;

            //Create all the buttons for selecting Tools
            //New Map Tool
            temp.normTexture = guiComponent.guiTextures[38];
            temp.forcedSize  = iconSize;

            temp.clickEvent += (loc) =>
            {
                (guiComponent.tileEngine as Editor).activeTool.active = false;

                (guiComponent.tileEngine as Editor).activeTool        = (guiComponent.tileEngine as Editor).newTool;
                (guiComponent.tileEngine as Editor).activeTool.active = true;
                guiComponent.current.pack();
            };
            row.Add(temp);

            //Save Tool
            temp             = new Button(guiComponent, "");
            temp.margin      = margin;
            temp.normTexture = guiComponent.guiTextures[30];
            temp.clicTexture = guiComponent.guiTextures[41];
            temp.forcedSize  = iconSize;
            temp.clickEvent += (loc) =>
            {
                (guiComponent.tileEngine as Editor).activeTool.active = false;

                (guiComponent.tileEngine as Editor).activeTool        = (guiComponent.tileEngine as Editor).saveTool;
                (guiComponent.tileEngine as Editor).activeTool.active = true;
                guiComponent.current.pack();
            };
            row.Add(temp);

            //Load Tool
            temp             = new Button(guiComponent, "");
            temp.normTexture = guiComponent.guiTextures[36];
            temp.clicTexture = guiComponent.guiTextures[47];
            temp.margin      = margin;
            temp.forcedSize  = iconSize;
            temp.clickEvent += (loc) =>
            {
                (guiComponent.tileEngine as Editor).activeTool.active = false;

                (guiComponent.tileEngine as Editor).activeTool        = (guiComponent.tileEngine as Editor).loadTool;
                (guiComponent.tileEngine as Editor).activeTool.active = true;
                guiComponent.current.pack();
            };
            row.Add(temp);

            //Pencil Tool
            temp             = new Button(guiComponent, "");
            temp.margin      = margin;
            temp.normTexture = guiComponent.guiTextures[31];
            temp.clicTexture = guiComponent.guiTextures[42];
            temp.forcedSize  = iconSize;
            temp.clickEvent += (loc) =>
            {
                (guiComponent.tileEngine as Editor).activeTool.active = false;

                (guiComponent.tileEngine as Editor).activeTool        = (guiComponent.tileEngine as Editor).pencilTool;
                (guiComponent.tileEngine as Editor).activeTool.active = true;
                guiComponent.current.pack();
            };
            row.Add(temp);

            temp             = new Button(guiComponent, "");
            temp.margin      = margin;
            temp.normTexture = guiComponent.guiTextures[32];
            temp.clicTexture = guiComponent.guiTextures[43];


            temp.forcedSize = iconSize;

            temp.clickEvent += (loc) =>
            {
                (guiComponent.tileEngine as Editor).activeTool.active = false;

                (guiComponent.tileEngine as Editor).activeTool        = (guiComponent.tileEngine as Editor).flagTool;
                (guiComponent.tileEngine as Editor).activeTool.active = true;
                guiComponent.current.pack();
            };
            row.Add(temp);

            temp             = new Button(guiComponent, "");
            temp.normTexture = guiComponent.guiTextures[33];
            temp.clicTexture = guiComponent.guiTextures[44];
            temp.margin      = margin;
            temp.forcedSize  = iconSize;
            temp.clickEvent += (loc) =>
            {
                (guiComponent.tileEngine as Editor).activeTool.active = false;

                (guiComponent.tileEngine as Editor).activeTool        = (guiComponent.tileEngine as Editor).eraseTool;
                (guiComponent.tileEngine as Editor).activeTool.active = true;
                guiComponent.current.pack();
            };
            row.Add(temp);
            temp             = new Button(guiComponent, "");
            temp.normTexture = guiComponent.guiTextures[34];
            temp.clicTexture = guiComponent.guiTextures[45];
            temp.margin      = margin;
            temp.forcedSize  = iconSize;
            temp.clickEvent += (loc) =>
            {
                (guiComponent.tileEngine as Editor).activeTool.active = false;

                (guiComponent.tileEngine as Editor).activeTool        = (guiComponent.tileEngine as Editor).fillTool;
                (guiComponent.tileEngine as Editor).activeTool.active = true;
                guiComponent.current.pack();
            };
            row.Add(temp);
            temp             = new Button(guiComponent, "");
            temp.normTexture = guiComponent.guiTextures[35];
            temp.clicTexture = guiComponent.guiTextures[46];
            temp.margin      = margin;
            temp.forcedSize  = iconSize;
            temp.clickEvent += (loc) =>
            {
                (guiComponent.tileEngine as Editor).activeTool.active = false;

                (guiComponent.tileEngine as Editor).activeTool        = (guiComponent.tileEngine as Editor).actorTool;
                (guiComponent.tileEngine as Editor).activeTool.active = true;
                guiComponent.current.pack();
            };
            row.Add(temp);


            temp             = new Button(guiComponent, "");
            temp.normTexture = guiComponent.guiTextures[40];
            temp.clicTexture = guiComponent.guiTextures[48];
            temp.margin      = margin;

            temp.forcedSize  = iconSize;
            temp.clickEvent += (loc) =>
            {
                (guiComponent.tileEngine as Editor).activeTool.active = false;

                (guiComponent.tileEngine as Editor).activeTool        = (guiComponent.tileEngine as Editor).optionTool;
                (guiComponent.tileEngine as Editor).activeTool.active = true;
                guiComponent.current.pack();
            };
            row.Add(temp);

            temp             = new Button(guiComponent, "");
            temp.normTexture = guiComponent.guiTextures[50];
            temp.clicTexture = guiComponent.guiTextures[51];
            temp.margin      = margin;

            temp.forcedSize  = iconSize;
            temp.clickEvent += (loc) =>
            {
                (guiComponent.tileEngine as Editor).activeTool.active = false;

                (guiComponent.tileEngine as Editor).activeTool        = (guiComponent.tileEngine as Editor).stampTool;
                (guiComponent.tileEngine as Editor).activeTool.active = true;
                guiComponent.current.pack();
            };
            row.Add(temp);

            row.Add(null);
            row.Add(null);
            row.Add(null);

            Add(row);
            Add(new ToolOptionsGUI(guiComponent as EditorGUI));
        }