Beispiel #1
0
        public RTSUIPanel2D(WidgetRenderer wr, int r, int c, int s, int buf)
        {
            Rows    = r;
            Columns = c;
            groups  = new RTSUIGroup <T> [Columns * Rows];
            int i = 0;

            for (int y = 0; y < Rows; y++)
            {
                for (int x = 0; x < Columns; x++)
                {
                    groups[i] = new RTSUIGroup <T>(wr, s);
                    if (x > 0)
                    {
                        groups[i].Widget.Parent       = groups[i - 1].Widget;
                        groups[i].Widget.Offset       = new Point(buf, 0);
                        groups[i].Widget.OffsetAlignX = Alignment.RIGHT;
                    }
                    i++;
                }
                if (y > 0)
                {
                    int yi = y * Columns;
                    groups[yi].Widget.Parent       = groups[yi - Columns].Widget;
                    groups[yi].Widget.Offset       = new Point(0, buf);
                    groups[yi].Widget.OffsetAlignY = Alignment.BOTTOM;
                }
            }

            BackPanel               = new RectWidget(wr);
            BackPanel.Width         = Columns * s + (Columns + 1) * buf;
            BackPanel.Height        = Rows * s + (Rows + 1) * buf;
            groups[0].Widget.Parent = BackPanel;
            groups[0].Widget.Offset = new Point(buf, buf);

            LayerDepth = 1f;
            Clear();
        }
Beispiel #2
0
 protected void Show(RTSUIGroup <T> ug)
 {
     ug.Widget.ActiveColor   = RTSUIGroup <T> .COLOR_ACTIVE;
     ug.Widget.InactiveColor = RTSUIGroup <T> .COLOR_INACTIVE;
 }