コード例 #1
0
ファイル: Scene.cs プロジェクト: WoLfulus/Double
 /// <summary>
 ///     Focuses the specified control.
 /// </summary>
 /// <param name="control">The control to focus on.</param>
 protected void Focus(Control control)
 {
     if (focus == control)
     {
     }
     else
     {
         if (focus != null)
         {
             focus.SetFocus(false);
         }
         control.SetFocus(true);
         focus = control;
     }
 }
コード例 #2
0
ファイル: Scene.cs プロジェクト: WoLfulus/Double
        /// <summary>
        ///     Initializes the scene.
        /// </summary>
        internal virtual void Initialize()
        {
            state = SceneState.Default;

            input = Manager.Input;

            var settings = Manager.Settings;
            Interface = new RootControl
            {
                Active = true,
                Position = Vector2.Zero,
                Size = new Vector2(settings.Resolution.BaseWidth, settings.Resolution.BaseHeight),
                Parent = null
            };

            focus = Interface;

            OnInitialize();
        }