Beispiel #1
0
        private void Init()
        {
            var cursor = SpriteLoader.Instance.AddSprite("content/cursor");

            Text = new TextBuilder(Width, float.MaxValue);
            int index = 0;

            foreach (var action in Actions)
            {
                Text.StartTableRow(Width, new ColumnConfigs(new IColumnWidth[] {
                    new ColumnFixedWidth(16, true),
                    new ColumnFixedWidth(0, false),
                    new ColumnFixedWidth(16, true),
                })
                {
                    Padding = 0
                });
                Text.StartTableCell();
                Text.AppendElement(new TextElementCursor(cursor, 16, 16, () => IsSelected(action)));
                Text.EndTableCell();
                Text.StartTableCell();
                action.Text(Text);
                Text.EndTableCell();
                Text.StartTableCell();

                Text.EndTableCell();
                var row           = Text.EndTableRow();
                var selectionArea = new MenuAreaText(Text, 0, null);
                selectionArea.Add(row);
                SelectionAreas.Add(index, selectionArea);
                index++;
            }
            Text.EndContainer();
            Text.Finish();
            Dirty = false;
        }