Пример #1
0
 public void addLayout(string name, GUILayout layout)
 {
     layouts.Add(name, layout);
 }
Пример #2
0
        protected override void LoadContent()
        {
            font = Content.Load<SpriteFont>("SpriteFont1");
            textureManager.loadTextures(Content);
            animationManager.load();

            TileData tileGrass = new TileData("grass", textureManager.getTexture(1), false);
            TileData tileSand = new TileData("sand", textureManager.getTexture(3), false);
            TileData tileWater = new TileData("water", textureManager.getTexture(4), true);
            TileData tileTree = new TileData("tree", textureManager.getTexture(5), true);
            TileData tileShallowWater = new TileData("shallowwater", textureManager.getTexture(15), false);

            tileManager.registerTile(tileGrass);
            tileManager.registerTile(tileSand);
            tileManager.registerTile(tileWater);
            tileManager.registerTile(tileTree);
            tileManager.registerTile(tileShallowWater); //5

            tileMap.load();
            entityTileMap.load();
            generator.generate(entityWorld);
            tileMap.update();
            entityTileMap.update();

            disFieldMixer.addDisField(tileMap.DisField);
            disFieldMixer.addDisField(entityTileMap.DisField);
            tileMap.setTreeDis(entityTileMap.DisField);

            GUIWindow = new GUIWindow();
            GUILayout layout = new GUILayout();
            //layout.addComponent("testComponent", new GUI.Components.TestComponent(textureManager.getTexture(1)));
            //GUI.Components.Label label = new GUI.Components.Label(new Point(), Color.Red, font);
            //label.Text = "banan";
            Color color = Color.Gray;
            color.A = 192;
            layout.addComponent("testLabel1", new GUI.Components.Button(new Rectangle(400, 20, 200, 50), "Button1", font, Color.White, color, 15, Color.Black));

            GUIWindow.addLayout("testLayout", layout);

            for (int i = 0; i < 50; ++i)
                entityWorld.CreateEntityFromTemplate("Test", new object[] {
                    lord,
                    new Vector2(17 + 0.2f*i, 17 + 4f*(float)Math.Sin(0.5f*i)),
                });

            for (int i = 0; i < 3; ++i)
                entityWorld.CreateEntityFromTemplate("Test2", new object[] {
                    lord,
                    new Vector2(17 + 0.2f*i, 17 + 4f*(float)Math.Sin(0.5f*i)),
                });

            for (int i = 0; i < 10; ++i)
                entityWorld.CreateEntityFromTemplate("Test2", new object[] {
                    enemyLord,
                    new Vector2(0.5f*tileMap.Size.x - 17 - 0.2f*i, 0.5f*tileMap.Size.y - 17 - 4f*(float)Math.Sin(0.5f*i)),
                });
        }