本文整理汇总了C#中FlatRedBall.Gui.Window.FindByName方法的典型用法代码示例。如果您正苦于以下问题:C# Window.FindByName方法的具体用法?C# Window.FindByName怎么用?C# Window.FindByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlatRedBall.Gui.Window
的用法示例。
在下文中一共展示了Window.FindByName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: saveSpriteRig
public static void saveSpriteRig(Window callingWindow)
{
mAssetsRelativeToSpriteRig = (callingWindow.FindByName("scnRelativeAssets") as ToggleButton).IsPressed;
string fileName = ((FileWindow)callingWindow).Results[0];
if (mAssetsRelativeToSpriteRig)
{
MessageBox mb;
string pathOfSrg = FileManager.GetDirectory(fileName);
foreach (Sprite s in GuiData.srSaveOptions.joints)
{
if (!((s.Texture.Name == null) || FileManager.IsRelativeTo(s.Texture.Name, pathOfSrg)))
{
mb = GuiManager.ShowMessageBox(string.Concat(new object[] { "Cannot save ", fileName, " because the texture ", s.Texture, " is not relative to the .srgx file." }), "Texture not relative.");
return;
}
}
foreach (Sprite s in GuiData.srSaveOptions.bodySprites)
{
if (!FileManager.IsRelativeTo(s.Texture.Name, pathOfSrg))
{
mb = GuiManager.ShowMessageBox(string.Concat(new object[] { "Cannot save ", fileName, " because the texture ", s.Texture, " is not relative to the .srgx file." }), "Texture not relative.");
return;
}
}
if ((GuiData.srSaveOptions.root != null) && !FileManager.IsRelativeTo(GuiData.srSaveOptions.root.Texture.Name, pathOfSrg))
{
mb = GuiManager.ShowMessageBox("Cannot save " + fileName + " because the texture " + GuiData.srSaveOptions.root.Texture.Name + " is not relative to the .srgx file.", "Texture not relative.");
return;
}
}
SpriteRigSave srs = new SpriteRigSave(GuiData.srSaveOptions.joints, GuiData.srSaveOptions.bodySprites, GuiData.srSaveOptions.poseChains, GuiData.srSaveOptions.root, mAssetsRelativeToSpriteRig);
srs.JointsVisible = GuiData.srSaveOptions.jointsVisible.IsPressed;
srs.RootVisible = GuiData.srSaveOptions.rootVisible.IsPressed;
GuiData.srSaveOptions.joints.Visible = true;
if (GuiData.srSaveOptions.root != null)
{
GuiData.srSaveOptions.root.Visible = true;
}
srs.Save(fileName);
}