Example #1
0
        private void GameHooks_LoadContent(ContentManager obj)
        {
            TileTypes = new int[Main.tileTexture.Length];
            TileTypes[27] = -1;
            TileTypes[34] = 1;
            TileTypes[35] = 1;
            TileTypes[36] = 1;
            TileTypes[50] = 1;
            TileTypes[78] = 2;

            Tiles = new TileFrame[Main.tileTexture.Length];
            for (int i = 0; i < Main.tileTexture.Length; i++)
            {
                if (TileTypes[i] == -1)
                    continue;

                if (TileTypes[i] == 0)
                {
                    Tiles[i] = new TileFrame(Main.tileTexture[i], Widths[i], Heights[i]);
                }
                else if (TileTypes[i] == 1)
                {
                    Tiles[i] = new OddTileFrame(Main.tileTexture[i], Widths[i], Heights[i]);
                }
                else if (TileTypes[i] == 2)
                {
                    Tiles[i] = new TileFrame(Main.tileTexture[i], Widths[i], Heights[i]);
                    Tiles[i].Border = 0;
                }
                Tiles[i].CreateFrames();
            }

            Walls = new WallFrame[Main.wallTexture.Length];
            for (int i = 1; i < Main.wallTexture.Length; i++)
            {
                Walls[i] = new WallFrame(Main.wallTexture[i], 32, 32);
                Walls[i].CreateFrames();
            }

            Backgrounds = new RawImage[Main.backgroundTexture.Length];
            for (int i = 1; i < Main.backgroundTexture.Length; i++)
                Backgrounds[i] = TextureHelper.TextureToRaw(Main.backgroundTexture[i]);

            TreeTops = new TileFrame[Main.treeTopTexture.Length];
            for (int i = 0; i < Main.treeTopTexture.Length; i++)
            {
                TreeTops[i] = new TileFrame(Main.treeTopTexture[i], Main.treeTopTexture[i].Width / 3 - 2,
                                            Main.treeTopTexture[i].Height - 2);
                TreeTops[i].CreateFrames();
            }

            TreeBranches = new TileFrame[Main.treeBranchTexture.Length];
            for (int i = 0; i < Main.treeBranchTexture.Length; i++)
            {
                TreeBranches[i] = new TileFrame(Main.treeBranchTexture[i], 40);
                TreeBranches[i].CreateFrames();
            }

            Clouds = new RawImage[Main.cloudTexture.Length];
            for (int i = 0; i < Main.cloudTexture.Length; i++)
                Clouds[i] = TextureHelper.TextureToRaw(Main.cloudTexture[i]);
        }
Example #2
0
        private void GameHooks_LoadContent(ContentManager obj)
        {
            TileTypes     = new int[Main.tileTexture.Length];
            TileTypes[27] = -1;
            TileTypes[34] = 1;
            TileTypes[35] = 1;
            TileTypes[36] = 1;
            TileTypes[50] = 1;
            TileTypes[78] = 2;

            Tiles = new TileFrame[Main.tileTexture.Length];
            for (int i = 0; i < Main.tileTexture.Length; i++)
            {
                if (TileTypes[i] == -1)
                {
                    continue;
                }

                if (TileTypes[i] == 0)
                {
                    Tiles[i] = new TileFrame(Main.tileTexture[i], Widths[i], Heights[i]);
                }
                else if (TileTypes[i] == 1)
                {
                    Tiles[i] = new OddTileFrame(Main.tileTexture[i], Widths[i], Heights[i]);
                }
                else if (TileTypes[i] == 2)
                {
                    Tiles[i]        = new TileFrame(Main.tileTexture[i], Widths[i], Heights[i]);
                    Tiles[i].Border = 0;
                }
                Tiles[i].CreateFrames();
            }

            Walls = new WallFrame[Main.wallTexture.Length];
            for (int i = 1; i < Main.wallTexture.Length; i++)
            {
                Walls[i] = new WallFrame(Main.wallTexture[i], 32, 32);
                Walls[i].CreateFrames();
            }

            Backgrounds = new RawImage[Main.backgroundTexture.Length];
            for (int i = 1; i < Main.backgroundTexture.Length; i++)
            {
                Backgrounds[i] = TextureHelper.TextureToRaw(Main.backgroundTexture[i]);
            }

            TreeTops = new TileFrame[Main.treeTopTexture.Length];
            for (int i = 0; i < Main.treeTopTexture.Length; i++)
            {
                TreeTops[i] = new TileFrame(Main.treeTopTexture[i], Main.treeTopTexture[i].Width / 3 - 2,
                                            Main.treeTopTexture[i].Height - 2);
                TreeTops[i].CreateFrames();
            }

            TreeBranches = new TileFrame[Main.treeBranchTexture.Length];
            for (int i = 0; i < Main.treeBranchTexture.Length; i++)
            {
                TreeBranches[i] = new TileFrame(Main.treeBranchTexture[i], 40);
                TreeBranches[i].CreateFrames();
            }

            Clouds = new RawImage[Main.cloudTexture.Length];
            for (int i = 0; i < Main.cloudTexture.Length; i++)
            {
                Clouds[i] = TextureHelper.TextureToRaw(Main.cloudTexture[i]);
            }
        }