Example #1
0
    private void LoadEntities(List <string> textlines, int width, Dictionary <char, string> entitytypechar)
    {
        ItemGrid level = new ItemGrid(width, textlines.Count, 0, "itemgrid");

        RootList.Add(level);
        level.CellWidth  = 108;
        level.CellHeight = 54;

        for (int x = 0; x < width; x++)
        {
            for (int y = 0; y < textlines.Count; y++)
            {
                try
                {
                    EditorEntity e = LoadEntity(x, y, entitytypechar[textlines[y][x]]);
                    level.Add(e, x, y);
                }
                catch
                {
                    EditorEntity e = LoadEntity(x, y, "None");
                    level.Add(e, x, y);
                }
            }
        }
    }
Example #2
0
        public async Task manipulateGrid(int delay)
        {
            await Task.Delay(delay);

//            MainGrid.Children.Add(new Button());
//            MainGrid.Columns = 4;
            if (delay < 5000)
            {
                ItemGrid.DontRemove();
            }
            else
            {
                ItemGrid.Add(new MyItem {
                    Content = $"Str 321"
                });
//                ItemGrid.DontRemove();
//                ItemGrid.GetItems()[0].Show();
            }
        }