예제 #1
0
파일: Sample1.cs 프로젝트: AIBrain/ochregui
        /// Setup() gets called immediately after Application.Start(), and we can override this to provide custom
        /// initialization code.
        /// 
        /// The first thing we need to do in this method, however, is call the base method - this
        /// initializes libtcod, opening the system window and setting the font, all according to the options provided in
        /// the ApplicationInfo parameter.
        /// 
        /// After calling the base method, we add our setup code, in this case creating the MyWindow (defined below) object 
        /// and setting it as the current Window.
        protected override void Setup(ApplicationInfo info)
        {
            /// One thing to note: in almost all cases, when overriding a framework method it is necessary
            /// to call the base method first.  The base methods handle most of the gritty details of triggering
            /// events, propagating messages, and calling the necessary stub methods.
            base.Setup(info);

            /// Just use the default options in the WindowTemplate.
            WindowTemplate mainWindowTemplate = new WindowTemplate();

            /// Create the mainWindow with the options specified in mainWindowInfo.  We define MyWindow below.
            MyWindow mainWindow = new MyWindow(mainWindowTemplate);

            /// Set the mainWindow to be MyApplication's window.  Note that if we don't set the application window,
            /// a default one is created and set automatically.
            SetWindow(mainWindow);
        }
예제 #2
0
        /// Setup() gets called immediately after Application.Start(), and we can override this to provide custom
        /// initialization code.
        ///
        /// The first thing we need to do in this method, however, is call the base method - this
        /// initializes libtcod, opening the system window and setting the font, all according to the options provided in
        /// the ApplicationInfo parameter.
        ///
        /// After calling the base method, we add our setup code, in this case creating the MyWindow (defined below) object
        /// and setting it as the current Window.
        protected override void Setup(ApplicationInfo info)
        {
            /// One thing to note: in almost all cases, when overriding a framework method it is necessary
            /// to call the base method first.  The base methods handle most of the gritty details of triggering
            /// events, propagating messages, and calling the necessary stub methods.
            base.Setup(info);

            /// Just use the default options in the WindowTemplate.
            WindowTemplate mainWindowTemplate = new WindowTemplate();

            /// Create the mainWindow with the options specified in mainWindowInfo.  We define MyWindow below.
            MyWindow mainWindow = new MyWindow(mainWindowTemplate);

            /// Set the mainWindow to be MyApplication's window.  Note that if we don't set the application window,
            /// a default one is created and set automatically.
            SetWindow(mainWindow);
        }