本文整理汇总了C#中Environment.getPosition方法的典型用法代码示例。如果您正苦于以下问题:C# Environment.getPosition方法的具体用法?C# Environment.getPosition怎么用?C# Environment.getPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Environment
的用法示例。
在下文中一共展示了Environment.getPosition方法的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);*/
}