当前位置: 首页>>代码示例>>C#>>正文


C# Environment.getBox方法代码示例

本文整理汇总了C#中Environment.getBox方法的典型用法代码示例。如果您正苦于以下问题:C# Environment.getBox方法的具体用法?C# Environment.getBox怎么用?C# Environment.getBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Environment的用法示例。


在下文中一共展示了Environment.getBox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: load

        public override void load()
        {
            base.load();
            m_bakimg = Game.getInstance().Content.Load<Texture2D>("Images//Automagi//karta");
            m_objects = new LinkedList<GameObject>();
            //m_levelText = new Text(new Vector2(405, 80), "New Level:", "VerdanaBold", Color.White, false);
            //m_newLevelName = new TextField(new Vector2(400, 100), 200, 32, true, true, true, 20);
            string[] t_ext = { ".lvl" };
            if (!Directory.Exists("Content//levels//"))
            {
                System.IO.Directory.CreateDirectory("Content//levels//");
            }
            string[] t_fileList = Directory.GetFiles("Content//levels//");

            m_buttons = GuiListFactory.createListFromStringArray(t_fileList, t_ext, "pin");
            m_buttons.ElementAt(0).setPosition(new Vector2(Game.getInstance().getResolution().X/3, Game.getInstance().getResolution().Y/1.9f));
            m_buttons.ElementAt(1).setPosition(new Vector2(Game.getInstance().getResolution().X / 1.8f, Game.getInstance().getResolution().Y / 2));
            //GuiListFactory.setListPosition(m_buttons, new Vector2(55, 55));
            GuiListFactory.setTextOffset(m_buttons, new Vector2(10, -20));
            //GuiListFactory.setButtonDistance(m_buttons, new Vector2(200, 30));

            LinkedList<string> t_levelLocked = getLockedLevels();

            foreach (Button t_button in m_buttons)
            {

                if (t_levelLocked.Contains(t_button.getText()))
                {
                    //t_button.setState(Button.State.Toggled);
                    t_button.setVisible(false);
                }
                if (Game.getInstance().getProgress().hasClearedLevel(t_button.getText()))
                {
                    Environment t_cricle = new Environment(t_button.getPosition().getGlobalCartesian(), "Images//GUI//cirkle", 0.5f);
                    t_cricle.getPosition().plusXWith(-t_cricle.getBox().Width/3);
                    m_objects.AddLast(t_cricle);
                }
                else
                {
                    t_button.m_clickEvent += new Button.clickDelegate(startLevelClick);
                }
            }

            //m_buttons.AddLast(m_btnTFAccept = new Button("btn_textfield_accept", new Vector2(600, 100)));
            //m_btnTFAccept.m_clickEvent += new Button.clickDelegate(createNewLevel);
            /*Button t_saveProgressButton = new Button("btn_asset_list_normal", "btn_asset_list_hover", "btn_asset_list_pressed", "btn_asset_list_toggle", new Vector2(500, 400), "Save Game", "VerdanaBold", Color.White, new Vector2(10, 0));
            t_saveProgressButton.m_clickEvent += new Button.clickDelegate(saveProgressClick);
            m_buttons.AddLast(t_saveProgressButton);*/
        }
开发者ID:theKyuu,项目名称:GLhf,代码行数:49,代码来源:HubMenu.cs


注:本文中的Environment.getBox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。