Пример #1
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();
        }
Пример #2
0
 internal static void TryInitialize(Plugin notifier)
 {
     if (Current == null)
     {
         Current = new NotifyHost(notifier);
         InstanceInitialized?.Invoke();
     }
 }