コード例 #1
0
        private TopTable getNewTable(float XRatio, float YRatio, string f)
        {
            TopTable Table = new TopTable(Hud)
            {
                RatioPositionX            = XRatio,
                RatioPositionY            = YRatio,
                HorizontalCenter          = true,
                VerticalCenter            = false,
                PositionFromRight         = false,
                PositionFromBottom        = false,
                ShowHeaderLeft            = false,
                ShowHeaderTop             = true,
                ShowHeaderRight           = false,
                ShowHeaderBottom          = false,
                DefaultCellDecorator      = DefaultCellDecorator,
                DefaultHighlightDecorator = HighlightCellDecorator,
                DefaultHeaderDecorator    = new TopTableCellDecorator(Hud)
                {
                    TextFont = Hud.Render.CreateFont("tahoma", 6.5f, 255, 255, 255, 255, false, false, true),
                }
            };

            Table.DefineColumns(getHeader(f).ToArray());
            return(Table);
        }
コード例 #2
0
        private void InitTable()
        {
            Table = new TopTable(Hud)
            {
                RatioPositionX       = 0.5f,
                RatioPositionY       = 0.2f,
                HorizontalCenter     = true,
                VerticalCenter       = false,
                PositionFromRight    = false,
                PositionFromBottom   = false,
                ShowHeaderLeft       = true,
                ShowHeaderTop        = true,
                ShowHeaderRight      = false,
                ShowHeaderBottom     = false,
                DefaultCellDecorator = new TopTableCellDecorator(Hud)
                {
                    BackgroundBrush = Hud.Render.CreateBrush(255, 0, 0, 0, 0),
                    BorderBrush     = Hud.Render.CreateBrush(255, 255, 255, 255, -1),
                    TextFont        = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, false, false, true),
                },
                DefaultHighlightDecorator = new TopTableCellDecorator(Hud)
                {
                    BackgroundBrush = Hud.Render.CreateBrush(255, 0, 0, 242, 0),
                    BorderBrush     = Hud.Render.CreateBrush(255, 255, 255, 255, -1),
                    TextFont        = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, false, false, true),
                },
                DefaultHeaderDecorator = new TopTableCellDecorator(Hud)
                {
                    //BackgroundBrush = Hud.Render.CreateBrush(0, 0, 0, 0, 0),
                    //BorderBrush = Hud.Render.CreateBrush(255, 255, 255, 255, 1),
                    TextFont = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, false, false, true),
                }
            };

            var columnCount = difficultiesData.GetLength(1);
            var headers     = Enumerable.Range(0, columnCount).Select(x => HeaderTemplate).ToArray();

            Table.DefineColumns(headers);

            var lineCount = difficultiesData.GetLength(0);

            for (var i = 0; i < lineCount; i++)
            {
                Table.AddLine(
                    LineHeaderTemplate,
                    LineCellsTemplate
                    );
            }
        }
コード例 #3
0
        private void InitTable()
        {
            Table = new TopTable(Hud)
            {
                RatioPositionX       = 0.5f,
                RatioPositionY       = 0.2f,
                HorizontalCenter     = true,
                VerticalCenter       = false,
                PositionFromRight    = false,
                PositionFromBottom   = false,
                ShowHeaderLeft       = true,
                ShowHeaderTop        = true,
                ShowHeaderRight      = false,
                ShowHeaderBottom     = false,
                DefaultCellDecorator = new TopTableCellDecorator(Hud)
                {
                    BackgroundBrush = Hud.Render.CreateBrush(255, 0, 0, 0, 0),
                    BorderBrush     = Hud.Render.CreateBrush(255, 255, 255, 255, -1),
                    TextFont        = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, false, false, true),
                },
                DefaultHighlightDecorator = new TopTableCellDecorator(Hud)
                {
                    BackgroundBrush = Hud.Render.CreateBrush(255, 0, 0, 242, 0),
                    BorderBrush     = Hud.Render.CreateBrush(255, 255, 255, 255, -1),
                    TextFont        = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, false, false, true),
                },
                DefaultHeaderDecorator = new TopTableCellDecorator(Hud)
                {
                    //BackgroundBrush = Hud.Render.CreateBrush(0, 0, 0, 0, 0),
                    //BorderBrush = Hud.Render.CreateBrush(255, 255, 255, 255, 1),
                    TextFont = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, false, false, true),
                }
            };

            Table.DefineColumns(
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioHeight   = 22 / 1080f,   // define only once on first column, value on others will be ignored
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            }
                );

            for (var i = 0; i < 13; i++)
            {
                Table.AddLine(
                    new TopTableHeader(Hud, (pos, curPos) => GetLineHeaderText(pos))
                {
                    RatioWidth         = 62 / 1080f, // define only once on first line, value on other will be ignored
                    RatioHeight        = 22 / 1080f,
                    HighlightFunc      = (pos, curPos) => false,
                    TextAlign          = HorizontalAlign.Right,
                    HighlightDecorator = new TopTableCellDecorator(Hud)
                    {
                        BackgroundBrush = Hud.Render.CreateBrush(255, 0, 0, 0, 0),
                        BorderBrush     = Hud.Render.CreateBrush(255, 255, 255, 255, -1),
                        TextFont        = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, true, false, true),
                    },
                    CellHighlightDecorator = new TopTableCellDecorator(Hud)
                    {
                        BackgroundBrush = Hud.Render.CreateBrush(255, 0, 0, 0, 0),
                        BorderBrush     = Hud.Render.CreateBrush(255, 255, 255, 255, -1),
                        TextFont        = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, true, false, true),
                    },
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                }
                    );
            }
        }