本文整理汇总了C#中IScreenManager.Add方法的典型用法代码示例。如果您正苦于以下问题:C# IScreenManager.Add方法的具体用法?C# IScreenManager.Add怎么用?C# IScreenManager.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScreenManager
的用法示例。
在下文中一共展示了IScreenManager.Add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GameScreen
/// <summary>
/// Initializes a new instance of the <see cref="GameScreen"/> class.
/// </summary>
/// <param name="screenManager">The <see cref="IScreenManager"/> to add this <see cref="GameScreen"/> to.</param>
/// <param name="name">Unique name of the screen that can be used to identify and
/// call it from other screens</param>
/// <exception cref="ArgumentNullException"><paramref name="screenManager"/> is null.</exception>
/// <exception cref="ArgumentNullException"><paramref name="name"/> is null or empty.</exception>
protected GameScreen(IScreenManager screenManager, string name)
{
if (screenManager == null)
throw new ArgumentNullException("screenManager");
if (string.IsNullOrEmpty(name))
throw new ArgumentNullException("name");
_screenManager = screenManager;
_name = name;
var font = GetScreenManagerFont(ScreenManager) ?? screenManager.DefaultFont;
_guiManager = ScreenManager.CreateGUIManager(font);
screenManager.Add(this);
}