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


C# Environment.getImg方法代码示例

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


在下文中一共展示了Environment.getImg方法的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//");
            }

            m_buttons = GuiListFactory.createListFromStringArray(Directory.GetFiles("Content//levels//"), 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();

            LinkedListNode<Button> t_buttonIt = m_buttons.First;

            while (t_buttonIt != null)
            {
                LinkedListNode<Button> t_nextIt = t_buttonIt.Next;

                if (t_levelLocked.Remove(t_buttonIt.Value.getText()))
                {
                    m_buttons.Remove(t_buttonIt);
                }
                else
                {
                    if (Game.getInstance().getProgress().hasClearedLevel(t_buttonIt.Value.getText()))
                    {
                        Environment t_cricle = new Environment(t_buttonIt.Value.getPosition().getGlobalCartesian(), "Images//GUI//drawcirkle", 0.5f);
                        t_cricle.getImg().setLooping(false);
                        t_cricle.getImg().setAnimationSpeed(20);
                        t_cricle.getPosition().plusXWith(-t_cricle.getBox().Width / 3);
                        m_objects.AddLast(t_cricle);
                    }
                    t_buttonIt.Value.m_clickEvent += new Button.clickDelegate(startLevelClick);
                }

                t_buttonIt = t_nextIt;
            }

            //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:melburn,项目名称:GLhf,代码行数:54,代码来源:HubMenu.cs


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