Esempio n. 1
0
        protected override void Initialize()
        {
            if (!windowSizeSet)
            {
                SetDefaultResolution();
            }

            if (!windowPositionSet)
            {
                CenterWindow();
            }

            Level = new Level(this);
            base.Initialize();

#if ANDROID
            VirtualKeyboard = new VirtualKeyboard(this);
            Components.Add(VirtualKeyboard);
            VirtualKeyboard.Initialize();
            VirtualKeyboard.Hide();
#endif

            //Activated += (e, sender) => { IsActive = true; };
            //Deactivated += (e, sender) => { IsActive = false; };
        }
Esempio n. 2
0
        /// <summary>
        /// Pelin sisällön alustus
        /// </summary>
        protected void Initialize()
        {
#if DESKTOP
            ((IWindow)Window).Center();
#endif
            graphicsDevice = new Rendering.OpenGl.GraphicsDevice(Window); // TODO: GraphicsDeviceManager, jolle annetaan ikkuna ja asetukset tms. joka hoitaa oikean laitteen luomisen.
            // Graphics initialization is best done here when window size is set for certain
            InitGraphics();
            Device.ResetScreen();
            InitControls();
            InitLayers();
            InitDebugScreen();
            FixedTimeStep = true;
            InstanceInitialized?.Invoke();

            AddMessageDisplay();

            Level = new Level(this);

#if ANDROID
            VirtualKeyboard = new VirtualKeyboard(this);
            //Components.Add(VirtualKeyboard);
            VirtualKeyboard.Initialize();
            VirtualKeyboard.Hide();
#endif

            CallBegin();
        }