Beispiel #1
0
        protected override void Initialize()
        {
            UITexture = Content.Load<Texture2D> ("TDUserInterface.png", TextureConfiguration.Nearest);
            SpriteSheet = new SpriteSheet2D (Content.Load<Texture2D> ("TDSheet.png", TextureConfiguration.Nearest), 16, 16);

            TileMap = new TileMap (Vector2.Zero, 26 / 2, 18 / 2, new Vector2 (16, 16), 4);
            TileMap.AddLayer ("GrassLayer", SpriteSheet);

            for (int y = 0; y < TileMap.Height; y++)
                for (int x = 0; x < TileMap.Width; x++)
                    TileMap.SetTile ("GrassLayer", x, y, new Tile { TileId = SpriteSheet.GetTileId(1, 1) });

            TileMap.AddLayer ("Track", SpriteSheet);
            var tiles = new int[][] {
                new int[] { },
                new int[] { 20, 1, 1, 2 },
                new int[] { -1, -1, -1, 32, 1, 2 },
                new int[] { 0, 1, 2, -1, -1, 16, -1, 16 },
                new int[] { 16, -1, 16, -1, -1, 18, -1, 16 },
                new int[] { 16, -1, 32, 1, 1, 34, -1, 16 },
                new int[] { 16, -1, -1, -1, -1, -1, -1, 16 },
                new int[] { 32, 1, 1, 1, 1, 1, 1, 34 }
            };

            for (int y = 0; y < tiles.Length; y++)
                for (int x = 0; x < tiles[y].Length; x++)
                    TileMap.SetTile ("Track", x, y, new Tile { TileId = tiles[y][x] });

            Font = Content.Load<Font> ("durselinvenice2015.ttf", 15f);

            base.Initialize ();
        }
Beispiel #2
0
 public Label(int width, int height, Font font)
     : base(width, height)
 {
     Transparency = 1f;
     FontSize = 14.25f;
     ForegroundColor = Color4.Black;
     Font = font;
 }