Esempio n. 1
0
        public void populateWithGrid(ContentManager content)
        {
            Texture2D texture = content.Load<Texture2D>("Env\\Dev\\devTileSheet");

            Vector2 tilePosition = new Vector2(0, 0);
            Rectangle source;

            for (int i = 0; i < Size.Y; i++)
            {
                tilePosition.X = 0;

                for (int j = 0; j < Size.X; j++)
                {
                    source = new Rectangle(0, 0, 32, 32);

                    Tile tempTile = new Tile(texture, source, true, true);
                    tempTile.setPosition(tilePosition);

                    tilePosition.X += 32;

                    TilesLayerGrid.Add(tempTile);
                }

                tilePosition.Y += 32;
            }
        }