本文整理汇总了C#中Layout.Update方法的典型用法代码示例。如果您正苦于以下问题:C# Layout.Update方法的具体用法?C# Layout.Update怎么用?C# Layout.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layout
的用法示例。
在下文中一共展示了Layout.Update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WeaponBar
public WeaponBar(SpaceShip s, WeaponDisplay d)
{
ship = s;
display = d;
icons = new MeshWindow[SpaceShip.WeaponList.Length-1];
for (int i = 0; i < SpaceShip.WeaponList.Length-1; ++i)
{
icons[i] = new MeshWindow(GetIcon(SpaceShip.WeaponList[i]));
if(ship.CurrentWeapon==i)
{
Style(icons[i], true);
currentweapon = i;
}
else
{
Style(icons[i], false);
}
}
float pixelsize = 48;
Layout = new Layout(1, icons.Length);
Size = new Vector2(pixelsize, icons.Length * pixelsize);
Position = new Vector2(
8,
Root.Instance.UserInterface!=null?(Root.Instance.UserInterface.Renderer.Size.Y / 2 - Size.Y / 2):1000
);
Transparent = true;
for(int i=0;i<icons.Length;++i)
Add(icons[i],0,i);
Layout.Update(Size);
UpdateDisplayPosition();
}
示例2: ConfigListWindow
public ConfigListWindow(KeyValuePair<string, string>[] kv)
{
Layout = new Layout(2, kv.Length);
int i = 0;
foreach (KeyValuePair<string, string> item in kv)
{
Add(new TextBox(item.Key, false), 0, i);
TextBox v = new TextBox(item.Value, false);
Add(Items[item.Key] = v, 1, i++);
}
Layout.Update(Size);
}
示例3: GameMenu
public GameMenu(int team, Type ship)
: base(0, 0, Root.Instance.UserInterface.Renderer.Size.X, Root.Instance.UserInterface.Renderer.Size.Y*0.9f)
{
Center();
Transparent = true;
Layout = new Layout(3, 3);
Layout.Heights[0] = Layout.Heights[2] = 0.1f;
Add(Team = new TeamMenu(team), 0, 0);
Layout.GetCell(0, 0).Span.X = 2;
Add(Ship = new ShipMenu(ship), 0, 1);
Layout.GetCell(0, 1).Span.X = 2;
Add(new Button(OkButtonClicked, "OK"), 0, 2);
Add(new Button(QuitButtonClicked, "Quit"), 1, 2);
Layout.GetCell(2, 0).Span.Y = 3;
Layout.Widths[2] = 4;
Add(new GameInfoDisplay(),2,0);
Layout.Update(Size);
}